Results 1 to 2 of 2

Thread: Sub Window Call

  1. #1
    Join Date
    Apr 2009
    Posts
    24
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Sub Window Call

    hello, how i call sub window "window2.ui" in main window
    thanks in advance

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 89 Times in 87 Posts

    Default Re: Sub Window Call

    Assume that the dialog name is testDialog.ui.
    Just include that UI file in your project and code like this:
    Qt Code:
    1. #include <QApplication>
    2. #include <QDialog>
    3. #include "ui_testDialog.h"
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication app(argc, argv);
    8. Ui::testDialog ui;
    9. QDialog *dialog = new QDialog;
    10. ui.setupUi(dialog);
    11. dialog->show();
    12. return app.exec();
    13. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 21:11
  2. Replies: 2
    Last Post: 9th August 2009, 23:08
  3. QMain Window Problem
    By maveric in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2008, 16:51
  4. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 10:30
  5. Change shape of window / animate window
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2007, 09:16

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.