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. How to use KeyNavigation up/ down/right/left when GridView interactive is false

How to use KeyNavigation up/ down/right/left when GridView interactive is false

Scheduled Pinned Locked Moved Solved QML and Qt Quick
5 Posts 2 Posters 1.3k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    RG90
    wrote on last edited by
    #1

    Hi,

    I am working on phone dial-pad, I am using GridView for it and I don't want it to be interactive to user. So, how I can I navigate keys up/down/left/right without making interactive true. Is there is any possiblity, if so, please let me know.

    Thanks.

    1 Reply Last reply
    0
    • jpnurmiJ Offline
      jpnurmiJ Offline
      jpnurmi
      wrote on last edited by
      #2

      Does this do what you want?

      GridView {
          interactive: false
          keyNavigationEnabled: true
      }
      
      R 1 Reply Last reply
      1
      • jpnurmiJ jpnurmi

        Does this do what you want?

        GridView {
            interactive: false
            keyNavigationEnabled: true
        }
        
        R Offline
        R Offline
        RG90
        wrote on last edited by
        #3

        @jpnurmi

        It's not working for me, as I don't have QtQuick 2.7

        1 Reply Last reply
        0
        • jpnurmiJ Offline
          jpnurmiJ Offline
          jpnurmi
          wrote on last edited by
          #4

          Ok, here's an alternative solution:

          GridView {
              interactive: false
              Keys.onUpPressed: moveCurrentIndexUp()
              Keys.onDownPressed: moveCurrentIndexDown()
              Keys.onLeftPressed: moveCurrentIndexLeft()
              Keys.onRightPressed: moveCurrentIndexRight()
          }
          
          R 1 Reply Last reply
          1
          • jpnurmiJ jpnurmi

            Ok, here's an alternative solution:

            GridView {
                interactive: false
                Keys.onUpPressed: moveCurrentIndexUp()
                Keys.onDownPressed: moveCurrentIndexDown()
                Keys.onLeftPressed: moveCurrentIndexLeft()
                Keys.onRightPressed: moveCurrentIndexRight()
            }
            
            R Offline
            R Offline
            RG90
            wrote on last edited by
            #5

            @jpnurmi

            Thanks for your valuable suggestion, I figured it out. we can make
            interactive: true
            boundsBehavior: GridView.StopAtBounds
            so that you can interactive nicely, Sorry for a bad questions, I need to ask how to make GridView Flickable for user when interactive is active.

            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