I have a QThread that starts an external Linux binary. I use connect() to call a slot(), which is part of the QThread, whenever I get an output from that external Linux binary. This seems not to work for me. Can anyone tell me what is wrong in the below code?
class ThreadPowerSubSystem : public QThread
{
public:
ThreadPowerSubSystem(){ }
private slots:
void checkForTwoSecPress()
{
qWarning("button pressed");
}
private:
void run()
{
QProcess *powerProcess = new QProcess();
powerProcess->start("/home/testApp/button");
connect(powerProcess, SIGNAL(readyRead()), this, SLOT(checkForTwoSecPress()));
exec();
}
};
Also I need to call a function to display a dialog inside that slot. Can anyone show me an example on how to do it?