Results 1 to 4 of 4

Thread: Resizing of WidgetStacks

  1. #1
    Join Date
    Jan 2006
    Location
    germany
    Posts
    75
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Resizing of WidgetStacks

    Hi,
    I have a problem with QStackedWidget. I have set its sizepolicy to (Preferred,Minimum) and I have set the Policy on all "pages" to the same behaviour... this results in the size of the stack always being the maximum "minumum size of alles pages", however I want it to be the minimum size of the current page!

    How would I do that?

    Thanks!
    Quote Originally Posted by Bertolt Brecht
    What is the robbing of a bank compared to the founding of a bank?

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Resizing of WidgetStacks

    One could reimplement sizeHint() to return the size hint of the current page.
    J-P Nurmi

  3. #3
    Join Date
    Jan 2006
    Location
    germany
    Posts
    75
    Thanks
    9
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Resizing of WidgetStacks

    Hm, that helped a little bit.
    The Widget is smaller now, but still too big.
    I tried to setFixedSize(ws->currentWidget()->sizeHint()) on page-change and that makes the page the right size, but this is not propagated to widgets that contain the stack and doesnt seem very clean to me.

    What else could I do to make it smaller?

    Thx!
    Quote Originally Posted by Bertolt Brecht
    What is the robbing of a bank compared to the founding of a bank?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Resizing of WidgetStacks

    How about setting the sizeHint of the stack to Fixed or enforcing a layout constraint on all pages?

Similar Threads

  1. Problem on Resizing of QTableView colums ?
    By rajeshs in forum Qt Programming
    Replies: 2
    Last Post: 28th March 2008, 04:03
  2. QTableWidget column width and resizing
    By shooogun in forum Qt Programming
    Replies: 2
    Last Post: 16th March 2008, 22:31
  3. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  4. Replies: 2
    Last Post: 14th August 2007, 15:16
  5. QMdiSubWindow resizing in 4.3
    By kalpa in forum Qt Programming
    Replies: 0
    Last Post: 4th June 2007, 13:39

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.