Results 1 to 2 of 2

Thread: qpushbutton and layout

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default qpushbutton and layout

    Hi I'd like to insert two button in a Hlayout and then try the way to enlarge them to fit entire QWidget where they are...
    Qt Code:
    1. QPushButton *canc1 = new QPushButton(widget);
    2. QPushButton *canc2 = new QPushButton(widget);
    3. canc1->setText("ok");
    4. canc2->setText("clear");
    5. l = new QHBoxLayout(widget);
    6. l->addWidget(canc1);
    7. l->addWidget(canc2);
    To copy to clipboard, switch view to plain text mode 
    In attach the result of this above; Can I enlarge them in vertical using Vlayout? (whithout use setGeometry on button)
    Attached Images Attached Images
    Regards

  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: qpushbutton and layout

    Try setting the vertical size policies of the buttons to:
    QSizePolicy::Expanding, QSizePolicy::MinimumExpanding, or maybe even QSizePolicy::Ignored...

Similar Threads

  1. Custom widgets in layout
    By Palmik in forum Newbie
    Replies: 11
    Last Post: 26th January 2009, 13:08
  2. Replies: 3
    Last Post: 30th May 2008, 08:37
  3. "dynamic" layout
    By hulk in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2006, 08:16
  4. QT4 layout of complex dialog is very slow
    By cboles in forum Qt Programming
    Replies: 15
    Last Post: 28th April 2006, 20:57
  5. Layout messing up
    By therealjag in forum Qt Programming
    Replies: 1
    Last Post: 10th April 2006, 08:40

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.