Results 1 to 6 of 6

Thread: how to use C code in qt?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2011
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Unhappy how to use C code in qt?

    see i have one c code , printf("hello world"); normally this c program will run by gcc in console. i lyk to develop gui for this code. that is hello world should be display in dialog box of qt.. for that what i want to do?? how to add C code(linux c) in qt? what are the libraries should add? how to use the c code in qt like how to create object and how to synchronize? please help me soon

    thanks in advance,
    shakthi

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: how to use C code in qt?

    see i have one c code , printf("hello world"); normally this c program will run by gcc in console. i lyk to develop gui for this code. that is hello world should be display in dialog box of qt.. for that what i want to do??
    Qt Code:
    1. #include <QtGui/QApplication>
    2. #include <QLabel>
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication a(argc, argv);
    7.  
    8. QLabel label("Hellow World");
    9. label.show();
    10.  
    11. return a.exec();
    12. }
    To copy to clipboard, switch view to plain text mode 

    how to add C code(linux c) in qt?
    Qt works on C++, as C++ has in-built support for C, just compile you C code as you would do in plain C++, nothing more is required.

    what are the libraries should add?
    Just include required C++ headers, no Qt files are required.

    how to use the c code in qt like how to create object and how to synchronize?
    What do you mean by object, C does not have objects's concept, also what do you mean by synchronize?

  3. #3
    Join Date
    Dec 2009
    Location
    Romania, Iasi
    Posts
    18
    Thanks
    1
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to use C code in qt?

    Start by reading some Qt tutorials first!

Similar Threads

  1. need help in qt code
    By doforumda in forum Qt Programming
    Replies: 5
    Last Post: 27th August 2010, 13:27
  2. int to hex code
    By nowire75 in forum Newbie
    Replies: 5
    Last Post: 14th January 2008, 17:00
  3. Qt 4.2.3 with C code
    By 3nc31 in forum Qt Programming
    Replies: 4
    Last Post: 19th October 2007, 22:05
  4. Pasting code from code tag in emacs
    By Gopala Krishna in forum General Discussion
    Replies: 0
    Last Post: 16th February 2007, 05:47
  5. Need help with C++ code!
    By therealjag in forum Qt Programming
    Replies: 4
    Last Post: 20th March 2006, 21:37

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.