diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-11-16 16:06:07 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-12-02 16:16:31 +0000 |
commit | b185fc1ac02d4887d2b187a4043b1fdedb95305e (patch) | |
tree | 9650c29786a86d7272541702d59cfa285216f7f0 /src/imports/controls/doc | |
parent | 5823d6230f5b1fbbd27c3b00b334e062a21b3d65 (diff) |
Add Menu
An item-based menu derived from QQuickPanel. Eventually we'd like to
make Panel itself a QQuickItem, as it makes both the implementation
and the actual usage of Menu a lot easier.
Change-Id: Ic1bf2a05ab98d9e17824c402ed8326ef65d26c69
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/doc')
-rw-r--r-- | src/imports/controls/doc/images/qtlabscontrols-menu-contentItem.png | bin | 0 -> 2639 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtlabscontrols-menu.png | bin | 0 -> 2680 bytes | |||
-rw-r--r-- | src/imports/controls/doc/snippets/qtlabscontrols-menu-contentItem.qml | 58 | ||||
-rw-r--r-- | src/imports/controls/doc/snippets/qtlabscontrols-menu.qml | 51 | ||||
-rw-r--r-- | src/imports/controls/doc/src/qtlabscontrols-customize.qdoc | 17 | ||||
-rw-r--r-- | src/imports/controls/doc/src/qtlabscontrols-index.qdoc | 3 | ||||
-rw-r--r-- | src/imports/controls/doc/src/qtlabscontrols-menus.qdoc | 43 |
7 files changed, 172 insertions, 0 deletions
diff --git a/src/imports/controls/doc/images/qtlabscontrols-menu-contentItem.png b/src/imports/controls/doc/images/qtlabscontrols-menu-contentItem.png Binary files differnew file mode 100644 index 00000000..e16e196e --- /dev/null +++ b/src/imports/controls/doc/images/qtlabscontrols-menu-contentItem.png diff --git a/src/imports/controls/doc/images/qtlabscontrols-menu.png b/src/imports/controls/doc/images/qtlabscontrols-menu.png Binary files differnew file mode 100644 index 00000000..b782b9fe --- /dev/null +++ b/src/imports/controls/doc/images/qtlabscontrols-menu.png diff --git a/src/imports/controls/doc/snippets/qtlabscontrols-menu-contentItem.qml b/src/imports/controls/doc/snippets/qtlabscontrols-menu-contentItem.qml new file mode 100644 index 00000000..0c270d34 --- /dev/null +++ b/src/imports/controls/doc/snippets/qtlabscontrols-menu-contentItem.qml @@ -0,0 +1,58 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** 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 The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/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$ +** +****************************************************************************/ + +import QtQuick 2.0 +import Qt.labs.controls 1.0 + +Item { + id: window + width: menu.contentItem.width + height: menu.contentItem.height + visible: true + + Menu { + id: menu + contentItem.parent: window + + MenuItem { + text: "New..." + } + MenuItem { + text: "Open..." + } + MenuItem { + text: "Save" + } + } + + Rectangle { + parent: menu.contentItem + anchors.fill: parent + color: 'transparent' + border.color: 'red' + } +} diff --git a/src/imports/controls/doc/snippets/qtlabscontrols-menu.qml b/src/imports/controls/doc/snippets/qtlabscontrols-menu.qml new file mode 100644 index 00000000..b0f32203 --- /dev/null +++ b/src/imports/controls/doc/snippets/qtlabscontrols-menu.qml @@ -0,0 +1,51 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** 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 The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/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$ +** +****************************************************************************/ + +import QtQuick 2.0 +import Qt.labs.controls 1.0 + +Item { + id: window + width: menu.contentItem.width + height: menu.contentItem.height + visible: true + + Menu { + id: menu + contentItem.parent: window + + MenuItem { + text: "New..." + } + MenuItem { + text: "Open..." + } + MenuItem { + text: "Save" + } + } +} diff --git a/src/imports/controls/doc/src/qtlabscontrols-customize.qdoc b/src/imports/controls/doc/src/qtlabscontrols-customize.qdoc index dddb3a8a..a7bd7d8b 100644 --- a/src/imports/controls/doc/src/qtlabscontrols-customize.qdoc +++ b/src/imports/controls/doc/src/qtlabscontrols-customize.qdoc @@ -206,6 +206,23 @@ Label has no background item by default. + \section1 Customizing Menu + + Menu consists of a \l {Panel::}{contentItem}. + + \section3 Content item + + \image qtlabscontrols-menu-contentItem.png + + \snippet Menu.qml contentItem + + + \section1 Customizing MenuItem + + MenuItem can be customized in the same manner as + \l {Customizing Button}{Button}. + + \section1 Customizing PageIndicator TODO diff --git a/src/imports/controls/doc/src/qtlabscontrols-index.qdoc b/src/imports/controls/doc/src/qtlabscontrols-index.qdoc index 55d89344..936e65e8 100644 --- a/src/imports/controls/doc/src/qtlabscontrols-index.qdoc +++ b/src/imports/controls/doc/src/qtlabscontrols-index.qdoc @@ -231,6 +231,9 @@ \li \l [QtQuickControls] {Label} \li \l [QtLabsControls] {Label} \row + \li \l [QtQuickControls] {Menu} + \li \l [QtLabsControls] {Menu} + \row \li \l [QtQuickControls] {ProgressBar} \li \l [QtLabsControls] {ProgressBar} \row diff --git a/src/imports/controls/doc/src/qtlabscontrols-menus.qdoc b/src/imports/controls/doc/src/qtlabscontrols-menus.qdoc new file mode 100644 index 00000000..65b4f04c --- /dev/null +++ b/src/imports/controls/doc/src/qtlabscontrols-menus.qdoc @@ -0,0 +1,43 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** 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 The Qt Company. For licensing terms +** and conditions see http://www.qt.io/terms-conditions. For further +** information use the contact form at http://www.qt.io/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$ +** +****************************************************************************/ + +/*! + \page qtlabscontrols-menus.html + \title Menu Controls + + \annotatedlist qtlabscontrols-menus + + Each type of menu control has its own specific target use case. The + following sections offer guidelines for choosing the appropriate type + of menu control, depending on the use case. + + \section1 Menu Control + + \image qtlabscontrols-menu.png + + \l Menu is a traditional menu. +*/ |