Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved Including Qt into C program??

    General and Desktop
    qt in c program mix qt and c
    2
    3
    547
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • QT-static-prgm
      QT-static-prgm last edited by

      Hello,

      i need to write an c program. i'm writing an plugin and for some reason the interface is given in c and i'm not sure if there is a away to write it in c++ instead.

      So the point is, i'd like to use the Qt library (some simple widgets, mainly qlabel), but it does not work with my c code.

      Any ideas about that??

      Or maybe you know an other solution. I mean give a problem to 2 programmer and you'll get 10 solutions right?

      I'm working on an plugin for Teamspeak 3. It's a overlay that displays you who is talking and the chat messages,... maybe some more stuff later.

      So my idea:
      QLabel transparent background over the whole screen, make it display on the top always (i made something like that with an window once)
      And everytime someone talks, print the name (depending on the settings from the user left/right/top/down alignment) and if he stops, remove the name.

      simple right?? But the problem is, it is not that simple XD

      I have an alternative idea, but don't know how to realize that.

      write and c++ qt program that you can pass text to and then the text will be printed/removed.
      But i don't know how to make the communication between the qt program and my plugin. So if you know how i can pass data from my plugin running on TS3 to my qt c++ program it would be fine, too.

      jsulm 1 Reply Last reply Reply Quote 0
      • jsulm
        jsulm Lifetime Qt Champion @QT-static-prgm last edited by jsulm

        @QT-static-prgm Qt is written in C++ - you cannot use it in pure C.
        But since C is (more or less) a subset of C++ you can use this C interface easily in your C++ Qt app. So, no need to overcomplicate things :-)

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        QT-static-prgm 1 Reply Last reply Reply Quote 2
        • QT-static-prgm
          QT-static-prgm @jsulm last edited by

          @jsulm yeah i got it working :D i just changed the file name ending to c++ and the plugin interface automatically switched to something that inserts the C parts into c++ :D

          1 Reply Last reply Reply Quote 0
          • First post
            Last post