I don't quite understand what it is you have written but the following code should show another image every 500 ms:
//in frmMain.h you add:
int m_iImage;
//in the constructor you add:
m_iImiage = 1;
//and then in your slot:
void frmMain::timerSlot()
{
switch(m_iImage)
{
case 1: strImageName = "sample1.jpg"
break;
case 2: strImageName = "sample2.jpg"
break;
case 3: strImageName = "sample3.jpg"
break;
case 4: strImageName = "sample4.jpg"
break;
case 5: strImageName = "sample5.jpg"
m_iImage = 0;
break;
}
fm
->setPaletteBackgroundPixmap
(QPixmap(strImageName
) );
m_iImage++;
}
//in frmMain.h you add:
int m_iImage;
//in the constructor you add:
m_iImiage = 1;
//and then in your slot:
void frmMain::timerSlot()
{
QString strImageName;
switch(m_iImage)
{
case 1: strImageName = "sample1.jpg"
break;
case 2: strImageName = "sample2.jpg"
break;
case 3: strImageName = "sample3.jpg"
break;
case 4: strImageName = "sample4.jpg"
break;
case 5: strImageName = "sample5.jpg"
m_iImage = 0;
break;
}
fm->setPaletteBackgroundPixmap(QPixmap(strImageName ) );
m_iImage++;
}
To copy to clipboard, switch view to plain text mode
This is just variant of doing this, there may be others too.
Bookmarks