Wait for signal while processing other signals

后端 未结 2 1351
情歌与酒
情歌与酒 2020-12-20 03:32

My Qt application talks to a serial device, and occasionally has to wait for this device to send a byte. To accomplish this, I create a new eventloop that exits as soon as t

2条回答
  •  天涯浪人
    2020-12-20 04:05

    There are several Types of which Signals and Slots can be connected.

    See: http://doc.qt.io/qt-4.8/qt.html#ConnectionType-enum

    Have you tried Qt::DirectConnection: connect(d_serial, SIGNAL(readyRead()), &wait, SLOT(quit()),Qt::DirectConnection); ?

提交回复
热议问题