Thread: First QT App

  1. #1
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784

    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.

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    i got a seg fault when compiling and running that (redhat 7.2)

  3. #3
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    Type:

    ls -l $QTDIR/lib
    ls -l $QTDIR/include

    To see if you have QT installed properly. You should have files in those directories.

  4. #4
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,490
    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.

  5. #5
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,273
    I take it then QT doesn't mean QuickTime?

  6. #6
    Banned Troll_King's Avatar
    Join Date
    Oct 2001
    Posts
    1,784
    It's a cross platform GUI emulator. www.trolltech.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 07:11 AM
  2. best program to start
    By gooddevil in forum Networking/Device Communication
    Replies: 4
    Last Post: 05-28-2004, 05:56 PM
  3. Need help migrating console app to windows app
    By DelphiGuy in forum C++ Programming
    Replies: 1
    Last Post: 03-14-2004, 07:05 PM
  4. pasword app
    By GanglyLamb in forum C Programming
    Replies: 2
    Last Post: 06-07-2003, 10:28 AM
  5. How do I make my Linux app standalone?
    By Joda in forum C++ Programming
    Replies: 2
    Last Post: 11-27-2002, 04:53 AM