From 37ca31b22426ac746641b9ff22d9df4ff71850c1 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Wed, 3 Feb 2010 23:06:14 +1000 Subject: Augment documentation Document automatic signal handlers and QmlViewer.Screen. --- doc/src/declarative/extending.qdoc | 11 +++++++++++ doc/src/declarative/qmlviewer.qdoc | 21 +++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/doc/src/declarative/extending.qdoc b/doc/src/declarative/extending.qdoc index 42b054f..3b9c7f3 100644 --- a/doc/src/declarative/extending.qdoc +++ b/doc/src/declarative/extending.qdoc @@ -825,6 +825,17 @@ Here are three examples of signal declarations: } \endcode +Adding a signal to an item automatically adds a signal handler to it. +The signal hander is named on, with the first letter of the +signal name being upper cased. The above example item would now have the +following signal handlers: + +\list + \o onClicked + \o onHovered + \o onPerformAction +\endlist + \section1 Adding new methods New methods can be added to an existing type. These new methods are available diff --git a/doc/src/declarative/qmlviewer.qdoc b/doc/src/declarative/qmlviewer.qdoc index df96535..6a107ce 100644 --- a/doc/src/declarative/qmlviewer.qdoc +++ b/doc/src/declarative/qmlviewer.qdoc @@ -75,4 +75,25 @@ \endcode Any QML can be used in the dummy data files. You could even animate the fictional data! + + \section1 Screen Orientation + + A special piece of dummy data which is integrated into the viewer is + a simple orientation property. The orientation can be set via the + settings menu in the application, or by pressing Ctrl+T to toggle it. + + To use this from within your QML file, import QmlViewer 1.0 and create a + Screen object. This object has a property, orientation, which can be either + Screen.Lanscape or Screen.Portrait and which can be bound to in your + application. An example is below: + +\code + import QmlViewer 1.0 as QmlViewer + + Item { + QmlViewer.Screen { id: qmlviewerScreen } + state: (qmlviewerScreen.orientation == QmlViewer.Screen.Landscape) ? 'landscape' : '' + } +\endcode + */ -- cgit v0.12