Hi, I'm starting with QT, I try to connect a slot to signal QProcess::started() but can't. QObject::connect() returns false.
Any idea what am I doing wrong?
Here's part of the code:
{
public:
public slots:
void process_started();
}
foo::foo()
{
bool status
= QObject::connect( process,
SIGNAL( started
() ),
this,
SLOT( process_started
() ) );
// status is false, meaning the slot and signal couldn't be connected
}
class foo : public QObject
{
public:
QProcess *process;
public slots:
void process_started();
}
foo::foo()
{
process = new QProcess();
bool status = QObject::connect( process, SIGNAL( started() ), this, SLOT( process_started() ) );
// status is false, meaning the slot and signal couldn't be connected
}
To copy to clipboard, switch view to plain text mode
I know the process starts successfully because I tried process->WaitForStarted() and it returns true.
But I put a breakpoint at the slot foo::process_started() and it never gets hit.
What's the problem here?
Thanks!
Bookmarks