How to show the mainwindow.ui
-
You can install "QtCreator":http://get.qt.nokia.com/qtcreator/qt-creator-mac-opensource-2.3.1.dmg and create new project with QtCreator and you'll see realisation of such application.
Here is the default defenition of MainWindow with form created by QtCreator
main.cpp:
@
#include <QtGui/QApplication>
#include "mainwindow.h"int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();return a.exec();
}
@
Header mainwinwow.h:
@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H#include <QMainWindow>
namespace Ui {
class MainWindow;
}class MainWindow : public QMainWindow
{
Q_OBJECTpublic:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();private:
Ui::MainWindow *ui;
};#endif // MAINWINDOW_H
@
Source mainwindow.h:
@
#include "mainwindow.h"
#include "ui_mainwindow.h"MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}MainWindow::~MainWindow()
{
delete ui;
}
@
and mainwindow.pro file:
@
#-------------------------------------------------
Project created by QtCreator 2011-11-02T08:56:38
#-------------------------------------------------
QT += core gui
TARGET = MainWindow
TEMPLATE = appSOURCES += main.cpp
mainwindow.cppHEADERS += mainwindow.h
FORMS += mainwindow.ui
@P.S. -QT- it's QuickTime so it is Qt