[Interest] [QtQuick] A couple of questions regarding focus

Sergey Borovkov serge.borovkov at gmail.com
Wed Sep 12 18:07:01 CEST 2012

Try to search in Qt bugzilla... I think there were lots of bugs connected
with focus and workarounds about them.
Also about you first question - I think you need to manually track focus to
know which item has it

On Wed, Sep 12, 2012 at 7:21 PM, Preet <prismatic.project at gmail.com> wrote:

> Hiya,
> I'm having trouble giving specific items in my application focus in
> Qml. First: Is it possible to query the scene to see which item
> currently has focus (without setting some visual output property on
> each and every possible thing that can receive focus)?
> Second, I have a specific case where I have a TextEdit loaded
> dynamically as a component in a ListView when certain criteria are
> met. When this ListView becomes visible, I'd like the TextEdit to be
> active so that any key events go directly to it.
> I've tried directly requesting focus (focus: true), calling
> forceActiveFocus(), etc when creating the TextEdit, but in general I'm
> shooting in the dark. I set the currentIndex to the index that
> contains the TextEdit, and I can get as far as verifying that the
> delegate item that contains the TextEdit has activeFocus, but nothing
> I do gives the TextEdit itself focus.
> delegate: http://pastie.org/4708504
> TextEdit: http://pastie.org/4708507
> I'd appreciate any advice,
> Preet
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120912/61fe0534/attachment.html>

More information about the Interest mailing list