diff options
author | Mitch Curtis <mitch.curtis@theqtcompany.com> | 2015-02-12 13:55:22 +0100 |
---|---|---|
committer | J-P Nurmi <jpnurmi@theqtcompany.com> | 2015-02-13 12:01:33 +0000 |
commit | 6f15c206b069ed0fcf48a285bfcc4ad636927df0 (patch) | |
tree | 6150e262bc2d049219981a4cb1e1deeeeed5d636 /src/extras/StatusIndicator.qml | |
parent | d28a02aec9a1632f2263d9276099454b33fb6741 (diff) | |
download | qtquickcontrols-6f15c206b069ed0fcf48a285bfcc4ad636927df0.tar.gz |
Import Qt Quick Extras (the former Qt Quick Enterprise Controls)
Change-Id: I59c5c97c564f707da4ce617e25e13ff8124f7d4b
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
Diffstat (limited to 'src/extras/StatusIndicator.qml')
-rw-r--r-- | src/extras/StatusIndicator.qml | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/src/extras/StatusIndicator.qml b/src/extras/StatusIndicator.qml new file mode 100644 index 00000000..8be50737 --- /dev/null +++ b/src/extras/StatusIndicator.qml @@ -0,0 +1,117 @@ +/**************************************************************************** +** +** Copyright (C) 2015 The Qt Company Ltd. +** Contact: http://www.qt.io/licensing/ +** +** This file is part of the Qt Quick Extras module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL3$ +** 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 Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPLv3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or later as published by the Free +** Software Foundation and appearing in the file LICENSE.GPL included in +** the packaging of this file. Please review the following information to +** ensure the GNU General Public License version 2.0 requirements will be +** met: http://www.gnu.org/licenses/gpl-2.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +import QtQuick 2.2 +import QtQuick.Controls.Private 1.0 +import QtQuick.Extras 1.3 +import QtQuick.Extras.Styles 1.3 +import QtQuick.Extras.Private 1.0 + +/*! + \qmltype StatusIndicator + \inqmlmodule QtQuick.Extras + \since QtQuick.Extras 1.1 + \ingroup extras + \ingroup extras-non-interactive + \brief An indicator that displays active or inactive states. + + \image statusindicator-active.png A StatusIndicator in the active state + A StatusIndicator in the active state. + \image statusindicator-inactive.png A StatusIndicator in the inactive state + A StatusIndicator in the inactive state. + + The StatusIndicator displays active or inactive states. By using different + colors via the \l color property, StatusIndicator can provide extra + context to these states. For example: + + \table + \row + \li QML + \li Result + \row + \li + \code + import QtQuick 2.2 + import QtQuick.Extras 1.3 + + Rectangle { + width: 100 + height: 100 + color: "#cccccc" + + StatusIndicator { + anchors.centerIn: parent + color: "green" + } + } + \endcode + \li \image statusindicator-green.png "Green StatusIndicator" + \endtable + + You can create a custom appearance for a StatusIndicator by assigning a + \l {QtQuick.Extras.Styles::}{StatusIndicatorStyle}. +*/ + +Control { + id: statusIndicator + + style: Qt.createComponent(StyleSettings.style + "/StatusIndicatorStyle.qml", statusIndicator) + + /*! + This property specifies whether the indicator is active or inactive. + + The default value is \c false (off). + + \deprecated Use active instead. + */ + property alias on: statusIndicator.active + + /*! + \since QtQuick.Extras 1.2 + + This property specifies whether the indicator is active or inactive. + + The default value is \c false (inactive). + */ + property bool active: false + + /*! + This property specifies the color of the indicator when it is active. + + The default value is \c "red". + */ + property color color: __style.color +} |