[Development] AplicationWindow, QQuickWindow, contentRotation and setting width and height of contentItem

Alan Alpert 416365416c at gmail.com
Tue Aug 20 01:49:24 CEST 2013

On Fri, Aug 2, 2013 at 11:49 AM, Tomasz Olszak <olszak.tomasz at gmail.com> wrote:
>> You should also be able to work around it inside your
>> ApplicationWindow by hiding the parent property on your content item.
>> Something like "property Item parent: null" should make it look like
>> the root of the tree. It's not great, but you actually want to pretend
>> to be the root of the tree (it's not just a ModalPopupBehavior hack).
> Right it solves more issues, but modals are most common. Unfortunately i
> will not work. When I declared such property I got:
> Cannot override FINAL property
>> The other workaround that comes to mind is to define your
>> ApplicationWindow in C++ by subclassing QQuickWindow.h and
>> implementing your own contentItem which does include the rotation
>> behavior.
> I very would like to use ApplicationWindow from QtQuick.Controls module so I
> would rather not to do that.
>> Would either approach be sufficient for your needs?
> Because of above, either ApplicationWindow will be moved to C++ or another
> solution will be found or idea of reusing ApplicationWindow dropped.

> Didn't you consider such case that certain Item could be declared as quasi
> root of the tree?

>From the QtQuick.Window side, no. Root items don't really matter from
QML because they shouldn't be traversing the tree and there's no point
otherwise (because children can go outside their parent, you can't
properly use the bounding box for example). So if the controls want to
have a quasi-root item, they should probably provide it and make it

It sounds to me like ApplicationWindow would benefit from a
configurable "Item topLevelItem" property for stuff like modal dialogs
or other content which needs to be on a different layer to the 'main
scene'. This could then be used like its own contentItem, but a little
more customizable.

Another possibility would be to drop the FINAL from contentItem, While
parent is used enough that FINAL is very valuable, contentItem is just
for workarounds so dropping FINAL should be fine. Then the controls
ApplicationWindow could use the contentItem property directly for
modals and such, and you'd be able to intercept it.

Alan Alpert

PS: Sorry for the delay, I forgot about this draft :(

More information about the Development mailing list