PDA

View Full Version : Message box auto hidden!



phuong_90
6th November 2011, 12:24
Hello every one. I want to show Message box in 3 seconds, after that this message will auto hidden . Help me!

Talei
6th November 2011, 17:30
Try this:

QTimer().singleShot( 3000, messageBox, SLOT(close()) );

phuong_90
7th November 2011, 04:01
Thank Talel for your guide. I have an other question. I have a QPushButton button and I add Icon for it from a .qrc file. the image has a name. In my code I setup
the slot click() for button

void Image::on_button_clicked()
{
QString image_name=ui->p1->icon().name();
} to get name of icon. But image_name is empty. you can tell me about why it is?

Santosh Reddy
7th November 2011, 05:49
http://doc.qt.nokia.com/latest/qicon.html#name