Results 1 to 4 of 4

Thread: how to include one widget in another?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2011
    Posts
    160
    Thanks
    31
    Qt products
    Qt4
    Platforms
    Windows

    Default how to include one widget in another?

    I created two widget one by command another by Qt form designer. The code as shown below. When i execute two separates forms displays....What changes do i need to do, so that one form displays inside another form as single widget?

    fileopen.cpp
    Qt Code:
    1. fileopen::fileopen(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::fileopen),
    4. m_layout( new QVBoxLayout() )
    5. {
    6.  
    7. QPushButton* add = new QPushButton("Add");
    8.  
    9. connect(add, SIGNAL(clicked()), this, SLOT(addRow()));
    10.  
    11. m_layout->addWidget(add);
    12. m_layout->setAlignment(Qt::AlignTop);
    13.  
    14. QWidget* w = new QWidget();
    15. w->setLayout(m_layout);
    16. w->show();
    17.  
    18. ui->setupUi(this);
    19.  
    20. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by aurora; 2nd November 2011 at 09:09.

Similar Threads

  1. How to Include Qwt in My Project
    By gbmtoday in forum Qwt
    Replies: 8
    Last Post: 3rd February 2011, 01:13
  2. How to include a dll ???
    By anupamgee in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2010, 08:28
  3. mfc in QT include
    By trusch in forum Qt Programming
    Replies: 3
    Last Post: 16th July 2009, 10:01
  4. problem with an include
    By mickey in forum General Programming
    Replies: 1
    Last Post: 20th July 2006, 13:45
  5. include
    By mickey in forum Newbie
    Replies: 6
    Last Post: 4th April 2006, 23: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
  •  
Qt is a trademark of The Qt Company.