Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Including Qt into C program??
QtWS25 Last Chance

Including Qt into C program??

Scheduled Pinned Locked Moved Solved General and Desktop
qt in c programmix qt and c
3 Posts 2 Posters 811 Views
  • 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-prgmQ Offline
    QT-static-prgmQ Offline
    QT-static-prgm
    wrote on last edited by
    #1

    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.

    jsulmJ 1 Reply Last reply
    0
    • QT-static-prgmQ QT-static-prgm

      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.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by jsulm
      #2

      @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-prgmQ 1 Reply Last reply
      2
      • jsulmJ 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 :-)

        QT-static-prgmQ Offline
        QT-static-prgmQ Offline
        QT-static-prgm
        wrote on last edited by
        #3

        @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
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved