[Development] Why isn't FocusScope a property on Item?

Andrew den Exter andrew.den.exter at qinetic.com.au
Tue Feb 25 14:11:58 CET 2020


On Mon, 24 Feb 2020 at 7:06 pm, Giuseppe D'Angelo via Development <
development at qt-project.org> wrote:

>
>
> So, does anyone know the historical reasoning here, or any good reason
> for not changing FocusScope just a normal property on Item?
>
> I don’t know the reason but if you just change it to a property you are
going to find yourself debugging a lot of crashes and weird state from
parent, children, and focus properties being evaluated before the focus
scope property.  If you were to defer all item focus evaluation to
componentComplete() it might be workable though.

If I really wanted to make it happen I think I’d try and work an attribute
type of concept into the language. A property you can only assign a static
value to and is guaranteed to be initialised before any bindings are
evaluated.

As or reasons for it to be its own type I’ve found the occasional need to
walk the focus hierarchy myself and if the internal focus scope and sub
focus item pointers  were public that would have been a little less
difficult. And logically the sub focus item property only belongs on
FocusItems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20200225/6e7be759/attachment.html>


More information about the Development mailing list