-
Notifications
You must be signed in to change notification settings - Fork 150
Open
Description
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;
Metadata
Metadata
Assignees
Labels
No labels