Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Show QMenu after a while

    General and Desktop
    2
    2
    405
    Loading More Posts
    • 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.
    • ivanicy
      ivanicy last edited by

      Hello!!

      I am trying to show a menu, activated with a QPushButton. I want to press the button and, after 2 seconds, show a QMenu. How can I do this?

      Thank you very much!

      Taz742 1 Reply Last reply Reply Quote 0
      • Taz742
        Taz742 @ivanicy last edited by Taz742

        @ivanicy
        You can use QTimer.
        http://doc.qt.io/qt-5/qtimer.html#singleShot-prop

        QTimer::singleShot(2000, this, [=]{
            //open a window
        });
        

        You registered on this forum JOINED 9 FEB 2017, Have not used QTimer yet? :D.

        Do what you want.

        1 Reply Last reply Reply Quote 5
        • First post
          Last post