Could u please post the relevant code..its really hard to guess the problem, although i think it will be a really trivial one
Could u please post the relevant code..its really hard to guess the problem, although i think it will be a really trivial one
Ok...found the issue.
Essentially, I had setup a call to adjustSize() when inserting a row. The call would then shrink the dialog to its _minimum_ size. However, my expectation was that the layout would inquire of the table its minimum size and the table would consider the contents and make an appropriate adjustment so the dialog would not be extremely out of proportion with its data up to the screen resolution available. However, none of that seems to happen, so it just goes it minimum size.
Eliminating the adjustSize() call fixes the issue. Is there any way to do what I was expecting it to do?
Then again, thinking about it now...that's probably something undesirable from the user's pov...one of those things that has a good intention but a bad effect...
TIA,
Ben
I figured out how to reproduce it now. Below is a link to some sample code. Note the code around 'table->insert(...)'. The 'adjustSize()' doesn't seem to bother it, but the calls to adjusting the table size information do. I tested this project on Windows using Qt 4.4.3, but I'm sure it would work the same under Linux too.
http://tinyurl.com/cfa5w4
Essentially, what I wanted was to be able to adjust the table cells to the contents, and let the user decide about the size of the dialog. However, doing so seems to adversely affect the size of the dialog itself.
Sorry, should have done this as part of the last post...occurred to me just as I hit the 'quick reply' button...
For completeness - as I'm not going to keep that tarball online forever - here's the specific code that I added to cause the problem again:
Qt Code:
void testTable::doInsertRow() { if (table != NULL) { table->insertRow(table->rowCount()); table->resizeColumnsToContents(); table->resizeRowsToContents(); table->adjustSize(); } adjustSize(); }To copy to clipboard, switch view to plain text mode
Bookmarks