Results 1 to 2 of 2

Thread: [SOLVED] QMainWindow open a new QMainWindow

  1. #1
    Join Date
    Nov 2010
    Location
    planet earth
    Posts
    19
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default [SOLVED] QMainWindow open a new QMainWindow

    is it possible to open a new mainwindow from a mainwindow?

    if it is... can you tell me how?

    thanx...
    Last edited by xeroblast; 2nd December 2010 at 08:01.

  2. #2
    Join Date
    Nov 2010
    Location
    planet earth
    Posts
    19
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QMainWindow open a new QMainWindow

    finally... thanx to this : http://www.qtforum.org/article/28674...ainwindow.html

    mainwindow.h
    Qt Code:
    1. class mainWindow : public ..., private Ui..
    2. {
    3. private slots:
    4. void openNewMainWindow();
    5. }
    To copy to clipboard, switch view to plain text mode 

    mainwindow.cpp
    Qt Code:
    1. #include "newmainwindow.h"
    2. newMainWindow *newWin = 0;
    3.  
    4. mainWindow::mainWindow() : QMainWindow()
    5. {
    6. setupUi(this);
    7. connect(buttonObjectName, SIGNAL(clicked()), this, SLOT(openNewMainWindow()));
    8. }
    9. void mainwindow::openNewMainWindow()
    10. {
    11. newWin = new newMainWindow();
    12. newWin->show();
    13. }
    To copy to clipboard, switch view to plain text mode 

    newmainwindow.h & newmainwindow.cpp are just common mainwindow apps...

Similar Threads

  1. Replies: 0
    Last Post: 17th November 2010, 17:07
  2. Open QMainWindow to use xterm window as parent
    By muenalan in forum Qt Programming
    Replies: 0
    Last Post: 1st July 2010, 08:43
  3. How to close QMainWindow and open login dialog
    By keeyias in forum Qt Programming
    Replies: 3
    Last Post: 15th October 2009, 12:33
  4. error No such slot QMainWindow::open()
    By kavinsiva in forum Qt Programming
    Replies: 4
    Last Post: 12th August 2009, 07:39
  5. Open a QMainWindow in full screen mode?
    By probine in forum Qt Programming
    Replies: 7
    Last Post: 29th November 2006, 13:44

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.