I wanted with a push button the Pixmap of a label change.. so i had write this.
void MainWindow::on_pushButton_clicked()
{
ui
->label
->setPixmap
(QPixmap(QString::fromUtf8(":/new/prefix1/1.gif")));
}
void MainWindow::on_pushButton_clicked()
{
ui->label->setPixmap(QPixmap(QString::fromUtf8(":/new/prefix1/1.gif")));
}
To copy to clipboard, switch view to plain text mode
It works...
But i want after a second the label change to the previous picture again... So i had put this
void MainWindow::on_pushButton_clicked()
{
ui
->label
->setPixmap
(QPixmap(QString::fromUtf8(":/new/prefix1/1.gif")));
system("sleep 1");
ui
->label
->setPixmap
(QPixmap(QString::fromUtf8(":/new/prefix1/2.jpg")));
}
void MainWindow::on_pushButton_clicked()
{
ui->label->setPixmap(QPixmap(QString::fromUtf8(":/new/prefix1/1.gif")));
system("sleep 1");
ui->label->setPixmap(QPixmap(QString::fromUtf8(":/new/prefix1/2.jpg")));
}
To copy to clipboard, switch view to plain text mode
But it doesn't work... I think what it does is first sleep for one second and then change both pictures.... What should i do?
Bookmarks