Results 1 to 3 of 3

Thread: QGroupBox size problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Angry QGroupBox size problem

    Hi to all!

    I've been having problems with layouts for quite some time, I've read the docs and some book but I still do not get it . I have QWidget with HBoxLayout for some pushbuttons and then vertical main layout with this pushbutton layout and under it there is QGroupBox. Now, how do I resize layout to full size of coresponding widget so the buttons and QGroupBox would be larger? Sorry for new question, but I am losing my mind ... If I harcode size with QGroupBox::setFixedSize, then it works, but this is NOT what I want ...

    Sincerely,
    Marko
    Qt 5.3 Opensource & Creator 3.1.2

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QGroupBox size problem

    Qt Code:
    1. QWidget *parent = new QWidget(this);
    2. QHBoxLayout *layout = new QHBoxLayout;
    3. parent->setLayout(layout);
    To copy to clipboard, switch view to plain text mode 

    This binds the size of the layout to it's containing widget. Is that what you need?
    Horse sense is the thing that keeps horses from betting on people. --W.C. Fields

    Ask Smart Questions

  3. The following user says thank you to franz for this useful post:

    MarkoSan (22nd November 2009)

  4. #3
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: QGroupBox size problem

    Quote Originally Posted by franz View Post
    Qt Code:
    1. QWidget *parent = new QWidget(this);
    2. QHBoxLayout *layout = new QHBoxLayout;
    3. parent->setLayout(layout);
    To copy to clipboard, switch view to plain text mode 
    This binds the size of the layout to it's containing widget. Is that what you need?
    . I forgot to create main layout for parent window! What a stupido! Thanks for guideline!
    Qt 5.3 Opensource & Creator 3.1.2

Similar Threads

  1. resizing widgets depending on a main widget size
    By luf in forum Qt Programming
    Replies: 6
    Last Post: 10th October 2009, 16:13
  2. Replies: 1
    Last Post: 15th May 2009, 07:16
  3. Drag pixmap on Windows size problem
    By plamkata in forum Qt Programming
    Replies: 1
    Last Post: 19th March 2009, 23:01
  4. Text size
    By bnilsson in forum Qt Programming
    Replies: 2
    Last Post: 2nd October 2008, 21:56
  5. Minimum QGroupBox size
    By klnusbaum in forum Qt Programming
    Replies: 3
    Last Post: 19th June 2008, 17:22

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
  •  
Qt is a trademark of The Qt Company.