Results 1 to 10 of 10

Thread: QDockWidget Size

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Frankfurt, Germany
    Posts
    34
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QDockWidget Size

    Hallo,

    i'm trying to convince a QDockWidget to resize itself to a proper size, but it alway takes away half of the window size. (at the bottom)

    It would be perfect if the QDockWidget resized itself always in a certain relation to the total size of the Window (as 1/4).

    I tried this, but it didn't help. A resize() also doesn't have any effect (I think because of the QLayout)

    EDIT: think of setVerticalPolicy where there's setHorizontalPolicy down there. It doesn't make any sense in the other way. What do I need to set for SizePolicy if I want him to use VerticalStretch?

    Qt Code:
    1. QSizePolicy sizePolicy2;
    2. sizePolicy2.setVerticalStretch(3);
    3. sizePolicy2.setHorizontalPolicy(QSizePolicy::Expanding);
    4. centralWidget2->setSizePolicy(sizePolicy2);
    5. //chat erstellen
    6. dockwidget=new QDockWidget(this);
    7. dockwidget->setAllowedAreas(Qt::AllDockWidgetAreas);
    8. addDockWidget(Qt::BottomDockWidgetArea, dockwidget);
    9. chatwidget=new Chat(dockwidget);
    10. dockwidget->setWidget(chatwidget);
    11. QSizePolicy sizePolicy;
    12. //sizePolicy.setHorizontalStretch(3);
    13. sizePolicy.setHorizontalPolicy(QSizePolicy::Minimum);
    14. sizePolicy.setVerticalStretch(1);
    15. dockwidget->setSizePolicy(sizePolicy);
    To copy to clipboard, switch view to plain text mode 

    Thanks,
    Andre
    Last edited by kiker99; 7th February 2006 at 20:01.

Similar Threads

  1. QDockWidget size
    By user in forum Qt Programming
    Replies: 2
    Last Post: 8th January 2009, 20:35
  2. QT-wince and QHttp::readAll() trouble....
    By AcerExtensa in forum Qt for Embedded and Mobile
    Replies: 6
    Last Post: 12th June 2008, 09:40
  3. QLabel size policy
    By Caius Aérobus in forum Qt Programming
    Replies: 3
    Last Post: 7th December 2007, 17:57
  4. Default size of a QListWidget inside a QDockWidget
    By rakuco in forum Qt Programming
    Replies: 0
    Last Post: 25th July 2007, 08:01
  5. Qt 4.1.1 linker warnings
    By Matt Smith in forum Installation and Deployment
    Replies: 0
    Last Post: 26th February 2006, 22:14

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.