Results 1 to 4 of 4

Thread: Opening New Form does not work.

  1. #1
    Join Date
    Nov 2011
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Opening New Form does not work.

    I have built a GUI and its working. I need to put in a page where ill put in some details of the GUI and the Licenses and End User rights for the GUI. For this i have a Push Button which when clicked should open another form where i have a Text Browser and a Link which directs to the GPL 3.0 Licenses etc. But for some reason the second form is not being called when i click on it. This is the code that i have written. Please let me know where am going wrong.
    My first form where my basic GUI is created is test.ui(which has its own test.h and test.cpp). And now i have added a dialog.ui(which has a dialog.cpp and dialog.h). My pushbutton is in test.ui whiuch when called should start the dialog.ui.
    Qt Code:
    1. void unametest::on_pushbutton_clicked()
    2. {
    3. dialog *dlg=new dialog(this);
    4. dlg->show();
    5. dlg->raise();
    6. dialog->activateWindow();
    7. }
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Opening New Form does not work.

    Is this method declared as SLOT ? Is the "clicked()" signal connected to this slot ? Is this slot called when you click the button (use qDebug() to find out) ?

  3. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Thanks
    3
    Thanked 127 Times in 126 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Opening New Form does not work.

    only showing a small part of your code.... read below.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,330
    Thanks
    317
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Opening New Form does not work.

    only showing a small part of your code.... read below.
    And the code that *is* shown won't even compile.

Similar Threads

  1. Opening form
    By jtmurphree in forum Newbie
    Replies: 3
    Last Post: 10th August 2011, 02:54
  2. Opening QUrl does not work correctly
    By JaV0 in forum Qt Programming
    Replies: 0
    Last Post: 22nd March 2011, 12:45
  3. Replies: 6
    Last Post: 13th February 2011, 23:06
  4. Hiding a form and opening another form
    By anafor2004 in forum Newbie
    Replies: 1
    Last Post: 20th February 2008, 15:04
  5. Replies: 5
    Last Post: 10th May 2006, 00:20

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.