Results 1 to 2 of 2

Thread: mdi area and subwindow

  1. #1
    Join Date
    Jan 2011
    Posts
    212
    Thanks
    24
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default mdi area and subwindow

    Hello forum,

    I am trying to insert the elastic node example inside the window structure as follows:

    Qt Code:
    1. ElasticMainWindow::ElasticMainWindow(QWidget *parent) :
    2. QMainWindow(parent),
    3. ui(new Ui::ElasticMainWindow),
    4. m_graph(0),
    5. m_mdiArea(0),
    6. m_subWindow(0)
    7. {
    8. ui->setupUi(this);
    9.  
    10. //create a mdi area
    11. m_mdiArea = new QMdiArea(this);
    12. m_mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation,false);
    13.  
    14. createToolWindows();
    15.  
    16. //!set the mdi area as the central widget
    17. //!and this is how it is used in the main window
    18. setCentralWidget(m_mdiArea);
    19.  
    20. }
    21.  
    22.  
    23. void ElasticMainWindow::createToolWindows()
    24. {
    25.  
    26.  
    27. m_graph = new GraphWidget();
    28. m_graph->setWindowTitle(tr("Elastic Graph"));
    29.  
    30.  
    31. m_subWindow = new QMdiSubWindow(m_graph,Qt::FramelessWindowHint);
    32.  
    33.  
    34. m_mdiArea->addSubWindow(m_subWindow)->setWindowState(Qt::WindowMaximized);
    35.  
    36.  
    37.  
    38. }
    39.  
    40. ElasticMainWindow::~ElasticMainWindow()
    41. {
    42. delete ui;
    43. }
    To copy to clipboard, switch view to plain text mode 


    But i do see anything when the program launches. It should be showing the nodes and edges connected to each other as in the main example.


    Please point out if i miss anything.


    Regards
    Sajjad

  2. #2
    Join Date
    Feb 2008
    Posts
    491
    Thanks
    12
    Thanked 142 Times in 135 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: mdi area and subwindow

    Hi Sajjad;
    Quote Originally Posted by sajis997 View Post
    Please point out if i miss anything.
    See: QMdiSubWindow::setWidget ( QWidget * widget )

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

    sajis997 (5th February 2012)

Similar Threads

  1. QWidget in a subwindow
    By blackhole in forum Newbie
    Replies: 4
    Last Post: 27th July 2011, 10:44
  2. Replies: 0
    Last Post: 17th September 2009, 11:36
  3. Open subwindow
    By olidem in forum Qt Programming
    Replies: 8
    Last Post: 14th May 2009, 13:12
  4. cannot open a subwindow!
    By cbarmpar in forum Qt Programming
    Replies: 1
    Last Post: 22nd September 2008, 16:06
  5. subwindow mdi signal
    By walito in forum Newbie
    Replies: 8
    Last Post: 5th August 2007, 23:15

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.