PDA

View Full Version : Resize dialog as progress bar



migel
27th June 2011, 13:28
I have a QDialog as progressing bar with text message. The message is long so it automatically resize the dialog to fit the text, sometimes the text is small but the QDialog does not resize back it self.

I have played with setSizePolicy but all options does not give me an expected results.

I tried also QDialog->update(); on every progressing change.

Any ideas ?

Santosh Reddy
27th June 2011, 13:52
Use Fixed size policy for both vertical & horizontal, and no need to call update(), keep other settings as default.

Rachol
27th June 2011, 13:55
I assume that this QDialog is a top-level window, that means not in a layout. Therefore no automatic resizing will take place. You must resize the widget yourself based on sizeHints.

migel
27th June 2011, 16:23
Does not work; example:

1. |text|
2. |looooooooooooooooooooooongtext|
3. |againshorttext |


basically I want; 3 to resize back as:
3. |againshorttext|