From 96474dba254526b48e35ffa5b22950185dae43fb Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Mon, 23 Nov 2015 20:00:17 +0100 Subject: Add ItemDelegate Change-Id: I133be230d0d4b2fd36565f8f05d91426c314a085 Reviewed-by: Mitch Curtis --- .../qtlabscontrols-itemdelegate-background.qml | 39 ++++++++++++++++++ .../qtlabscontrols-itemdelegate-indicator.qml | 40 +++++++++++++++++++ .../snippets/qtlabscontrols-itemdelegate-label.qml | 40 +++++++++++++++++++ .../doc/snippets/qtlabscontrols-itemdelegate.qml | 46 ++++++++++++++++++++++ 4 files changed, 165 insertions(+) create mode 100644 src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-background.qml create mode 100644 src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-indicator.qml create mode 100644 src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate-label.qml create mode 100644 src/imports/controls/doc/snippets/qtlabscontrols-itemdelegate.qml (limited to 'src/imports/controls/doc/snippets') 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] -- cgit v1.2.3