Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Shortcuts & QtQuick.Controls

Shortcuts & QtQuick.Controls

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 180 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.
  • A Offline
    A Offline
    ASBazhenov
    wrote on last edited by
    #1

    Hi guys & gals,

    I got confused with QML Shortcuts... Here is a trivial example with Qt 5.14 / QtQuick.Controls 2.14:

    ApplicationWindow {
        Shortcut {
            sequence: "Ctrl+U"
            onActivated: print("/shortcut/ activated")
        }
        TextField {}
    }
    

    I expect the Shortcut to be activated every time I press Ctrl+U, no matter what. However, when the TextField receives the active focus, it seems to consume the Ctrl+U combination to perform an undo operation. I would do Keys.forwardTo and use the Shortcut as a target if it were possible but Shortcut isn't an Item.

    So, the Shortcut isn't at the top of the priority list, is it? Is there any sophisticated way to ensure that the Shortcut is triggered no matter what happens, i.e. no matter where the active focus is?

    1 Reply Last reply
    1

    • Login

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