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. What is the best idea for thread communication?
Qt 6.11 is out! See what's new in the release blog

What is the best idea for thread communication?

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 3 Posters 1.2k Views 2 Watching
  • 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.
  • M Offline
    M Offline
    Mr Pang
    wrote on last edited by
    #1

    Hi,
    I am developing a linux program, the UI uses Qt, but core function uses c code (in another thread, of course). Platform is linux pc.
    Now I meet a problem. When some c structures are updated, I want to notify Qt about it.
    For example,
    struct Priv_data {
    int a;
    int b;
    } mydata;
    when mydata is updated, I want to notify Qt main thread about it(passing its address pointer) , so main thread can update the UI.
    Any good ideas?
    Thanks !

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      Can you have Qt with the core C code
      threads so you can use signals and slots ?
      or must it be compiled with c compiler ?

      1 Reply Last reply
      2
      • M Offline
        M Offline
        Mr Pang
        wrote on last edited by
        #3

        Yes, c code must be compiled with gcc. They lies in a complex project with complex Makefile, I first compile c code to .o file, then compile qt code, final link is done by hand. I link all the .o files finally.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          How is the GUI part integrated in that project ?

          In any case, you have here a list of IPC mechanism available with Qt.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1

          • Login

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