Results 1 to 2 of 2

Thread: How to show dialog(only .ui)

  1. #1
    Join Date
    Oct 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy How to show dialog(only .ui)

    I find similar questions like mine, but i didnt find out how to do this
    This is my first app, please help

    mainwindow.ccp
    Qt Code:
    1. #include "mainwindow.h"
    2. #include "ui_mainwindow.h"
    3.  
    4.  
    5. MainWindow::MainWindow(QWidget *parent) :
    6. QMainWindow(parent),
    7. ui(new Ui::MainWindow)
    8. {
    9. ui->setupUi(this);
    10.  
    11. connect(ui->actionQuit, SIGNAL(triggered()), qApp, SLOT(quit()));
    12. connect(ui->actionInsert,SIGNAL(triggered())),qApp,SLOT(insertEmployee());
    13. }
    14.  
    15. MainWindow::~MainWindow()
    16. {
    17. delete ui;
    18. }
    19.  
    20. void MainWindow::insertEmployee()
    21. {
    22. //[B]here we call/create dialog.ui[/B]
    23.  
    24. }
    To copy to clipboard, switch view to plain text mode 
    mainwindow.h
    Qt Code:
    1. #ifndef MAINWINDOW_H
    2. #define MAINWINDOW_H
    3.  
    4. #include <QMainWindow>
    5.  
    6. namespace Ui {
    7. class MainWindow;
    8. }
    9.  
    10. class MainWindow : public QMainWindow
    11. {
    12. Q_OBJECT
    13.  
    14. public:
    15. explicit MainWindow(QWidget *parent = 0);
    16. ~MainWindow();
    17.  
    18. public slots:
    19. void insertEmployee();
    20.  
    21. private:
    22. Ui::MainWindow *ui;
    23. };
    24.  
    25. #endif // MAINWINDOW_H
    To copy to clipboard, switch view to plain text mode 
    aaasa.pro
    Qt Code:
    1. QT += core gui
    2. QT += sql
    3.  
    4. TARGET = aaasa
    5. TEMPLATE = app
    6.  
    7.  
    8. SOURCES += main.cpp\
    9. mainwindow.cpp
    10.  
    11. HEADERS += mainwindow.h
    12.  
    13. FORMS += mainwindow.ui \
    14. dialog.ui
    To copy to clipboard, switch view to plain text mode 
    Attached Files Attached Files

  2. #2
    Join Date
    Oct 2011
    Posts
    10
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to show dialog(only .ui)

    ok, i solve my problem

Similar Threads

  1. show new dialog with keeping focus.
    By guri in forum Qt Programming
    Replies: 3
    Last Post: 7th October 2011, 10:04
  2. Replies: 2
    Last Post: 6th July 2010, 13:35
  3. How to show a frameless dialog - DOESN'T WORK
    By franco.amato in forum Newbie
    Replies: 4
    Last Post: 2nd June 2010, 17:21
  4. Show dialog in screen center
    By mourad in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2008, 13:41
  5. Show dialog in the task bar
    By bruccutler in forum Newbie
    Replies: 4
    Last Post: 23rd May 2007, 22: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.