Results 1 to 7 of 7

Thread: Simple Mdi question

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2011
    Location
    Buenos Aires
    Posts
    9
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question Simple Mdi question

    Hello.
    I have a MDI area with a menu.
    that i created like this.

    Qt Code:
    1. setupUi(this);
    2. mdiArea = new QMdiArea;
    3. mdiArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    4. mdiArea->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    5. setCentralWidget(mdiArea);
    6.  
    7. setWindowTitle(tr("MDI"));
    8. setUnifiedTitleAndToolBarOnMac(true);
    To copy to clipboard, switch view to plain text mode 

    When one of hte options is clicked i create a window like this.

    Qt Code:
    1. frmUserProfile *b = new frmUserProfile;
    2. mdiArea->addSubWindow(b);
    3. b->exec();
    To copy to clipboard, switch view to plain text mode 

    Then from that window i want to open a second one when the user clicks on a button.
    the problem is that mdiArea does not exist there and if i do

    Qt Code:
    1. frmTest *t = new frmTest(this);
    2. t->exec();
    3. delete t;
    To copy to clipboard, switch view to plain text mode 

    The window is shown outside of the mdi area.

    One workaround i found is to use a signal to make the mainwindow open frmTest, but it looks like a ugly thing to do and I'm sure other problems will arise from that method.

    How can i fix the problem of Qdialogs appearing outside the MDIarea?
    I realize that maybe this is more of a c++ problem than a Qt one, sorry for that.

    Thanks!
    Last edited by slqh; 21st September 2011 at 00:04.

Similar Threads

  1. Simple question
    By zorro68 in forum Qt Programming
    Replies: 2
    Last Post: 22nd February 2011, 12:42
  2. simple MVC question!
    By landonmkelsey in forum Qt Programming
    Replies: 14
    Last Post: 19th August 2008, 12:25
  3. A simple question
    By bruccutler in forum Newbie
    Replies: 1
    Last Post: 6th April 2007, 08:54
  4. simple question
    By mickey in forum Newbie
    Replies: 2
    Last Post: 20th June 2006, 10:39
  5. Another simple question...
    By Dark_Tower in forum Newbie
    Replies: 5
    Last Post: 31st March 2006, 16:13

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.