Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. adding timer to QInputDialog
QtWS25 Last Chance

adding timer to QInputDialog

Scheduled Pinned Locked Moved Unsolved General and Desktop
widgetqinputdialogtimer
4 Posts 4 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Eyal Erez
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What do you want to do with that timer ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • artwawA Offline
        artwawA Offline
        artwaw
        wrote on last edited by
        #3

        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.

        For more information please re-read.

        Kind Regards,
        Artur

        1 Reply Last reply
        1
        • C Offline
          C Offline
          Charlie_Hdz
          wrote on last edited by
          #4

          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

          Kind Regards,
          Enrique Hernandez
          gearstech.com.mx
          chernandez@gearstech.com.mx

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved