Bong.Da.City
24th August 2010, 15:21
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")));
}
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")));
}
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?
void MainWindow::on_pushButton_clicked()
{
ui->label->setPixmap(QPixmap(QString::fromUtf8(":/new/prefix1/1.gif")));
}
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")));
}
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?