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. Problem with assigning the focus property
QtWS25 Last Chance

Problem with assigning the focus property

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 2 Posters 270 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.
  • A Offline
    A Offline
    Anita
    wrote on last edited by
    #1

    Hi,
    @J-Hilk @raven-worx @dheerendra

    I am assigning the focus for an item in a qml, by setting the focus property to true, but I am not getting any key events for that item. If I do a forceActivefocus on that item, only then the item is emitting the key events. Why doesnt the item give any key events when the focus property is set to true?

    J.HilkJ 1 Reply Last reply
    0
    • A Anita

      Hi,
      @J-Hilk @raven-worx @dheerendra

      I am assigning the focus for an item in a qml, by setting the focus property to true, but I am not getting any key events for that item. If I do a forceActivefocus on that item, only then the item is emitting the key events. Why doesnt the item give any key events when the focus property is set to true?

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      @anita if you simply write focus:true then that means, this item will have the focus, within the enclosing focusScope.

      Active focus is for example, gained by calling forceActivefocus 😉


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      3
      • A Offline
        A Offline
        Anita
        wrote on last edited by
        #3

        @J-Hilk
        Thank You for the answer.

        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