[Development] Window{} API for QML

Alan Alpert alan.alpert at nokia.com
Mon Nov 21 23:31:03 CET 2011


On Tue, 22 Nov 2011 00:50:28 you wrote:
> 2011/11/21 Alan Alpert <alan.alpert at nokia.com>:
> > On Mon, 21 Nov 2011 17:26:44 ext Alan Alpert wrote:
> >> On Tue, 15 Nov 2011 19:24:50 ext Alan Alpert wrote:
> >> > Window{ //Not inheriting QQuickItem, creates a new top level window.
> >> > 
> >> >     property int x
> >> >     property int y
> >> >     property int width
> >> >     property int height
> >> >     property bool visible
> >> >     property Orientation requestedOrientation // { Portrait,
> >> > Landscape, Š }
> >> > 
> >> > }
> >> 
> >> http://codereview.qt-project.org/#change,9258 in qtdeclarative and
> > 
> > Whoops, that should be http://codereview.qt-project.org/#change,9352 in
> > qtdeclarative.
> 
> I think it's in a good shape for an initial API.
> Some missing features can be added later, like min/max size, modality and
> so on.
> 
> Is the Window module really necessary. I think it's a bit redundant to
> have Window.Window { }.

It's a lot redundant, I was just exaggerating it for the examples. Obviously 
normal use will be merely

import QtQuick.Window 2.0

Window{
}

But the ability to create new top-level windows sounds like the sort of thing 
you might want to turn off in some cases (e.g. if you're writing an 
application scriptable in QML). Making it a separate import makes it easier to 
turn off later.

-- 
Alan Alpert
Senior Engineer
Nokia, Qt Development Frameworks



More information about the Development mailing list