summaryrefslogtreecommitdiffstats
path: root/examples/quick/window/doc
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2013-03-08 16:44:52 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-05-28 10:08:41 +0200
commit1ef4e4b156be8653af64dbccb47abcccc234246a (patch)
tree7cdb3b9ac2ba11b2c723233a9be5f21ef247611d /examples/quick/window/doc
parent63f83fbd095415145ad124c7215f07a4c3c6038f (diff)
window and Screen example: new properties; splash screen
Demonstrates the new properties, how to make a splash screen, and how to make a standalone app with an icon. Combined the Screen info into this example too. Change-Id: I5b731539b39c55327f4e5b93860a880a35835896 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
Diffstat (limited to 'examples/quick/window/doc')
-rw-r--r--examples/quick/window/doc/images/qml-window-example.pngbin0 -> 9863 bytes
-rw-r--r--examples/quick/window/doc/src/window.qdoc71
2 files changed, 71 insertions, 0 deletions
diff --git a/examples/quick/window/doc/images/qml-window-example.png b/examples/quick/window/doc/images/qml-window-example.png
new file mode 100644
index 0000000000..72487b4d93
--- /dev/null
+++ b/examples/quick/window/doc/images/qml-window-example.png
Binary files differ
diff --git a/examples/quick/window/doc/src/window.qdoc b/examples/quick/window/doc/src/window.qdoc
new file mode 100644
index 0000000000..07d2f115c1
--- /dev/null
+++ b/examples/quick/window/doc/src/window.qdoc
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file. Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+/*!
+ \title Qt Quick Examples - Window and Screen
+ \example window
+ \brief This example demonstrates the Window and Screen types in QML
+ \image qml-window-example.png
+ \ingroup qtquickexamples
+
+ This example shows you how to create a Window in QML, how to control its
+ \l {QQuickWindow::visibility} {visibility}, how to present a splash screen
+ during application startup, and how to access the properties of the
+ \l Screen. It also demonstrates how to package QML into
+ \l {The Qt Resource System} {resources} and provide an
+ \l {Setting the Application Icon} {icon} to create a standalone QML desktop application.
+
+ A splash screen can be created with the \l {Qt::SplashScreen} {Qt.SplashScreen} flag,
+ and should be \l {Qt::ApplicationModal} {ApplicationModal} to prevent interaction
+ with the main window. If the splash window is also transparent, and showing a
+ partially transparent image, then it will look like a shaped window.
+ \snippet window/Splash.qml splash-properties
+
+ In this example a \l Timer will automatically dismiss the splash screen,
+ but in a real application you might want to connect to a signal from the
+ application logic to hide the splash when initialization is complete.
+ \snippet window/Splash.qml timer
+
+ The main window in this example is the control window, with some buttons
+ and checkboxes to control and provide feedback on the state of a secondary
+ window. Each checkbox has a binding to the property whose state it is
+ displaying, and also an onClicked handler to change the state. This is the
+ typical pattern to create a two-way binding while avoiding binding loops.
+ \snippet window/window.qml windowedCheckbox
+
+ The \l Screen has several properties which are generally useful to applications
+ which need to rotate some content when the screen orientation changes, to position
+ windows on the screen or to convert real units to logical pixel units. ScreenInfo.qml
+ (which is displayed inline in window.qml, or can be run by itself with qmlscene)
+ simply displays the property values, while the splash screen uses them to
+ center the window on the screen.
+ \snippet window/Splash.qml screen-properties
+
+ If a Window is nested inside an \l Item or another Window, the inner window
+ becomes "transient for" the outer one (see \l Window for more explanation).
+ But if you want to create multiple top-level windows as unrelated peers, you
+ can create them inside a non-visual \l QtObject root item, as this example does.
+*/