-
First QT App
Code:
#include<qapplication.h>
#include<qlabel.h>
int main ( int argc, char * argv[] )
{
QApplication myapp (argc, argv);
QLabel* mylabel = new QLabel ("Hello, World", 0 );
mylabel->resize (120, 30);
myapp.setMainWidget (mylabel);
mylabel->show();
return myapp.exec();
}
Code:
[prompt]$ g++ -I$QTDIR/include -L$QTDIR/lib -lqt -o prog prog.cpp
[prompt]$ ./prog
It's a QT GUI textbox. The QT 3.0 enterprise library is free with the free installation of RH 7.3. It compiled and ran with no problems using GNU Linux g++. QT a GUI emulator which is different than an API emulator or API layering. Apparently these are all tactics for cross platform compatibility. Just thought some of you might be interested.
-
i got a seg fault when compiling and running that (redhat 7.2)
-
Type:
ls -l $QTDIR/lib
ls -l $QTDIR/include
To see if you have QT installed properly. You should have files in those directories.
-
i can compile fine. (i did see files in those directories, btw). it's just that running the program leads to a seg fault on my machine.
-
I take it then QT doesn't mean QuickTime? :p
-
It's a cross platform GUI emulator. www.trolltech.com