Hi,

> enum ViewMode {
>      HiddenView,
>      FullsizeView,
>      ThumbnailView,
>      IconView
> }

Some of those states seem specific to a particular look & feel and yeah they 
should belong in platform-specific part of Qt Components instead of QtQuick. 
You expect functionality provided by QtQuick elements to work more or less the 
same on all platforms, which we cannot guarantee for modes like ThumbnailView 
or IconView. We will probably still introduce applicationActive property in 
QtQuick 1.1 for convenience as that can be provided for all platforms.

A
Cheers,

Joona

-----Original Message-----
From: qt-components-bounces+joona.t.petrell=nokia....@qt.nokia.com 
[mailto:qt-components-bounces+joona.t.petrell=nokia....@qt.nokia.com] On Behalf 
Of Kervinen Antti (Nokia-MS/Tampere)
Sent: Friday, December 17, 2010 1:03 AM
To: qt-compone...@trolltech.com; Laitinen Harri.T (Nokia-MS/Tampere); Kellomaki 
Pertti (Nokia-MS/Tampere); Junnonen Tomas (Nokia-MS/Helsinki); Lind Jussi 
(Nokia-MS/Tampere); Leppanen Olli (Nokia-MS/Tampere)
Subject: [Qt-components] [Proposal] Visibility API for QML applications 
(Revised)

Hello!

Thank you very much for the comments!

I'd like to present a revised proposal for this visibility API. There 
are two syntactical changes.

1. The name of the property is changed from "visibility" to "viewMode". 
We wish to avoid confusion with the boolean-valued "visible" property of 
visual QML elements. On the other hand, "ViewMode" has similar meaning 
for instance in W3C standard [1], yet the possible values there are not 
that suitable for our purposes. Furthermore, ViewMode of certain widgets 
in Qt affects how their contents is shown. That's what it could do in 
QML applications as well.

2. A part of the enum name is repeated in the values (thanks to Rich 
pointing this out). This convention is used in Qt with ViewModes in 
qlistview.h, qprintpreviewwidget.h and qmdiarea.h, though it's not in 
the ViewMode of qfiledialog.h.

That is, the property definition will be like

Q_PROPERTY(ViewMode viewMode READ viewMode NOTIFY viewModeChanged)

enum ViewMode {
     HiddenView,
     FullsizeView,
     ThumbnailView,
     IconView
}

If nobody starts screaming (please don't hesitate to do so if you feel 
like it -- it's not too late), we'll go ahead with this.

Btw, does anyone have suggestions which branch from which repo we could 
start with? That is, where could we find a suitable C++ class that'll be 
exposed as "window" or something similar to QML?

Yours,

Antti

[1] http://dev.w3.org/2006/waf/widgets-vmmf/#view-modes

On 12/08/2010 04:12 PM, ext Antti Kervinen wrote:
> Proposal: Visibility API for QML applications
>
> The purpose of the visibility API is to provide information on the
> visibility of the window to the application.
>
> The visibility information can be used for
>
> - stopping all unnecessary activity when user can't see the window
>     (everyone must save battery, cpu and memory)
>
> - quick-saving modified user data when the window is hidden (your app
>     might be closed/killed when on background)
>
> - adapting contents of the window and update activities according to
>     different visibility states.
>
>
> Visibility information will be available in some context object in
> QML. The object is to be decided when the page/window question has
> been settled.
>
> The API will consist of a read-only "visibility" property whose
> changes can be observed via visibilityChanged(Visibility) signal. The
> parameter can get the following values:
>
> enum Visibility {
>       Hidden,
>       Fullsize,
>       Thumbnail,
>       Icon
> };
>
> The idea of different values is that the system displaying the
> application window can give a hint to the application on what kind of
> content the window should hold.
>
> Example: a weather application presents 7 days weather forecast when
> it's shown in full screen. The same content can be shown when the
> window is in the switcher but it is still almost of the real size.
> Under the hood switcher sets a window property that states that the
> application window is "fullsize" even if it's slightly shrinked. When
> the window is shown as a smallish thumbnail in the switcher, switcher
> sets the property to "thumbnail" and the application shows only the
> weather of today and tomorrow. When it's shown as a very small
> thumbnail or like a "live icon" in an application grid, it shows only
> the current temperature. In this case the switcher/desktop tells the
> window to be of the size of an icon.
>
> If some UI specs suddenly require switcher to show windows always with
> the real content, switcher just sets the window property to be
> "fullsize" whenever the window thumbnail is visible.
>
> For comparison, libmeegotouch provides visibility information with two
> separate signals: 1) can be seen on the display, and 2) window is in
> the switcher. We believe that combining this information to the same
> signal and adding some semantics servers better both application
> developers and prototyping different UI designs.
>
> Any comments are very much welcome.
>
> Yours,
>
> Antti
>
> Ps. We prototyped this by listening to both visibility notifications
> from the window manager and changes in the
> _MEEGOTOUCH_VISIBLE_IN_SWITCHER (boolean) window property set by the
> desktop. Outcome were values hidden/fullsize/thumbnail. We hacked all
> necessary code to mdeclarativescreen.
>
> We had (still unsolved) problems with getting Q_ENUMS(Visibility)
> nicely shown on the QML side. Another thing that could be expected to
> become an issue in the real implementation is how to connect the id of
> the X window to the QML object in case of multi-window applications. In
> the prototype we just used QApplication::topLevelWidgets() because
> there was only one window and luckily it was already registered to
> that list when we installed XEvent handler.
> _______________________________________________
> Qt-components mailing list
> qt-compone...@trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-components

_______________________________________________
Qt-components mailing list
Qt-components@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-components
_______________________________________________
Qt-components mailing list
Qt-components@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-components

Reply via email to