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. Virtual keyboard is covering my TextField when typing text
QtWS25 Last Chance

Virtual keyboard is covering my TextField when typing text

Scheduled Pinned Locked Moved QML and Qt Quick
28 Posts 7 Posters 20.8k 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.
  • S Offline
    S Offline
    strekazoid
    wrote on last edited by
    #1

    I have this weird usability issue. I have TextField component. Now you type in text on full touch device by using a keyboard. When I click on my TextField, virtual keyboard is displayed. The problem is, the keyboard is covering my TextField, so I don't see what is actually typed. I'm sort of out of ideas how this could be solved. Any suggestions are welcomed.

    1 Reply Last reply
    0
    • H Offline
      H Offline
      Hornsj2
      wrote on last edited by
      #2

      Have you tried explicityly setting the Z value of your textField to something higher than the keyboard item?

      e.g. textFieldId.z = virtualKeyboardId.z + 1

      If the virtualKeyboard is a parent of the textField it should already render on top. Not sure why it isn't.

      By the way if two items are not in the same parent/child hierarchy and are not siblings, z ordering is not respected (in my experience).

      1 Reply Last reply
      0
      • R Offline
        R Offline
        roopeshchander
        wrote on last edited by
        #3

        @strekazoid: Presumably, you're using Qt 4.7.4 because split-keyboard is not available before that. The InputContext QML element was introduced in Qt Quick 1.1 precisely to address the problem you describe. See: http://doc.qt.nokia.com/qtquick-components-symbian-1.1/splitscreen.html

        1 Reply Last reply
        0
        • H Offline
          H Offline
          Hornsj2
          wrote on last edited by
          #4

          Is there a way to tell he's talking about Symbian? I wouldn't have addressed this had I known.

          1 Reply Last reply
          0
          • R Offline
            R Offline
            roopeshchander
            wrote on last edited by
            #5

            @Hornsj2: Symbian was the first thing that came to my mind - I could be wrong about my guess as well.

            I'm curious what your answer pertains to. Are you talking about a virtual keyboard designed in QML (that you refer to as virtualKeyboardId)? Even assuming that's the case, if we say 'textFieldId.z = virtualKeyboardId.z + 1', then the textfield will be drawn over the keyboard, right? Ideally, the TextField should be repositioned so that it occupies the upper part of the screen, so that both the keyboard and the typed text are seen. The link I posted describes how to do this with symbian Qt Quick Components.

            1 Reply Last reply
            0
            • H Offline
              H Offline
              Hornsj2
              wrote on last edited by
              #6

              I'm working on an embedded desktop version. I had to write my own virtual keyboard.

              It's a series of buttons (rectangles with mouse areas) and a text field. Everything is placed using anchors.

              1 Reply Last reply
              0
              • R Offline
                R Offline
                roopeshchander
                wrote on last edited by
                #7

                @Hornsj: Ok, got it. So, in that case, my opinion was that changing the z of the textField to be above the virtualKeyboard would make it hard to type for the user because he can't see some of the keys anymore. Hence repositioning the textField, as said above, is a better solution.

                1 Reply Last reply
                0
                • H Offline
                  H Offline
                  Hornsj2
                  wrote on last edited by
                  #8

                  Well, the text field isn't overlayed upon the keys (it is above them). I'm not sure why anything needs to be repositioned. I think without a picture this isn't going to be productive. If I get a chance I'll post one.

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    strekazoid
                    wrote on last edited by
                    #9

                    I'm using Symbian TextField component for entering text. When clicking on it, I get phone's virtual keyboard displayed and hiding my TextField underneath.

                    I've checked the SplitView example, but couldn't figure out how to apply it to the TextField component.

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      strekazoid
                      wrote on last edited by
                      #10

                      One more thing. I have two TextField:s one after another (registration page). How InputContext suppose to help me in this situation?

                      1 Reply Last reply
                      0
                      • R Offline
                        R Offline
                        roopeshchander
                        wrote on last edited by
                        #11

                        @streakaoid: First things first: Are you using Qt 4.7.4 and Qt Quick 1.1? Are you on Symbian? Do you see a split-keyboard?

                        Assuming the above, the goal here (as I understand) is to ensure that the current textField (that the user is currently typing into) is fully visible. InputContext tells you the area that the virtual keyboard covers at the moment, so that you can reposition your textfield so that it doesn't overlap with the virtual keyboard.

                        I'm assuming that in your case, you have a screenful of stuff, with one or more textFields in the bottom half of the screen. When the keyboard comes up, it covers the bottom part of the screen, so only the stuff at the top is visible. The textField at the bottom becomes invisible.

                        Effectively, when the keyboard is up, the available visible area is reduced. You could now try to squeeze whatever you want visible in the reduced visible area (by reducing the height of the item by inputContext.height). If you cannot accommodate all of that in the reduced area, you can wrap all of it in a Flickable element.

                        1 Reply Last reply
                        0
                        • R Offline
                          R Offline
                          roopeshchander
                          wrote on last edited by
                          #12

                          Just saw that if you set 'platformSoftwareInputPanelEnabled: true' in your PageStackWindow, the "reducing the height of the item by inputContext.height" part, that I mentioned earlier, is automatically handled. Maybe you can just try turning that property on to check if that suffices in your case.

                          http://doc.qt.nokia.com/qtquick-components-symbian-1.1/qml-pagestackwindow.html#platformSoftwareInputPanelEnabled-prop

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            strekazoid
                            wrote on last edited by
                            #13

                            @roopeshchander: Yes, I'm on Qt 4.7.4 and Qt Quick 1.1, creating an application for Symbian Anna. To be even more clear, the virtual keyboard is visible only when I run the app on Nokia N8 device, and not visible in simulator.

                            Did some learning yesterday. Seems that inputContext is returning visible? and height properties depending on if the virtual keyboard visible. This helps, in a way that I can create states and reposition the content on the screen after vkb becomes visible.

                            What do you call "split keyboard"?

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              strekazoid
                              wrote on last edited by
                              #14

                              Is split-keyboard suppose to look something like this?: http://www.developer.nokia.com/Community/Wiki/File:Split_screen_portrait.png

                              Then no, I don't see that. I'd like to.

                              1 Reply Last reply
                              0
                              • S Offline
                                S Offline
                                strekazoid
                                wrote on last edited by
                                #15

                                Found this topic on StackOverflow:
                                http://stackoverflow.com/questions/7410695/split-screen-keyboard-in-qt-4-7-4

                                But didn't worked for me.

                                1 Reply Last reply
                                0
                                • R Offline
                                  R Offline
                                  roopeshchander
                                  wrote on last edited by
                                  #16

                                  [quote author="strekazoid" date="1321429420"]Is split-keyboard suppose to look something like this?: http://www.developer.nokia.com/Community/Wiki/File:Split_screen_portrait.png

                                  Then no, I don't see that. I'd like to.[/quote]

                                  That was before Anna. Anna and beyond, we get a QWERTY keyboard in portrait mode too. Like this: "Belle-split-view-qml-app.png":http://labs.qt.nokia.com/wp-content/uploads/2011/11/Belle-split-view-qml-app.png

                                  To enable split-view keyboard:

                                  • If you don't use Symbian Qt Quick Components 1.1, set Qt::AA_S60DisablePartialScreenInputMode to false [1]
                                  • If you use Symbian Qt Quick Components 1.1, do nothing (should already work) [1]

                                  If you don't get a splti-view keyboard even after doing the above, what are you seeing? Can you post a picture?

                                  [1] http://labs.qt.nokia.com/2011/11/08/qt-4-7-4-release-bundle-for-symbian-news/

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    strekazoid
                                    wrote on last edited by
                                    #17

                                    I've tried adding following line to main.cpp with both true and false values. Doesn't affect the behaviour of UI in any way.
                                    @QCoreApplication::setAttribute(Qt::AA_S60DisablePartialScreenInputMode, false);@

                                    Here is a screen without vkb, two textfields:
                                    !http://www.stereofinland.com/images/sc001.jpg(screenshot)!

                                    Here is a screenshot when second textfield is focused. It is hidden now under the vkb:
                                    !http://www.stereofinland.com/images/sc003.jpg(screenshot)!

                                    1 Reply Last reply
                                    0
                                    • S Offline
                                      S Offline
                                      strekazoid
                                      wrote on last edited by
                                      #18

                                      Reading the release notes about split view gives me impression that this behavior is normal and is in fact a feature. So, the only way is now for me to create additional states, one state per textfield, and adjust the view according to the vkb state?

                                      1 Reply Last reply
                                      0
                                      • R Offline
                                        R Offline
                                        roopeshchander
                                        wrote on last edited by
                                        #19

                                        [quote author="strekazoid" date="1321433304"]I've tried adding following line to main.cpp with both true and false values. Doesn't affect the behaviour of UI in any way.
                                        @QCoreApplication::setAttribute(Qt::AA_S60DisablePartialScreenInputMode, false);@
                                        [/quote]

                                        The behaviour doesn't change probably because you're already using Qt Quick Components 1.1.

                                        [quote author="strekazoid" date="1321433543"]So, the only way is now for me to create additional states, one state per textfield, and adjust the view according to the vkb state?[/quote]

                                        Did you try my earlier suggestion about setting 'platformSoftwareInputPanelEnabled: true'? That should suffice if all you have is two textfields and if they're anchored to the page (not positioned absolutely).

                                        1 Reply Last reply
                                        0
                                        • R Offline
                                          R Offline
                                          roopeshchander
                                          wrote on last edited by
                                          #20

                                          Re-reading your last post gives me the impression that you prefer the earlier interface (non-split-view keyboard), where the text entry is made in a separate view altogether (something like "this":http://qtsource.files.wordpress.com/2011/05/normal_vkb.png, but with a QWERTY layout).

                                          If indeed that's what you want, you can just switch back to Qt Quick Components 1.0, and this split-view keyboard feature will disappear altogether. Maybe that is what you're looking for?

                                          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