Application instructions
-
Hi there,
I am following this book C++ GUI Programming with Qt 4, Second Edition and I am stuck somewhere. Would appreciate it if you could have a look here and let me know.
It says,
Save the dialog as gotocelldialog.ui in a directory called gotocell (is that a new Qt project name or just a normal folder), and create a main.cpp file in the same directory using a plain text editor:
@
#include <QApplication>
#include <QDialog>#include "ui_gotocelldialog.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);Ui::GoToCellDialog ui; QDialog *dialog = new QDialog; ui.setupUi(dialog); dialog->show(); return app.exec();
}
@
This part is the most hard,Now run qmake to create a .pro file and a makefile (qmake -project; qmake gotocell.pro). The qmake tool is smart enough to detect the user interface file gotocelldialog.ui and to generate the appropriate makefile rules to invoke uic, Qt's user interface compiler. The uic tool converts gotocelldialog.ui into C++ and puts the result in ui_gotocelldialog.h.
Where do I need to run qmake? In command prompt? If so what should be the filename? qmake <filename>
In the folder I have only,
gotocelldialog.ui and main.cpp
Thank you in advance.
-
just as written in the book:
@
qmake -project
@it will create a project file with the name of the folder. Thats why the folder name was given in the book.
If you follow the instructions, it works. The only thing that is missing is:
Open a conmmand shell and navigate to the created directory. There call.... -
You can, indeed. Remember, though, that Qt Creator is a relatively new asset in the Qt toolbox. Before we had the luxury of Creator's integrated project management features, qmake -project was pretty much the de facto standard for getting a project started.