Results 1 to 5 of 5

Thread: Resizing child widget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Resizing child widget

    My project consists of a Main Window displaying a graphical custom widget. I'd like to fill main form with widget frame, and bind together their resizing. Until now I found:

    1. Adding in MainWindow constructor the code

    ui->MyCustomWidget->setGeometry(0,0,this->width(),this->height());

    QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight,this);
    layout->addWidget(ui->MyCustomWidget);
    this->setLayout(layout);

    So doing child widget fills the parent window but do not resize according to parent resizing (do not change at all).

    2. From designer, right clicking on main form and selecting layout/layout in a grid command. So doing, child resizing works fine but I get an unwanted void frame around the widget.

    3. Subclassing MainWindow::resizeEvent. In such a case widget frame fills completely parent window and resizing works fine.

    Do you know a way to achieve 1 or 2 issues?
    Last edited by drmath; 15th November 2010 at 17:21.

Similar Threads

  1. Automatic resizing of child widgets
    By JovianGhost in forum Newbie
    Replies: 3
    Last Post: 11th March 2010, 12:47
  2. Replies: 7
    Last Post: 14th January 2010, 08:47
  3. Resizing child widget on changing size of parent?
    By anupamgee in forum Qt Programming
    Replies: 3
    Last Post: 13th November 2009, 08:39
  4. Resizing child Widget
    By Pragya in forum Qt Programming
    Replies: 1
    Last Post: 30th March 2007, 06:58
  5. Replies: 14
    Last Post: 19th March 2007, 08:48

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.