Results 1 to 9 of 9

Thread: multiple windows

  1. #1
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default multiple windows

    Hello.

    I don't find any example about creating multiple windows in QT4.

    as,
    Form1, Form2, Form3.
    click Button in form1 then open form2


    Can You give me some advice or example how to create multiple windows ?
    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: multiple windows


  3. #3
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multiple windows

    Quote Originally Posted by tbscope View Post
    Its not multiple Forms

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: multiple windows

    Yes it is!

  5. #5
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: multiple windows

    Here it is, another one:
    Qt Code:
    1. #include <QApplication>
    2. #include <QWidget>
    3. #include <QDialog>
    4. #include <QPushButton>
    5. #include <QLabel>
    6.  
    7. int main(int argc, char** argv) {
    8. QApplication a(argc, argv);
    9.  
    10. QWidget *w = new QWidget(0);
    11. QPushButton *b = new QPushButton("Show Dialog", w);
    12.  
    13. QDialog *dlg = new QDialog(w);
    14. QLabel *l = new QLabel(dlg);
    15. l->setText("Hi, I'm a instance of QDialog class");
    16.  
    17. QObject::connect(b, SIGNAL(clicked()), dlg, SLOT(show()));
    18.  
    19. w->show();
    20.  
    21. int r = a.exec();
    22. delete w;
    23. return r;
    24. }
    To copy to clipboard, switch view to plain text mode 
    You can replace the QWidget and QDialog with classes you inherit from them (with or without ui)

  6. #6
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multiple windows

    Quote Originally Posted by tbscope View Post
    Yes it is!


    I want to work a set of Forms

  7. #7
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: multiple windows

    It's possible I don't understand what you ask. I regularly have that problem.

    But in the addressbook tutorial, they create a find dialog:
    http://doc.qt.nokia.com/4.6/tutorial...ook-part5.html

  8. #8
    Join Date
    Jul 2010
    Posts
    71
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: multiple windows

    I want an example as follows
    There is a list of the Left
    When I click on Enviroment or Text Editor watch the forms




    Last edited by NewLegend; 9th September 2010 at 21:35.

  9. #9
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: multiple windows

    Hmmm, this doesn't have anything to do with multiple windows.
    Please, next time try to ask a better question.

    What you want is a listwidget on the left and a stacked widget on the right.
    When you click on a listwidgetitem in the list, you can bring a certain widget in the stacked widgets to the front.

    http://doc.qt.nokia.com/4.6/dialogs-configdialog.html

Similar Threads

  1. Multiple windows
    By bgturk in forum Qt Programming
    Replies: 0
    Last Post: 23rd April 2009, 10:03
  2. how to create multiple windows in QT
    By durgarao in forum Qt Tools
    Replies: 1
    Last Post: 9th January 2009, 14:47
  3. Multiple versions of Qt in Windows?
    By gfunk in forum Qt Programming
    Replies: 1
    Last Post: 27th August 2007, 19:07
  4. QGLWidget and multiple windows
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 21st November 2006, 13:38

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.