diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-11-12 13:02:40 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-11-13 07:00:47 +0100 |
commit | 444601efee65f20e0cd65764f05dd00486c4f715 (patch) | |
tree | 7e0a15772cfda7283abafe198c66906700e06501 | |
parent | 8c2e3601d70b3bc7f004e15797c9fca61332ea5b (diff) | |
download | qtquickcontrols-444601efee65f20e0cd65764f05dd00486c4f715.tar.gz |
Gallery example: add an About box
Change-Id: Ie683c9d6dca577193f6a5a2cee40916b263719d6
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
-rw-r--r-- | examples/quick/controls/gallery/content/AboutDialog.qml | 48 | ||||
-rw-r--r-- | examples/quick/controls/gallery/gallery.pro | 1 | ||||
-rw-r--r-- | examples/quick/controls/gallery/main.qml | 12 | ||||
-rw-r--r-- | examples/quick/controls/gallery/resources.qrc | 1 |
4 files changed, 62 insertions, 0 deletions
diff --git a/examples/quick/controls/gallery/content/AboutDialog.qml b/examples/quick/controls/gallery/content/AboutDialog.qml new file mode 100644 index 00000000..aec7b604 --- /dev/null +++ b/examples/quick/controls/gallery/content/AboutDialog.qml @@ -0,0 +1,48 @@ +/**************************************************************************** +** +** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). +** Contact: http://www.qt-project.org/legal +** +** This file is part of the Qt Quick Controls module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:BSD$ +** You may use this file under the terms of the BSD license as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names +** of its contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** $QT_END_LICENSE$ +** +****************************************************************************/ +import QtQuick 2.2 +import QtQuick.Dialogs 1.1 + +MessageDialog { + icon: StandardIcon.Information + text: "QtQuick.Controls gallery example" + detailedText: "This example demonstrates most of the available Qt Quick Controls." + title: "About Gallery" +} diff --git a/examples/quick/controls/gallery/gallery.pro b/examples/quick/controls/gallery/gallery.pro index b9a5d0e6..09358658 100644 --- a/examples/quick/controls/gallery/gallery.pro +++ b/examples/quick/controls/gallery/gallery.pro @@ -6,6 +6,7 @@ include(src/src.pri) OTHER_FILES += \ main.qml \ + content/AboutDialog.qml \ content/ChildWindow.qml \ content/Controls.qml \ content/ImageViewer.qml \ diff --git a/examples/quick/controls/gallery/main.qml b/examples/quick/controls/gallery/main.qml index cd8240f7..43b6776e 100644 --- a/examples/quick/controls/gallery/main.qml +++ b/examples/quick/controls/gallery/main.qml @@ -70,6 +70,8 @@ ApplicationWindow { onAccepted: imageViewer.open(fileUrl) } + AboutDialog { id: aboutDialog } + Action { id: openAction text: "&Open" @@ -106,6 +108,12 @@ ApplicationWindow { onTriggered: activeFocusItem.paste() } + Action { + id: aboutAction + text: "About" + onTriggered: aboutDialog.open() + } + ExclusiveGroup { id: textFormatGroup @@ -210,6 +218,10 @@ ApplicationWindow { visible: false } } + Menu { + title: "&Help" + MenuItem { action: aboutAction } + } } diff --git a/examples/quick/controls/gallery/resources.qrc b/examples/quick/controls/gallery/resources.qrc index 6f487274..ca9c6521 100644 --- a/examples/quick/controls/gallery/resources.qrc +++ b/examples/quick/controls/gallery/resources.qrc @@ -1,6 +1,7 @@ <RCC> <qresource prefix="/"> <file>main.qml</file> + <file>content/AboutDialog.qml</file> <file>content/ChildWindow.qml</file> <file>content/Controls.qml</file> <file>content/ImageViewer.qml</file> |