adding timer to QInputDialog
-
Hi,
I'm trying to add 30 sec timer to QInputDialog.
From reading around i see that it isn't that simple because timer is using SIGNAL to alert it's over.So my question know on a simple way to add a timer ??
if not, can anybody willing to help me generate a new widget :-)Thanks
-
Hi,
What do you want to do with that timer ?
-
Hi.
The simplest way if you not wish to alter QInputDialog would be to create timer in the class that calls for it then connect signal from timer to one of the public slots of QInputDialog.
Please read about signals and slots here, QInputDialog has some public slots one might use inherited from QDialog and QWidget. -
I think that your question is not specifique enough
What you can do is to derive from QWidget (creating a new class)
In this class compose a QTimer object:http://doc.qt.io/qt-5/qtimer.html
Then your widget is a empty box that have the functionality of a QTimer....
If you required that the QWidget has only one shot per click (guessing), you would like to use the static function SingleShot http://doc.qt.io/qt-5/qtimer.html#singleShot
Kind Regards,
Carlos