Qt Forum

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

    Solved Connecting the push of a button with a QPushButton?

    General and Desktop
    2
    3
    847
    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.
    • P
      Pedro_Monteiro last edited by Pedro_Monteiro

      Hello, how can I connect the push of a keyboard key (up, down left, right) with 4 different QPushButton?
      I've tried the QShortcut class, but I did not find examples that can give me a good explanation.

      Ratzz 1 Reply Last reply Reply Quote 0
      • Ratzz
        Ratzz @Pedro_Monteiro last edited by Ratzz

        @Pedro_Monteiro
        You can use QShortcut with QKeySequence with key enum.
        and connect something like this

           connect(shortcut, SIGNAL(activated()), this, SLOT(on_pushButton_Up_clicked()));

        --Alles ist gut.

        P 1 Reply Last reply Reply Quote 1
        • P
          Pedro_Monteiro @Ratzz last edited by

          @Ratzz Thanks, you saved me.

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