parent nodes: QtApuntes
Hola Mundo
Versión QT 3.0
// hello.cpp file
#include <qapplication.h>
#include <qlabel.h>
int main( int argc, char * argv[] )
{
QApplication app( argc, argv );
QLabel * label = new QLabel( "Hello QT Word!", 0 ); // el cero es un pointer al widget padre (NULL xq no hay)
app.setMainWidget( label );
label->show();
return app.exec();
}
widget es un elemento visual en una interficie de usuario
¿No se hace delete de label?
From a command prompt, change directory to hello, then type
qmake -project
to create a platform-independent project file (hello.pro), then type
qmake hello.pro
to create a platform-specific makefile from the project file. Run make to build
the program, and run the program by typing hello on Windows, ./hello on
Unix, and open hello.app on Mac OS X.