I'm relatively new to this - just been doing Qt4 for a little over a week, so please forgive me if this is something is seemingly obvious to the more skilled. I've really grown to love Qt - it's just so much more logical and well planned than MFC, Win32, or anything else I've worked with.
FYI - I'm using Qt 4.4.3, Windows Commercial, under VS2008.
I'm having a trouble with a dialog resizing on me. I'm already using several layout managers - added through QtDesigner - as follows:
Side Bar:
+-------------------------+
| <fix vertical> | <- fixed to keep height from top the same
| button |
| <expanding vertical> |
|<fix horizontal> | <- to line up with the lower bar, fixed to keep width the same
+-------------------------+
Lower Bar:
+----------------------------------------------------------------+
| <expanding horizontal> button <expanding horizontal> |
+----------------------------------------------------------------+
Central Bar:
+-----------------+
| QTableWidget |
+-----------------+
| Lower Bar |
+-----------------+
Main Layout of QDialog:
+-----------+--------------+
| Side Bar | Central Bar |
+-----------+--------------+
My problem is that the QDialog gets resized whenever I insert a row into the QTableWidget (via QTableWidget::insertRow()).
Aside from the specifically fixed bars, everything is set to have an QSizePolicy::Expanding size policy, and the size constraints have been set to QLayout::SetNoConstraint.
The odd behaviour is that the QDialog will shrink below even the size of QTableWidget if I have a minimum size set in the QTableWidget - cutting off the vertical scroll bar.
It will somewhat abide by a minimum size if I set it - but then the dialog is way too big, and I'd really like to be able to let the user resize the dialog.
I had had a minimum width set for a while, but the resize issue would still occur as it would resize away any height I had added - meaning I would have to resize only after I had added all the rows I wanted.
Any tips, help, etc. would be greatly appreciated.
TIA,
Ben
Bookmarks