Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML TextField and overlay keyboard
Qt 6.12 LTS is out! See what's new in the release blog

QML TextField and overlay keyboard

Scheduled Pinned Locked Moved Solved QML and Qt Quick
11 Posts 2 Posters 6.8k 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #2

    You can get keyboardRectangle() from Qt.inputMethod and use that information to scroll your view.

    (Z(:^

    M 1 Reply Last reply
    0
    • sierdzioS sierdzio

      You can get keyboardRectangle() from Qt.inputMethod and use that information to scroll your view.

      M Offline
      M Offline
      Manu19
      wrote on last edited by Manu19
      #3

      @sierdzio Thank you for your fast answer. Have you a little example for me how I can use this?

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #4

        I don't, unfortunately.

        Some hackish solution is available here and here.

        (Z(:^

        M 1 Reply Last reply
        0
        • sierdzioS sierdzio

          I don't, unfortunately.

          Some hackish solution is available here and here.

          M Offline
          M Offline
          Manu19
          wrote on last edited by
          #5

          @sierdzio Thank you, this helps a lot

          1 Reply Last reply
          0
          • M Offline
            M Offline
            Manu19
            wrote on last edited by Manu19
            #6

            Does anyone know how to move the flickable to a specific height. I`ve tested a bit with flickable.flick, but this seems not the proper way

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #7

              Try setting contentX or contentY properties.

              (Z(:^

              M 1 Reply Last reply
              0
              • sierdzioS sierdzio

                Try setting contentX or contentY properties.

                M Offline
                M Offline
                Manu19
                wrote on last edited by Manu19
                #8

                @sierdzio Whith which function should i test it? Flickable does not have a function to move it programmaticaly besides flick( )

                sierdzioS 1 Reply Last reply
                0
                • M Manu19

                  @sierdzio Whith which function should i test it? Flickable does not have a function to move it programmaticaly besides flick( )

                  sierdzioS Offline
                  sierdzioS Offline
                  sierdzio
                  Moderators
                  wrote on last edited by sierdzio
                  #9

                  @Manu19 said in QML TextField and overlay keyboard:

                  @sierdzio Whith which function should i test it? Flickable does not have a function to move it programmaticaly besides flick( )

                  contenxtX is a property. Just set it's value to any value you need and it will update the position automatically.

                  For example:

                  Button {
                    onClicked: flickable.contentY += 100
                  }
                  
                  Flicakble {
                    id: flickable
                    // some contents
                  }
                  

                  Or:

                  Flickable {
                    id: flickable
                    contentY: keyboardRect.height
                  }
                  
                  Rectangle {
                    id: keyboardRect
                    height: keyboardVisible? 500 : 0
                  }
                  

                  (Z(:^

                  M 1 Reply Last reply
                  0
                  • sierdzioS sierdzio

                    @Manu19 said in QML TextField and overlay keyboard:

                    @sierdzio Whith which function should i test it? Flickable does not have a function to move it programmaticaly besides flick( )

                    contenxtX is a property. Just set it's value to any value you need and it will update the position automatically.

                    For example:

                    Button {
                      onClicked: flickable.contentY += 100
                    }
                    
                    Flicakble {
                      id: flickable
                      // some contents
                    }
                    

                    Or:

                    Flickable {
                      id: flickable
                      contentY: keyboardRect.height
                    }
                    
                    Rectangle {
                      id: keyboardRect
                      height: keyboardVisible? 500 : 0
                    }
                    
                    M Offline
                    M Offline
                    Manu19
                    wrote on last edited by
                    #10

                    @sierdzio Shame on me. I thought contentY would be readOnly. I should go to bed and sleep. Thank you for your patience and for your example

                    sierdzioS 1 Reply Last reply
                    0
                    • M Manu19

                      @sierdzio Shame on me. I thought contentY would be readOnly. I should go to bed and sleep. Thank you for your patience and for your example

                      sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #11

                      @Manu19 said in QML TextField and overlay keyboard:

                      @sierdzio Shame on me. I thought contentY would be readOnly. I should go to bed and sleep. Thank you for your patience and for your example

                      Hehe, no worries. This property actually sounds almost as if it should be read-only. Before I wrote my reply I checked several times if it was writable or not, because I felt intuitively that it could not be :-) So, I understand you 100% here :D

                      (Z(:^

                      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
                      • Unsolved