Hi,

Something that I've always wondered about (and hopefully whose reasons have been lost in the Nokia times) is why FocusScope exists a dedicated item, rather than simply being an ordinary property on Item?

Any custom QQuickItem subclass can be a FocusScope, it just needs to set a flag on itself. Why is the flag something only toggable from C++, rather than being a Q_PROPERTY?


The *entire* implementation of FocusScope is exactly what one may think:

QQuickFocusScope::QQuickFocusScope(QQuickItem *parent)
: QQuickItem(parent)
{
    setFlag(ItemIsFocusScope);
}


What's the problem with this? It's just that one needing a focus scope in QML needs to introduce a new element in the tree. That is *super* annoying: it messes up sizing / anchoring, requires aliasing properties from FocusScope's contents, and so on.

So, does anyone know the historical reasoning here, or any good reason for not changing FocusScope just a normal property on Item?



(Note: I'm not opening the problem about whether a component/top level item in a QML file isn't automatically a focus scope -- that would lead to "interesting" complications of the language.)

Thanks,
--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to