[Development] renaming all QWindow properties that have "window" in them
Shawn.Rutledge at digia.com
Fri Oct 19 18:46:01 CEST 2012
QWindow has properties like windowTitle, windowIcon, windowModality, windowState and so on, which are named that way to be familiar to users of QWidget. However it causes some silliness in Qt Quick: QQuickWindow inherits QWindow, and that means it inherits those properties too (even though they have not yet been documented). But we would like the QML API for Window to be more typical, e.g.
title: "the title"
QQuickWindow could of course add the extra properties, but then you would be able to access either one, because I don't know of a way to hide an inherited property. Furthermore because inherited signals don't work in Q_PROPERTY declarations, it's not enough to just add
Q_PROPERTY(Qt::WindowModality modality READ windowModality WRITE setWindowModality NOTIFY windowModalityChanged)
in order to reuse the accessors and just rename the property. There must be a new signal in the subclass too. So then I have to add a setter to emit the signal when the property changes. This is why it's easier to rename them in QWindow; and really the naming was redundant anyway. If you have a QWidget, you need to be clear what kind of title is being set, because there can be an implied window; but if you have a QWindow it's already clear.
So that change resulted in the following patches so far:
and I have one for Webkit as well. I just wondered if there are any objections before we proceed with testing and trying to integrate this, or if anyone sees something that I missed. I will be doing further testing to make sure we get the desired result in Qt Quick.
More information about the Development