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. Shortcut: Only binding to one of multiple key

Shortcut: Only binding to one of multiple key

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

    Hello, I have this code in QML:

            Shortcut {
                enabled: map.zoomLevel < map.maximumZoomLevel
                sequence: StandardKey.ZoomIn
                onActivated: map.zoomLevel = Math.round(map.zoomLevel + 1)
            }
            Shortcut {
                enabled: map.zoomLevel > map.minimumZoomLevel
                sequence: StandardKey.ZoomOut
                onActivated: map.zoomLevel = Math.round(map.zoomLevel - 1)
            }
    
    

    When I compile it with Qt 9.10.2, I receive this runtime warning:

    21:33:46.478 [W] default: qrc:/qt/qml/abracaComponents/qml/tii/TIIMap.qml:119:9: QML Shortcut: Shortcut: Only binding to one of multiple key bindings associated with 17. Use 'sequences: [ <key> ]' to bind to all of them.
    21:33:46.478 [W] default: qrc:/qt/qml/abracaComponents/qml/tii/TIIMap.qml:114:9: QML Shortcut: Shortcut: Only binding to one of multiple key bindings associated with 16. Use 'sequences: [ <key> ]' to bind to all of them.
    

    I do non understand what is wrong and how to fix it because each Shortcut is for different action.

    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