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. QDeclarativeView inside full screen QWidget does not get focus at startup

QDeclarativeView inside full screen QWidget does not get focus at startup

Scheduled Pinned Locked Moved QML and Qt Quick
4 Posts 2 Posters 3.0k 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.
  • L Offline
    L Offline
    ludde
    wrote on last edited by
    #1

    To be able to emulate different screen sizes on a single device, I decided to wrap my QDeclarativeView inside a QWidget, with a QLayout. For some weird reason this made my QDeclarativeView not get keyboard focus at startup, if I open the QWidget in full screen mode. In non-fullscreen mode, focus works as expected.

    The only workaround for this I have come up with is to add another widget, e.g. an invisible QPushButton, to the layout before I add the QDeclarativeView, and then move the focus to the QDeclarativeView using setFocus() after I open the widget.

    Is this something that anyone else has experienced, or has some kind of explanation for? Or is it simply a bug?

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mohsen
      wrote on last edited by
      #2

      I've problem with order number on devices too. Unfortunately the first focused object after running application is the whole widget. I use a QTimer with "singleshot" property set to "true" and then call to give the focus to the first object.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        ludde
        wrote on last edited by
        #3

        I filed a bug report about this, "QTBUG-22882":https://bugreports.qt.nokia.com/browse/QTBUG-22882, with a minimal example that can be used to reproduce the problem.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mohsen
          wrote on last edited by
          #4

          nice job ;) it should be fixed. thank you

          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