A little problem with signals



  • Hi everyone,

    I am kind of new to the qt and i had this problem.

    i have a signal defined as

    @signals:
    void dataReceived(QByteArray &data);@
    and i am calling this function/signal like this,
    @emit dataReceived(incoming_data);@

    and finally

    @connect(serialPort, SIGNAL(dataReceived(const QByteArray &)), this, SLOT(slot_newDataReceived(const QByteArray &)));@

    The problem is, i debug and see the data coming but when i said "connect", it should call this function @slot_newDataReceived(const QByteArray &)@ but nothing happens.

    Sorry about my english,
    Thanks



  • You define a signal <code>dataReceived(QByteArray &)</code>, but you're trying to connect to a signal <code>dataReceived(const QByteArray &)</code>.



  • [quote author="Lukas Geyer" date="1325257719"]You define a signal <code>dataReceived(QByteArray &)</code>, but you're trying to connect to a signal <code>dataReceived(const QByteArray &)</code>.[/quote]

    Thanks,
    It works. i had so much work and i could have missed it.



  • [quote author="thehilmisu" date="1325258157"]
    It works. i had so much work and i could have missed it. [/quote]

    Such things just happen. Having an eye on the debug help helps in such situations.

    <code>Object::connect: No such signal Object::dataReceived(const QByteArray&)</code>.


Log in to reply
 

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