connect(&qd,SIGNAL(destroyed()),this,SLOT(restartTimer()));
child->setParent(&qd);
qd.exec();
QDialog qd;
connect(&qd,SIGNAL(destroyed()),this,SLOT(restartTimer()));
child->setParent(&qd);
qd.exec();
To copy to clipboard, switch view to plain text mode
When exec() returns, qd goes out of scope. Since its QObject-based, it will attempt to delete all its childrens, including "child" QLabel.
What you should do is to create new QLabel (or any other widget to display image) and show the image there, something like:
timer.stop();
//...
// create a layout or something, put the label there, set it to QDialog etc...
//...
if( const QPixmap * p
= child
->pixmap
() ) label->setPixmap(*p);
connect(&qd,SIGNAL(destroyed()),this,SLOT(restartTimer()));
qd.exec();
timer.stop();
QDialog qd;
QLabel * label = new QLabel(&qd);
//...
// create a layout or something, put the label there, set it to QDialog etc...
//...
if( const QPixmap * p = child->pixmap() )
label->setPixmap(*p);
connect(&qd,SIGNAL(destroyed()),this,SLOT(restartTimer()));
qd.exec();
To copy to clipboard, switch view to plain text mode
No to mension that I wasn't able to understand how can I identify if the press event is a DoubleClick and at the same type if it is with the Left Button
use event->button() method.
Bookmarks