Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Language Bindings
  4. Can C functions send data to QT Slots in QT5.7 ?
Forum Updated to NodeBB v4.3 + New Features

Can C functions send data to QT Slots in QT5.7 ?

Scheduled Pinned Locked Moved Unsolved Language Bindings
3 Posts 3 Posters 923 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.
  • V Offline
    V Offline
    vivekyuvan
    wrote on last edited by vivekyuvan
    #1

    Dear Friends

    I want to do some trail work for proof of concept of my project.

    What I need is I have C source code that needs to communicate with QT slots. I am using QT Creator IDE and QT5.7.

    Ex 
    unsigned int a[100]={ 25,  17 , 10,  6,  -5 , -6, -8 , 10, ......... };
    
    
    
    I am required to send this array data to QT GUI through Slots,  from C source file to QT Slots is that possible? 
    
    If possible please someone shows the code snippet in QT that will help me a lot 
    
    
    Thanks 
    
    vivekyuvan
    aha_1980A 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      You can't send a signal from C. You can create a C++ wrapper around your C code, though, and emit the signal from there.

      (Z(:^

      1 Reply Last reply
      2
      • V vivekyuvan

        Dear Friends

        I want to do some trail work for proof of concept of my project.

        What I need is I have C source code that needs to communicate with QT slots. I am using QT Creator IDE and QT5.7.

        Ex 
        unsigned int a[100]={ 25,  17 , 10,  6,  -5 , -6, -8 , 10, ......... };
        
        
        
        I am required to send this array data to QT GUI through Slots,  from C source file to QT Slots is that possible? 
        
        If possible please someone shows the code snippet in QT that will help me a lot 
        
        
        Thanks 
        
        vivekyuvan
        aha_1980A Offline
        aha_1980A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @vivekyuvan

        As @sierdzio already said, you cannot directly call C++ from C, and therefore you cannot use Qt.. But it is possible to write a wrapper, like discussed here: https://stackoverflow.com/questions/3583353/calling-c-class-member-function-from-c-code

        From within the C++ class, you can access all kind of Qt stuff again.

        Qt has to stay free or it will die.

        1 Reply Last reply
        2

        • Login

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