Hi,

I have a singleton class, call it MySingleton, which contains a pointer to an object of type MyObj.

MyObj dervies from QObject, uses the Q_OBJECT macro, and contains the following:

Qt Code:
  1. QTimer *pTimer;
  2.  
  3. MyObj()
  4. {
  5. pTimer = new QTimer(this);
  6. connect(pTimer, SIGNAL(timeout()), this, SLOT(MySlot()));
  7. pTimer->start(1000);
  8. }
  9.  
  10. MySlot()
  11. {
  12. //stuff here
  13. }
To copy to clipboard, switch view to plain text mode 

When debugging, it reaches the constructor, the connection returns true, and the timer should have started successfully. But if I place a breakpoint in MySlot, it's never called.

I never actually use the singleton instance of MySingleton...but it is initialized on startup, which is evident by the fact that the debugger reaches the MyObj constructor. Is it something with this hierarchy that's causing a problem? I assume it might be, since I have a Timer/slot connection like this in even another class which I have a pointer to in MySingleton. Neither work.

All help is greatly appreciated