Results 1 to 4 of 4

Thread: RunTime Execution

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

    Default RunTime Execution

    hey to all, i create the ui Files more than one. At the execution one Ui file call successfully opened by the Pushbutton Clicked. But When I want to open Another Ui file From Previous opened Ui file it can't open. The Code are same, and i include also its header file But it can not work.
    Its .cpp file is
    Qt Code:
    1. #include "sessiondetail.h"
    2. #include "mainwindow.h"
    3. #include "ui_mainwindow.h"
    4. #include <QWidget>
    5. #include <QDebug>
    6. #include "ui_2x.h"
    7. #include "ui_mainwindow2.h"
    8.  
    9. sessiondetail::sessiondetail()
    10. {
    11. connect(ui->btn_s_2x,SIGNAL(clicked()),this,SLOT(on_btn_s_2x_clicked()));
    12. }
    13. // that window open successfully
    14. void MainWindow::on_btn_screate_clicked()
    15. {
    16. Ui::sessiondetail ui;
    17. QMainWindow *sessiondetail = new QMainWindow;
    18. ui.setupUi(sessiondetail);
    19. sessiondetail->show();
    20. }
    21. // this MainWindow2X not be open
    22. void sessiondetail::on_btn_s_2x_clicked()
    23. {
    24. Ui::MainWindow2X ui;
    25. QMainWindow *MainWindow2X = new QMainWindow;
    26. ui.setupUi(MainWindow2X);
    27. MainWindow2X->show();
    28. }
    To copy to clipboard, switch view to plain text mode 
    the header file is

    Qt Code:
    1. #ifndef SESSIONDETAIL_H
    2. #define SESSIONDETAIL_H
    3. #include <QMainWindow>
    4. #include <QWidget>
    5. namespace Ui
    6. {
    7. class MainWindow;
    8. class sessiondetail;
    9. }
    10. class sessiondetail : public QMainWindow
    11. {
    12.  
    13. public:
    14.  
    15. private:
    16. Ui::sessiondetail *ui;
    17. private slots:
    18. void on_btn_s_ica_clicked();
    19.  
    20. void on_btn_s_2x_clicked();
    21.  
    22. };
    23.  
    24. #endif // SESSIONDETAIL_H
    To copy to clipboard, switch view to plain text mode 

    sorry for poor english.
    Thanks in ADvance

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

    Default Re: RunTime Execution

    You forgot to put Q_OBJECT macro in class declaration.

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

    Default Re: RunTime Execution

    Its Not a MainWindow header file .Its a another header file under MainWindow.
    I Also put Q_OBECT Errors occured.
    thanks

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

    Default Re: RunTime Execution

    Any Other Solution PLz

Similar Threads

  1. Qwt Data_Plot Example Runtime Error
    By AlphaWolfXV in forum Qwt
    Replies: 8
    Last Post: 27th January 2010, 10:11
  2. I want runtime error output in qt creator IDE
    By Si1ver in forum Qt Programming
    Replies: 11
    Last Post: 20th June 2009, 21:13
  3. Runtime Error!
    By blm in forum Qt Programming
    Replies: 6
    Last Post: 25th September 2008, 14:56
  4. Replies: 5
    Last Post: 21st February 2007, 22:11
  5. Replies: 5
    Last Post: 7th December 2006, 11:47

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.