Results 1 to 3 of 3

Thread: Integrating C with Qt

  1. #1
    Join Date
    Jun 2007
    Location
    India
    Posts
    33
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Unhappy Integrating C with Qt

    Hello all
    I am working on a 'front end' in Qt 4.2.2 for a testing automation program whose backend is done in C.

    Could anyone please tell me how I can integrate the C code with Qt?
    Specifically, how can i call some functions from the C part in my Qt app?

    I tried searching, but its neglecting the term 'C'. Any pointers would be of much help.
    Thank you.

  2. #2
    Join Date
    Jan 2006
    Location
    Bremen, Germany
    Posts
    554
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Integrating C with Qt

    I don't understand your question - what's the problem simply calling your C-functions?

  3. #3
    Join Date
    May 2007
    Posts
    19
    Thanks
    5
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Integrating C with Qt

    Quote Originally Posted by deepakn View Post
    Could anyone please tell me how I can integrate the C code with Qt?
    Specifically, how can i call some functions from the C part in my Qt app?
    This is nothing Qt specific. You can just call the functions of your C backend as needed. If your C code is compiled by a C compiler, and not a C++ compiler, you should wrap the function prototypes of the C code in
    Qt Code:
    1. #ifdef __cplusplus
    2. extern "C" {
    3. #endif
    4.  
    5. /* ... function prototypes here */
    6.  
    7. #ifdef __cplusplus
    8. }
    9. #endif
    To copy to clipboard, switch view to plain text mode 

    to account for different name mangling of C and C++ compilers.

Similar Threads

  1. Need help integrating sigc++ with a KDE3/Qt3 app
    By Valheru in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2007, 15:39
  2. Replies: 2
    Last Post: 27th June 2007, 10:23
  3. non-rectangular windows , integrating qt
    By liorm in forum Qt Programming
    Replies: 3
    Last Post: 29th April 2007, 12:56
  4. integrating Qt files in open cascade?
    By Shuchi Agrawal in forum Qt Tools
    Replies: 5
    Last Post: 9th January 2007, 05:27
  5. Integrating Qt applications in a Framework
    By kewltea in forum Newbie
    Replies: 1
    Last Post: 15th November 2006, 07:01

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.