QLabel animation does not work - need to implement text blinking (flashing) after some time periods. What I'm doing wrong?
Code is following:
	
	- m_p1stHeaderAnimation = new QPropertyAnimation(ui.m_labelHeader1, "text", this); 
-     m_p3rdHeaderAnimation = new QPropertyAnimation(ui.m_labelHeader3, "text", this); 
- ... 
- m_p1stHeaderAnimation->setDuration(1300); 
- 	m_p1stHeaderAnimation->setKeyValueAt(0, "Flashing text 1"); 
- 	m_p1stHeaderAnimation->setKeyValueAt(0.77, ""); 
- 	m_p1stHeaderAnimation->setKeyValueAt(1, ""); 
- 	m_p1stHeaderAnimation->setLoopCount(5); 
-   
- 	/// Setups 3rd header animation 
- 	m_p3rdHeaderAnimation->setDuration(1300); 
- 	m_p3rdHeaderAnimation->setKeyValueAt(0, "Flashing text 3"); 
- 	m_p3rdHeaderAnimation->setKeyValueAt(0.77, ""); 
- 	m_p3rdHeaderAnimation->setKeyValueAt(1, ""); 
- 	m_p3rdHeaderAnimation->setLoopCount(5); 
- ... 
- 	// Start next header animation after previous 
- 	connect(m_p1stHeaderAnimation, SIGNAL(finished()), m_p3rdHeaderAnimation, SLOT(start())); 
- 	connect(m_p3rdHeaderAnimation, SIGNAL(finished()), m_p1stHeaderAnimation, SLOT(start())); 
- ... 
- 	m_p1stHeaderAnimation->start(); 
        m_p1stHeaderAnimation = new QPropertyAnimation(ui.m_labelHeader1, "text", this);
    m_p3rdHeaderAnimation = new QPropertyAnimation(ui.m_labelHeader3, "text", this);
...
m_p1stHeaderAnimation->setDuration(1300);
	m_p1stHeaderAnimation->setKeyValueAt(0, "Flashing text 1");
	m_p1stHeaderAnimation->setKeyValueAt(0.77, "");
	m_p1stHeaderAnimation->setKeyValueAt(1, "");
	m_p1stHeaderAnimation->setLoopCount(5);
 
	/// Setups 3rd header animation
	m_p3rdHeaderAnimation->setDuration(1300);
	m_p3rdHeaderAnimation->setKeyValueAt(0, "Flashing text 3");
	m_p3rdHeaderAnimation->setKeyValueAt(0.77, "");
	m_p3rdHeaderAnimation->setKeyValueAt(1, "");
	m_p3rdHeaderAnimation->setLoopCount(5);
...
	// Start next header animation after previous
	connect(m_p1stHeaderAnimation, SIGNAL(finished()), m_p3rdHeaderAnimation, SLOT(start()));
	connect(m_p3rdHeaderAnimation, SIGNAL(finished()), m_p1stHeaderAnimation, SLOT(start()));
...
	m_p1stHeaderAnimation->start();
To copy to clipboard, switch view to plain text mode 
  m_labelHeader1 and m_labelHeader3 - QLabel class objects.
I even tied signals valueChanged to repaint slots just to be safe:
	
	- disconnect (- m_p1stHeaderAnimation,  SIGNAL(- valueChanged (QVariant))- , ui. m_labelHeader1- ,  SLOT(- repaint ()))- ; 
-     disconnect (- m_p3rdHeaderAnimation,  SIGNAL(- valueChanged (QVariant))- , ui. m_labelHeader3- ,  SLOT(- repaint ()))- ; 
        disconnect(m_p1stHeaderAnimation, SIGNAL(valueChanged(QVariant)), ui.m_labelHeader1, SLOT(repaint()));
    disconnect(m_p3rdHeaderAnimation, SIGNAL(valueChanged(QVariant)), ui.m_labelHeader3, SLOT(repaint()));
To copy to clipboard, switch view to plain text mode 
  but it does not work anyway. Why?
				
			
Bookmarks