Results 1 to 4 of 4

Thread: How to open a second form after a button is clicked in the first one? - FAQ question

  1. #1
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How to open a second form after a button is clicked in the first one? - FAQ question

    Hi. I want to do this:
    http://www.qtcentre.org/forum/faq.ph...esigner_2forms
    So, I added this:
    Qt Code:
    1. void Ui_MainWindow::openUi_Dialog(){
    2.  
    3. static Ui_Dialog *Ui_Dialog = new Ui_Dialog(this);
    4.  
    5. Ui_Dialog->show();
    6.  
    7. Ui_Dialog->activateWindow(); // or form2->setActiveWindow() in Qt3
    8.  
    9. Ui_Dialog->raise();
    10.  
    11. }
    To copy to clipboard, switch view to plain text mode 




    into Ui_MainWindow class. Is that correctly?
    No, it isn't. When I do it I have errors that MainWindow class does not have a member called raise, acitvateWindow and show. Even if I paste it out of this class there are errors:
    class Ui-Dialog has no member called raise, show and activateWindow. So how should I do it? Regards

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to open a second form after a button is clicked in the first one? - FAQ quest

    Quote Originally Posted by Salazaar View Post
    So how should I do it?
    Read this: http://doc.trolltech.com/4.2/designe...component.html

  3. #3
    Join Date
    May 2007
    Posts
    315
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to open a second form after a button is clicked in the first one? - FAQ quest

    Yeah, I read it but how can I do it in practice? Cause I don't really understand what is described in docs

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to open a second form after a button is clicked in the first one? - FAQ quest


Similar Threads

  1. button question
    By aegis in forum Qt Programming
    Replies: 9
    Last Post: 1st April 2007, 10:06
  2. Disable Checkable Button Question
    By jbpvr in forum Qt Programming
    Replies: 9
    Last Post: 20th March 2007, 18:57
  3. Message on close(x) button of Form
    By vishal.chauhan in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 10:39
  4. How to create an Insert/Submit button for a form.
    By fnmblot in forum Qt Programming
    Replies: 5
    Last Post: 4th August 2006, 17:18

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.