You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried this a few ways, but haven't sorted it yet. Do you know an easy way to calculate the entire height for the container widget that is the QTreeView? I've tried to use QFontMetrics and the number of rows, but it's incomplete. Just getting a size on the view returns 480 no matter what.
This example is what I current do to set the view. It's my current height calculation, though it ignores a lot of details. I'm just hoping you may know a better way than to calculate all the internals.
m_layout = new QVBoxLayout();
m_data = new QJsonModel();
m_view = new QTreeView();
m_data->load(obj);
m_view->setModel(m_data);
m_layout->addWidget(m_view);
QFontMetrics fm = m_view->fontMetrics();
int r = m_data->rowCount();
int h = fm.height() * r;
The text was updated successfully, but these errors were encountered:
I've tried this a few ways, but haven't sorted it yet. Do you know an easy way to calculate the entire height for the container widget that is the QTreeView? I've tried to use QFontMetrics and the number of rows, but it's incomplete. Just getting a size on the view returns 480 no matter what.
This example is what I current do to set the view. It's my current height calculation, though it ignores a lot of details. I'm just hoping you may know a better way than to calculate all the internals.
The text was updated successfully, but these errors were encountered: