Qt grooves communication signals through two classes

qt need to communicate through the signal slot, connect time is always returns false, consult the company's a little brother, before we can solve the problem, although it is a very idiotic question.

bool b = QObject :: connect (m_pCollectOb , SIGNAL (QCollectObject :: getData (void)), this, SLOT (SendData (void))); 
the above code is present in the class's constructor function resides in the groove.
Read:
bool b = QObject :: connect (m_pCollectOb , SIGNAL (getData (void)), this, SLOT (SendData (void))); 
it.

Said slot during operation of this signal:
in QCollectObject class, there is a timer, the getData transmit signals, in the present (Class i.e. where the slot function SendData) data will be transmitted via SendData.

Guess you like

Origin www.cnblogs.com/warmlight/p/10979870.html