I'm using Qt 5.7, and I have a QWidgetTable
that starts off with no rows. When I insert the first row, the width of the table's verticalHeader (which has type QHeaderView
) changes from 0 to 15. Yet neither signal is fired.
Perhaps sectionResized
means that the user has resized the section with the mouse, but shouldn't geometriesChanged
definitely be fired?
I need this because I want the QWidgetTable
to resize its width correctly to the contents. But if I call the resize function manually immediately after inserting or deleting a row, the width()
member function of the verticalHeader returns the old value. For example, it returns 0 immediately after inserting the first row even though it should be 15.
Looking at Qt source code, geometriesChanged only fired in these cases:
case QEvent::FontChange:
case QEvent::StyleChange:
d->invalidateCachedSizeHint();
Q_FALLTHROUGH();
case QEvent::Hide:
case QEvent::Show: {
....
resizeSections();
emit geometriesChanged();
break;}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With