Forcing a dialog box appears with its initial size from start



  • Greetings .

    I am writing a program that displays a dialog box in which, besides other widgets, there is a QLabel that displays an image. I establish the minimum size of QLabel so this keeps the same ratio width/height of the image which shows (also adapted to the screen size ) .

    However, this does not imply that the dialog appear correctly (with the image of the right size ), this will only be displayed correctly when the user manually resizes to its minimum size.

    So , my question here is: how can I force the QLabel (and thus the dialog ) appears with its minimum size from the start?.

    I think it's worth mentioning that my desire is that the dialog initially appears in the right size , but it is possible for the user to manually resize .

    Another thing is that the minimum size of QLabel (and thus the dialog ) is calculated based on the size of the image , so to force the dialog is initially deployed with the right size, I should do that into the code of my program ... after making the relevant calculations. It can not be done by setting a value for some property of QLabel from file form (.ui file) in Qt Designer (this is what I guess).

    Thanks in advance for any help and/or suggestions.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.