How to use non ui signals/slots?



  • Hi,
    i just wanted to try the frameReceived() signal from qcanbus.
    But how to do it?
    I tried it this way:

    connect(can,SIGNAL(framesReceived()),this,SLOT(receiveFrames()));
    

    can is my QCanBus device.
    But the programm keeps crashing at the start.
    i want to receive some frames, then jump to my receiveFrames function to read it.
    Is this a possibility to avoid threads? im not good with threads either (qt noobie, but lover :) )
    thanks in advance


  • Qt Champions 2017

    @haxxe said in How to use non ui signals/slots?:

    Hi
    it seems right.

    can is a pointer to QCanBusDevice that you have new'ed, correct ?

    Could you use the debugger and find the line it crashes on ?



  • My bad, i new it when i click a button, therefore there is no can before the program starts. after putting the initpart before,it works.
    Thanks !


  • Qt Champions 2017

    @haxxe
    Super.
    I imagined something like that.
    Please mark as solved if possible.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.