Hey guys,

I have a dialog widget setup to be a custom splash screen.
I am overriding paintEvent to draw some boxes on the widget.
I have a QTimer setup to run a method every half second or so.
This method updates an array and does a repaint() wich calls
paintEvent. The code in paintEvent draws the boxes on the dialog
with different opacities based on values in the array.

My problem is that my QTimer is not triggering my method.

Here is my code:
Qt Code:
  1. CINWaitSplash::CINWaitSplash(QWidget *parent, Qt::WindowFlags f)
  2. : QWidget(parent, f)
  3. {
  4. // Main Event Timer
  5. m_timerMain = new QTimer(this);
  6. connect(m_timerMain, SIGNAL(timeout()), this, SLOT(FillTable_SnakePattern()));
  7. m_timerMain->setInterval(100); // Start our Timer 1000 = 1sec
  8. m_timerMain->setSingleShot(false);
  9. }
To copy to clipboard, switch view to plain text mode 

My MainWindow has a routine that calls these to start and stop the timer:
Qt Code:
  1. void CINWaitSplash::Start()
  2. {
  3. InitTable(); // Start A Blank Table
  4.  
  5. this->show(); // Show Dialog
  6.  
  7. m_timerMain->start();
  8. }
  9.  
  10. void CINWaitSplash::Stop()
  11. {
  12. m_timerMain->stop();
  13.  
  14. this->hide(); // Hide Dialog
  15. }
To copy to clipboard, switch view to plain text mode 

So when I call Start() it displays my Dialog Widget and "starts" the timer. My MainWindow sleeps for like 10 seconds then calls Stop(). It is doing that just for testing. Anyways... my FillTable_SnakePattern() method never gets triggered by the timer. At the end of the method I am doing a repaint() like I said earlier. I am going to use this to pop up a slash screen when you do a search in my program. When the search is done, it will call Stop() and hide the splash screen.

Am I doing something wrong here? I am assuming the timer runs on another thread... right?

So if I accessed my splashscreen class like this from my mainwindow:

CINWaitSplash* CINMainWindow::INWaitSplash() { return m_qtINWaitSplash; }

I would be able to start and stop it like so:

INMainWindow()->INWaitSplash()->Start();
// sleep 10 seconds
INMainWindow()->INWaitSplash()->Stop();