[Development] Window{} API for QML

Alan Alpert alan.alpert at nokia.com
Tue Nov 15 10:24:50 CET 2011


On Fri, 11 Nov 2011 15:58:56 ext Alan Alpert wrote:
> On Thu, 10 Nov 2011 18:29:58 Knoll Lars (Nokia-MP-Qt/Oslo) wrote:
> > On 11/10/11 1:32 AM, "Alan Alpert" <alan.alpert at nokia.com> wrote:
> > >On Wed, 9 Nov 2011 06:43:34 Knoll Lars (Nokia-MP-Qt/Oslo) wrote:
> > >> I agree with most of the things in this thread, but not everything.
> > >>
> > >>Here's
> > >>
> > >> my thoughts:
> > >> 
> > >> We need a Window {} element to create surfaces on a physical screen.
> > >>
> > >>This
> > >>
> > >> Window object should IMO be more or less a direct representation of
> > >> QQuickView in QML.
> > >> 
> > >> So far we all seem to agree.  But I also do not see a need to limit
> > >> the Window {} API to the mobile use cases. I'd rather that we expose
> > >> the
> > >>
> > >>full
> > >>
> > >> functionality in one Object, and rather document some of the
> > >> differences in behavior between mobile and desktop.

If we mostly agree, then that's a good starting point. I'll start prototyping
a Window{} with the following minimal API in a QtQuick.Window import (unless 
someone has a better idea for the name, as this import could also contain the 
exposed Screen stuff that is highly related).

Window{ //Not inheriting QQuickItem, creates a new top level window.
    property string title
    property int x
    property int y
    property int width
    property int height
    property bool visible
    property Orientation requestedOrientation // { Portrait, Landscape, Š }
}

This gives us something to start with, since I don't think we're at the API 
freeze for Qt 5 just yet :) . It's also enough for creating new surfaces in 
QML, and ensures we can at least do that.

-- 
Alan Alpert
Senior Engineer
Nokia, Qt Development Frameworks



More information about the Development mailing list