PDA

View Full Version : QtCreator and Zetcode tutorials



dwarnold45
26th March 2010, 22:37
All,

I am new to C++ programming and Qt, so I need a slower start than provided in the QtCreator tutorials. I've found:

http://www.zetcode.com/tutorials/qt4tutorial/introduction/

The first example is:

#include <QApplication>
#include <QWidget>

int main(int argc, char *argv[])
{
QApplication app(argc, argv);

QWidget window;

window.resize(250, 150);
window.setWindowTitle("Simple example");
window.show();

return app.exec();
}

Now, I'm wondering if I can somehow load this simple code into QtCreator and compile, getting the resulting window to pop up. Possible?

David.

ChrisW67
26th March 2010, 22:56
Yes.

Start Qt Creator.
File > New Project. Select "Empty Qt4 Project".
File > New File or Project. Select "C++ Source File"
Name the file (e.g. main.cpp), and paste your code in.
Build.