hersheyzombie
23rd October 2009, 07:12
I am using Qt 4.5.2
I have a .ui to which I assigned a horizontal layout, and placed into it a qLabel.
The qLabel has scaledContents set to true.
During program execution, I set a pixmap to that qLabel. This causes the label (and the entire MainWindow) to resize to the dimensions of that pixmap. This is not my desired behavior.
I have found that in previous versions of Qt, qLabels had an autoResize property that determined whether they would expand themselves for larger content. It appears that in Qt 4.5.2, there is no longer such a property and the label will always automatically expand itself.
If anyone knows how to disable autoresizing for the qLabel or if there is another type of widget onto which I can easily display a pixmap that will not resize unless the window is resized by the user, please let me know.
Thanks.
I have a .ui to which I assigned a horizontal layout, and placed into it a qLabel.
The qLabel has scaledContents set to true.
During program execution, I set a pixmap to that qLabel. This causes the label (and the entire MainWindow) to resize to the dimensions of that pixmap. This is not my desired behavior.
I have found that in previous versions of Qt, qLabels had an autoResize property that determined whether they would expand themselves for larger content. It appears that in Qt 4.5.2, there is no longer such a property and the label will always automatically expand itself.
If anyone knows how to disable autoresizing for the qLabel or if there is another type of widget onto which I can easily display a pixmap that will not resize unless the window is resized by the user, please let me know.
Thanks.