Hi !
I’m studying Qt 5.2. I downloaded the mingw “edition”.
I need you help to have a step-by-step [and updated) info about starting a widget app.
I do this
Start the QtCreator
Choose the Other Projects -> Empty Qt Project
Choose the source dir
Actually I got an empty .pro.
Ok.
Now I’d like to create just a dialog
right-click on project name and add Qt->Qt Desgner Form Class
I choose Dialog withouth buttons and leave othe properties untouched
Add a button
Save all
right-click on project and add c++ -> c++ source file, calling it main.cpp
Now my .pro looks as:
FORMS += \
dialog.ui
HEADERS += \
dialog.h
SOURCES += \
dialog.cpp \
main.cpp
The main question is: what’s the best-practice code ?
I used this
#include "dialog.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Dialog w;
w.show();
return a.exec();
}
But i got this error:
C:\Qt_Projects\Hello10\dialog.h:4: error: QDialog: No such file or directory
#include <QDialog>
^
What’s the problem.. ?
↧