FuryCradle
25th September 2009, 05:48
Hello,
I am new to QT.. well my question is probably is a basic C++ thingy anyway..
I want to develop the application and having in mind that i should make each window in it's own c++ file, for a start i want to have the main.cpp to only contain the basic application setup, then develop the mainwindow in another c++ file, for example:
main.cpp:
#include "main.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
return a.exec();
}
then have a mainwindow class in another c++ file
mainWindow.cpp
#include <QMainWindow>
class MainWindow : public QMainWindow
{
public:
MainWindow();
};
MainWindow::MainWindow()
{
setWindowTitle("Test");
}
now i want to know how to add the MainWindow class to the app in main.cpp? i mean how to add it to the application then call it from there?
I am new to QT.. well my question is probably is a basic C++ thingy anyway..
I want to develop the application and having in mind that i should make each window in it's own c++ file, for a start i want to have the main.cpp to only contain the basic application setup, then develop the mainwindow in another c++ file, for example:
main.cpp:
#include "main.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
return a.exec();
}
then have a mainwindow class in another c++ file
mainWindow.cpp
#include <QMainWindow>
class MainWindow : public QMainWindow
{
public:
MainWindow();
};
MainWindow::MainWindow()
{
setWindowTitle("Test");
}
now i want to know how to add the MainWindow class to the app in main.cpp? i mean how to add it to the application then call it from there?