diff options
author | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-11-23 20:00:17 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-11-25 08:53:40 +0000 |
commit | 96474dba254526b48e35ffa5b22950185dae43fb (patch) | |
tree | 00a3e8f07f2ad34fafa9728074a9d6fcb8a6f1d1 /src/imports/controls/doc | |
parent | 794d4f210a5b875699e63e02e5ec0c1d4bad4096 (diff) |
Add ItemDelegate
Change-Id: I133be230d0d4b2fd36565f8f05d91426c314a085
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/doc')
-rw-r--r-- | src/imports/controls/doc/images/qtlabscontrols-itemdelegate-background.png | bin | 0 -> 3490 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtlabscontrols-itemdelegate-indicator.png | bin | 0 -> 3452 bytes | |||
-rw-r--r-- | src/imports/controls/doc/images/qtlabscontrols-itemdelegate-label.png | bin | 0 -> 3439 bytes | |||
-rw-r--r-- | src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-background.qml | 39 | ||||
-rw-r--r-- | src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-indicator.qml | 40 | ||||
-rw-r--r-- | src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-label.qml | 40 | ||||
-rw-r--r-- | src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate.qml | 46 | ||||
-rw-r--r-- | src/imports/controls/doc/src/qtlabscontrols-customize.qdoc | 25 |
8 files changed, 190 insertions, 0 deletions
diff --git a/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-background.png b/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-background.png Binary files differnew file mode 100644 index 00000000..a311c109 --- /dev/null +++ b/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-background.png diff --git a/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-indicator.png b/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-indicator.png Binary files differnew file mode 100644 index 00000000..b458b1a0 --- /dev/null +++ b/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-indicator.png diff --git a/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-label.png b/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-label.png Binary files differnew file mode 100644 index 00000000..6b43db0f --- /dev/null +++ b/src/imports/controls/doc/images/qtlabscontrols-itemdelegate-label.png diff --git a/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-background.qml b/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-background.qml new file mode 100644 index 00000000..10d5696e --- /dev/null +++ b/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-background.qml @@ -0,0 +1,39 @@ +/**************************************************************************** +** +** 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 + +ItemDelegate { + text: "ItemDelegate" + checked: true + checkable: true + background: Rectangle { + color: 'transparent' + border.color: 'red' + } +} diff --git a/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-indicator.qml b/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-indicator.qml new file mode 100644 index 00000000..fb80957d --- /dev/null +++ b/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-indicator.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** 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 + +ItemDelegate { + text: "ItemDelegate" + checked: true + checkable: true + Rectangle { + anchors.fill: indicator + color: "transparent" + border.color: "red" + } +} diff --git a/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-label.qml b/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-label.qml new file mode 100644 index 00000000..696560a5 --- /dev/null +++ b/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-label.qml @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** 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 + +ItemDelegate { + text: "ItemDelegate" + checked: true + checkable: true + Rectangle { + anchors.fill: label + color: "transparent" + border.color: "red" + } +} diff --git a/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate.qml b/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate.qml new file mode 100644 index 00000000..d02f722a --- /dev/null +++ b/src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate.qml @@ -0,0 +1,46 @@ +/**************************************************************************** +** +** 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 + +//! [1] +ListView { + width: 160 + height: 240 + + model: Qt.fontFamilies() + + delegate: ItemDelegate { + text: modelData + width: parent.width + onClicked: console.log("clicked:", modelData) + } + + ScrollIndicator.vertical: ScrollIndicator { } +} +//! [1] diff --git a/src/imports/controls/doc/src/qtlabscontrols-customize.qdoc b/src/imports/controls/doc/src/qtlabscontrols-customize.qdoc index b6e28af7..dddb3a8a 100644 --- a/src/imports/controls/doc/src/qtlabscontrols-customize.qdoc +++ b/src/imports/controls/doc/src/qtlabscontrols-customize.qdoc @@ -170,6 +170,31 @@ \snippet GroupBox.qml label + \section1 Customizing ItemDelegate + + ItemDelegate consists of three visual items: \l {Control::background}{background}, + \l {AbstractButton::label}{label} and \l {AbstractButton::indicator}{indicator}. + The indicator is only visible for \l {AbstractButton::checkable}{checkable} items. + + \section3 Background + + \image qtlabscontrols-itemdelegate-background.png + + \snippet ItemDelegate.qml background + + \section3 Label + + \image qtlabscontrols-itemdelegate-label.png + + \snippet ItemDelegate.qml label + + \section3 Indicator + + \image qtlabscontrols-itemdelegate-indicator.png + + \snippet ItemDelegate.qml indicator + + \section1 Customizing Label Label can have a visual \l {Label::background}{background} item. |