Create a QTimer, connect its timeout() signal to the slot in which you'll change the images. In such slot you should use setPixmap function.
Example:
connect(slideShow,SIGNAL(timeout()),this,SLOT(changePixmap()));
//...
MainWindow::changePixmap()
{
ui.
labelName.
setPixmap(QPixmap("C:/path_to_image/imageName" + QString.
setNum(imgNum
) + ".ext"));
//imgNum can be for example a private object of MainWindow class imgNum = (imgNum + 1) % 10 //for a series of 10 images with names "imageName(0-9).ext"
}
QTimer *slideShow = new QTimer(this);
connect(slideShow,SIGNAL(timeout()),this,SLOT(changePixmap()));
//...
MainWindow::changePixmap()
{
ui.labelName.setPixmap(QPixmap("C:/path_to_image/imageName" + QString.setNum(imgNum) + ".ext")); //imgNum can be for example a private object of MainWindow class
imgNum = (imgNum + 1) % 10 //for a series of 10 images with names "imageName(0-9).ext"
}
To copy to clipboard, switch view to plain text mode
Bookmarks