Results 1 to 3 of 3

Thread: call the other dialog through dialog

  1. #1
    Join Date
    Jan 2008
    Posts
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default call the other dialog through dialog

    hi..

    Im new to Qt and this is my first time programming c++ along with Qt. Im now working on my undergraduate project to create a front-end to mencoder utility. I develop this application using KDevelop and this is what I want to do right now:
    - call the other dialog from one running dialog

    my project consists of several form, I got one main form that will call other form with a click of button. let say in my main form I want to call 'settings' form. So my main window source file i did this:

    Qt Code:
    1. #include "mainwindow.h"
    2. #include "configuration.h"
    3.  
    4. mainWindow::mainWindow(QWidget* parent, Qt::WFlags fl)
    5. : QWidget( parent, fl ), Ui::mainWindow()
    6. {
    7. setupUi(this);
    8. }
    9.  
    10. mainWindow::~mainWindow()
    11. {
    12. connect(btnSettings, SIGNAL(clicked()),this,SLOT(settings()));
    13. }
    14.  
    15. void mainWindow::settings()
    16. {
    17. configuration * conf = new configuration();
    18. conf->show();
    19. }
    To copy to clipboard, switch view to plain text mode 
    but it did not work after I've compile it and click on the button. Where did I made a mistake?

  2. #2
    Join Date
    Jul 2008
    Location
    Germany
    Posts
    506
    Thanks
    11
    Thanked 76 Times in 74 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: call the other dialog through dialog

    Hi,
    if you connect your signal in the destructor, this connection won't be of much use since the object will be destroyed right after your connect() call. Move this connect to constructor.

    Ginsengelf

  3. #3
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: call the other dialog through dialog

    In this case i would use
    Qt Code:
    1. conf->exec();
    To copy to clipboard, switch view to plain text mode 
    I'm a rebel in the S.D.G.

Similar Threads

  1. Replies: 9
    Last Post: 13th August 2008, 18:07
  2. Resizing the dialog boxes
    By anju123 in forum Qt Programming
    Replies: 4
    Last Post: 14th September 2007, 10:41
  3. QGraphicsView: Dialog Position Doubt
    By arjunasd in forum Qt Programming
    Replies: 1
    Last Post: 6th August 2007, 17:48
  4. how to call another dialog using menubar
    By merry in forum Qt Programming
    Replies: 1
    Last Post: 16th April 2007, 14:28
  5. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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.