+ Reply to Thread
Results 1 to 2 of 2

Thread: qpushbutton and layout

  1. #1
    Join Date
    Jan 2006
    Posts
    970
    Thanks
    52
    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,505 Times in 1,383 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...

+ Reply to Thread

Similar Threads

  1. Custom widgets in layout
    By Palmik in forum Newbie
    Replies: 11
    Last Post: 26th January 2009, 12:08
  2. Replies: 3
    Last Post: 30th May 2008, 07:37
  3. "dynamic" layout
    By hulk in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2006, 07:16
  4. QT4 layout of complex dialog is very slow
    By cboles in forum Qt Programming
    Replies: 15
    Last Post: 28th April 2006, 19:57
  5. Layout messing up
    By therealjag in forum Qt Programming
    Replies: 1
    Last Post: 10th April 2006, 07: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