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. QKeySequence (modifier+key) only works after pressing the key first without the modifier
Forum Updated to NodeBB v4.3 + New Features

QKeySequence (modifier+key) only works after pressing the key first without the modifier

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 430 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.
  • WoGiW Offline
    WoGiW Offline
    WoGi
    wrote on last edited by
    #1

    Hi, I have a simple QWidget. I want to run one of its methods when I press Alt+`.

    This shortcut works fine, but only when I've pressed ` first at least once (so without the Alt key). If I do this once, the hotkey will continue to work as expected for the rest of the session.

    RatzzR 1 Reply Last reply
    0
    • WoGiW WoGi

      Hi, I have a simple QWidget. I want to run one of its methods when I press Alt+`.

      This shortcut works fine, but only when I've pressed ` first at least once (so without the Alt key). If I do this once, the hotkey will continue to work as expected for the rest of the session.

      RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by
      #2

      @WoGi
      I have tried to reproduce it , but could not .
      I tried this and works for me.

          QShortcut *shortcut = new QShortcut(QKeySequence("Alt+`"), this);
          QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(yourSolt()));

      --Alles ist gut.

      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