Results 1 to 4 of 4

Thread: Resize dialog as progress bar

  1. #1
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Resize dialog as progress bar

    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 ?

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Resize dialog as progress bar

    Use Fixed size policy for both vertical & horizontal, and no need to call update(), keep other settings as default.
    Last edited by Santosh Reddy; 27th June 2011 at 12:52. Reason: updated contents

  3. #3
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: Resize dialog as progress bar

    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.

  4. #4
    Join Date
    Apr 2011
    Posts
    132
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Resize dialog as progress bar

    Does not work; example:

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


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

Similar Threads

  1. Progress Bar Dialog using threads
    By dove17 in forum Newbie
    Replies: 3
    Last Post: 9th April 2010, 16:46
  2. resize Dialog to minimum height
    By pospiech in forum Qt Programming
    Replies: 7
    Last Post: 25th June 2009, 14:04
  3. Replies: 4
    Last Post: 10th June 2009, 11:29
  4. Resize all components in a dialog
    By bdQtdev in forum Qt Tools
    Replies: 5
    Last Post: 10th January 2008, 10:13
  5. progress DIalog
    By mickey in forum Newbie
    Replies: 2
    Last Post: 26th July 2006, 14:30

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.