QSocketNotifier: socket notifiers cannot be enabled from another thread



  • I have a write(QByteArray write_data) function in the worker thread doing a socket->write(write_data).
    I want to trigger it from the main/gui thread function guiInfoToWorker() fnction which sends a QByteArray by emitting a signal with parameter a QByteAray.

    I am currently trying to achieve this using connect() in main.cpp which is throwing me errors:
    QSocketNotifier: socket notifiers cannot be enabled from another thread
    QSocketNotifier: socket notifiers cannot be disabled from another thread

    in both Qt::DirectConnection and Qt::QueuedConnection.


  • Lifetime Qt Champion

    Hi,

    How are you creating your QSocketNotifier ?


Log in to reply
 

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