This commit is contained in:
Sven Riwoldt
2024-10-19 12:31:37 +02:00
commit f7f8c52455
10176 changed files with 1619386 additions and 0 deletions

View File

@@ -0,0 +1,160 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
// Workaround for QTBUG-37751; we need this import for RangeModel, although we shouldn't.
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Extras.Private 1.0
/*!
\qmltype CircularGauge
\inqmlmodule QtQuick.Extras
\since 5.5
\ingroup extras
\ingroup extras-non-interactive
\brief A gauge that displays a value within a range along an arc.
\image circulargauge.png CircularGauge
The CircularGauge is similar to traditional mechanical gauges that use a
needle to display a value from some input, such as the speed of a vehicle or
air pressure, for example.
The minimum and maximum values displayable by the gauge can be set with the
\l minimumValue and \l maximumValue properties. The angle at which these
values are displayed can be set with the
\l {CircularGaugeStyle::}{minimumValueAngle} and
\l {CircularGaugeStyle::}{maximumValueAngle} properties of
\l {CircularGaugeStyle}.
Example:
\code
CircularGauge {
value: accelerating ? maximumValue : 0
anchors.centerIn: parent
property bool accelerating: false
Keys.onSpacePressed: accelerating = true
Keys.onReleased: {
if (event.key === Qt.Key_Space) {
accelerating = false;
event.accepted = true;
}
}
Component.onCompleted: forceActiveFocus()
Behavior on value {
NumberAnimation {
duration: 1000
}
}
}
\endcode
You can create a custom appearance for a CircularGauge by assigning a
\l {CircularGaugeStyle}.
*/
Control {
id: circularGauge
style: Settings.styleComponent(Settings.style, "CircularGaugeStyle.qml", circularGauge)
/*!
\qmlproperty real CircularGauge::minimumValue
This property holds the smallest value displayed by the gauge.
*/
property alias minimumValue: range.minimumValue
/*!
\qmlproperty real CircularGauge::maximumValue
This property holds the largest value displayed by the gauge.
*/
property alias maximumValue: range.maximumValue
/*!
This property holds the current value displayed by the gauge, which will
always be between \l minimumValue and \l maximumValue, inclusive.
*/
property alias value: range.value
/*!
\qmlproperty real CircularGauge::stepSize
This property holds the size of the value increments that the needle
displays.
For example, when stepSize is \c 10 and value is \c 0, adding \c 5 to
\l value will have no visible effect on the needle, although \l value
will still be incremented. Adding an extra \c 5 to \l value will then
cause the needle to point to \c 10.
*/
property alias stepSize: range.stepSize
/*!
This property determines whether or not the gauge displays tickmarks,
minor tickmarks, and labels.
For more fine-grained control over what is displayed, the following
style components of
\l CircularGaugeStyle can be
used:
\list
\li \l {CircularGaugeStyle::}{tickmark}
\li \l {CircularGaugeStyle::}{minorTickmark}
\li \l {CircularGaugeStyle::}{tickmarkLabel}
\endlist
*/
property bool tickmarksVisible: true
RangeModel {
id: range
minimumValue: 0
maximumValue: 100
stepSize: 0
value: minimumValue
}
}

View File

@@ -0,0 +1,161 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQml 2.14 as Qml
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
/*!
\qmltype DelayButton
\inherits QtQuickControls::Button
\inqmlmodule QtQuick.Extras
\since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A checkable button that triggers an action when held in long enough.
\image delaybutton.png A DelayButton
The DelayButton is a checkable button that incorporates a delay before
the button becomes checked and the \l activated signal is emitted. This
delay prevents accidental presses.
The current progress is expressed as a decimal value between \c 0.0 and
\c 1.0. The time it takes for \l activated to be emitted is measured in
milliseconds, and can be set with the \l delay property.
The progress is indicated by a progress indicator around the button. When
the indicator reaches completion, it flashes.
\image delaybutton-progress.png A DelayButton being held down
A DelayButton being held down
\image delaybutton-activated.png A DelayButton after being activated
A DelayButton after being activated
You can create a custom appearance for a DelayButton by assigning a
\l {DelayButtonStyle}.
*/
Button {
id: root
style: Settings.styleComponent(Settings.style, "DelayButtonStyle.qml", root)
/*!
\qmlproperty real DelayButton::progress
This property holds the current progress as displayed by the progress
indicator, in the range \c 0.0 - \c 1.0.
*/
readonly property alias progress: root.__progress
/*!
This property holds the time it takes (in milliseconds) for \l progress
to reach \c 1.0 and emit \l activated.
The default value is \c 3000 ms.
*/
property int delay: 3000
/*!
This signal is emitted when \l progress reaches \c 1.0 and the button
becomes checked.
*/
signal activated
/*! \internal */
property real __progress: 0.0
Behavior on __progress {
id: progressBehavior
NumberAnimation {
id: numberAnimation
}
}
Qml.Binding {
// Force checkable to false to get full control over the checked -property
target: root
property: "checkable"
value: false
restoreMode: Binding.RestoreBinding
}
onProgressChanged: {
if (__progress === 1.0) {
checked = true;
activated();
}
}
onCheckedChanged: {
if (checked) {
if (__progress < 1) {
// Programmatically activated the button; don't animate.
progressBehavior.enabled = false;
__progress = 1;
progressBehavior.enabled = true;
}
} else {
// Unchecked the button after it was flashing; it should instantly stop
// flashing (with no reversed progress bar).
progressBehavior.enabled = false;
__progress = 0;
progressBehavior.enabled = true;
}
}
onPressedChanged: {
if (checked) {
if (pressed) {
// Pressed the button to stop the activation.
checked = false;
}
} else {
var effectiveDelay = pressed ? delay : delay * 0.3;
// Not active. Either the button is being held down or let go.
numberAnimation.duration = Math.max(0, (pressed ? 1 - __progress : __progress) * effectiveDelay);
__progress = pressed ? 1 : 0;
}
}
}

View File

@@ -0,0 +1,229 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
/*!
\qmltype Dial
\inqmlmodule QtQuick.Extras
\since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A circular dial that is rotated to set a value.
\image dial.png A Dial
The Dial is similar to a traditional dial knob that is found on devices
such as stereos or industrial equipment. It allows the user to specify a
value within a range.
Like CircularGauge, Dial can display tickmarks to give an indication of
the current value. When a suitable stepSize is combined with
\l {DialStyle::}{tickmarkStepSize},
the dial "snaps" to each tickmark.
You can create a custom appearance for a Dial by assigning a
\l {DialStyle}.
*/
Control {
id: dial
activeFocusOnTab: true
style: Settings.styleComponent(Settings.style, "DialStyle.qml", dial)
/*!
\qmlproperty real Dial::value
The angle of the handle along the dial, in the range of
\c 0.0 to \c 1.0.
The default value is \c{0.0}.
*/
property alias value: range.value
/*!
\qmlproperty real Dial::minimumValue
The smallest value allowed by the dial.
The default value is \c{0.0}.
\sa value, maximumValue
*/
property alias minimumValue: range.minimumValue
/*!
\qmlproperty real Dial::maximumValue
The largest value allowed by the dial.
The default value is \c{1.0}.
\sa value, minimumValue
*/
property alias maximumValue: range.maximumValue
/*!
\qmlproperty real Dial::hovered
This property holds whether the button is being hovered.
*/
readonly property alias hovered: mouseArea.containsMouse
/*!
\qmlproperty real Dial::stepSize
The default value is \c{0.0}.
*/
property alias stepSize: range.stepSize
/*!
\internal
Determines whether the dial can be freely rotated past the zero marker.
The default value is \c false.
*/
property bool __wrap: false
/*!
This property specifies whether the dial should gain active focus when
pressed.
The default value is \c false.
\sa pressed
*/
property bool activeFocusOnPress: false
/*!
\qmlproperty bool Dial::pressed
Returns \c true if the dial is pressed.
\sa activeFocusOnPress
*/
readonly property alias pressed: mouseArea.pressed
/*!
This property determines whether or not the dial displays tickmarks,
minor tickmarks, and labels.
For more fine-grained control over what is displayed, the following
style components of
\l {DialStyle} can be used:
\list
\li \l {DialStyle::}{tickmark}
\li \l {DialStyle::}{minorTickmark}
\li \l {DialStyle::}{tickmarkLabel}
\endlist
The default value is \c true.
*/
property bool tickmarksVisible: true
Keys.onLeftPressed: value -= stepSize
Keys.onDownPressed: value -= stepSize
Keys.onRightPressed: value += stepSize
Keys.onUpPressed: value += stepSize
Keys.onPressed: {
if (event.key === Qt.Key_Home) {
value = minimumValue;
event.accepted = true;
} else if (event.key === Qt.Key_End) {
value = maximumValue;
event.accepted = true;
}
}
RangeModel {
id: range
minimumValue: 0.0
maximumValue: 1.0
stepSize: 0
value: 0
}
MouseArea {
id: mouseArea
hoverEnabled: true
parent: __panel.background.parent
anchors.fill: parent
onPositionChanged: {
if (pressed) {
value = valueFromPoint(mouseX, mouseY);
}
}
onPressed: {
if (!__style.__dragToSet)
value = valueFromPoint(mouseX, mouseY);
if (activeFocusOnPress)
dial.forceActiveFocus();
}
function bound(val) { return Math.max(minimumValue, Math.min(maximumValue, val)); }
function valueFromPoint(x, y)
{
var yy = height / 2.0 - y;
var xx = x - width / 2.0;
var angle = (xx || yy) ? Math.atan2(yy, xx) : 0;
if (angle < Math.PI/ -2)
angle = angle + Math.PI * 2;
var range = maximumValue - minimumValue;
var value;
if (__wrap)
value = (minimumValue + range * (Math.PI * 3 / 2 - angle) / (2 * Math.PI));
else
value = (minimumValue + range * (Math.PI * 4 / 3 - angle) / (Math.PI * 10 / 6));
return bound(value)
}
}
}

View File

@@ -0,0 +1,210 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
/*!
\qmltype Gauge
\inqmlmodule QtQuick.Extras
\since 5.5
\ingroup extras
\ingroup extras-non-interactive
\brief A straight gauge that displays a value within a range.
\image gauge.png Gauge
The Gauge control displays a value within some range along a horizontal or
vertical axis. It can be thought of as an extension of ProgressBar,
providing tickmarks and labels to provide a visual measurement of the
progress.
The minimum and maximum values displayable by the gauge can be set with the
\l minimumValue and \l maximumValue properties.
Example:
\code
Gauge {
minimumValue: 0
value: 50
maximumValue: 100
anchors.centerIn: parent
}
\endcode
You can create a custom appearance for a Gauge by assigning a
\l {GaugeStyle}.
*/
Control {
id: gauge
style: Settings.styleComponent(Settings.style, "GaugeStyle.qml", gauge)
/*!
This property holds the smallest value displayed by the gauge.
The default value is \c 0.
*/
property alias minimumValue: range.minimumValue
/*!
This property holds the value displayed by the gauge.
The default value is \c 0.
*/
property alias value: range.value
/*!
This property holds the largest value displayed by the gauge.
The default value is \c 100.
*/
property alias maximumValue: range.maximumValue
/*!
This property determines the orientation of the gauge.
The default value is \c Qt.Vertical.
*/
property int orientation: Qt.Vertical
/*!
This property determines the alignment of each tickmark within the
gauge. When \l orientation is \c Qt.Vertical, the valid values are:
\list
\li Qt.AlignLeft
\li Qt.AlignRight
\endlist
Any other value will cause \c Qt.AlignLeft to be used, which is also the
default value for this orientation.
When \l orientation is \c Qt.Horizontal, the valid values are:
\list
\li Qt.AlignTop
\li Qt.AlignBottom
\endlist
Any other value will cause \c Qt.AlignBottom to be used, which is also
the default value for this orientation.
*/
property int tickmarkAlignment: orientation == Qt.Vertical ? Qt.AlignLeft : Qt.AlignBottom
property int __tickmarkAlignment: {
if (orientation == Qt.Vertical) {
return (tickmarkAlignment == Qt.AlignLeft || tickmarkAlignment == Qt.AlignRight) ? tickmarkAlignment : Qt.AlignLeft;
}
return (tickmarkAlignment == Qt.AlignTop || tickmarkAlignment == Qt.AlignBottom) ? tickmarkAlignment : Qt.AlignBottom;
}
/*!
\internal
TODO: finish this
This property determines whether or not the tickmarks and their labels
are drawn inside (over) the gauge. The value of this property affects
\l tickmarkAlignment.
*/
property bool __tickmarksInside: false
/*!
This property determines the rate at which tickmarks are drawn on the
gauge. The lower the value, the more often tickmarks are drawn.
The default value is \c 10.
*/
property real tickmarkStepSize: 10
/*!
This property determines the amount of minor tickmarks drawn between
each regular tickmark.
The default value is \c 4.
*/
property int minorTickmarkCount: 4
/*!
\qmlproperty font Gauge::font
The font to use for the tickmark text.
*/
property alias font: hiddenText.font
/*!
This property accepts a function that formats the given \a value for
display in
\l {GaugeStyle::}{tickmarkLabel}.
For example, to provide a custom format that displays all values with 3
decimal places:
\code
formatValue: function(value) {
return value.toFixed(3);
}
\endcode
The default function does no formatting.
*/
property var formatValue: function(value) {
return value;
}
property alias __hiddenText: hiddenText
Text {
id: hiddenText
text: formatValue(maximumValue)
visible: false
}
RangeModel {
id: range
minimumValue: 0
value: 0
maximumValue: 100
}
}

View File

@@ -0,0 +1,738 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.0 as CppUtils
/*!
\qmltype PieMenu
\inqmlmodule QtQuick.Extras
\since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A popup menu that displays several menu items along an arc.
\image piemenu.png A PieMenu
The PieMenu provides a radial context menu as an alternative to a
traditional menu. All of the items in a PieMenu are an equal distance
from the center of the control.
\section2 Populating the Menu
To create a menu, define at least one MenuItem as a child of it:
\code
PieMenu {
id: pieMenu
MenuItem {
text: "Action 1"
onTriggered: print("Action 1")
}
MenuItem {
text: "Action 2"
onTriggered: print("Action 2")
}
MenuItem {
text: "Action 3"
onTriggered: print("Action 3")
}
}
\endcode
By default, only the currently selected item's text is displayed above the
menu. To provide text that is always visible when there is no current item,
set the \l title property.
\section2 Displaying the Menu
The typical use case for a menu is to open at the point of the mouse
cursor after a right click occurs. To do that, define a MouseArea that
covers the region upon which clicks should open the menu. When the
MouseArea is right-clicked, call the popup() function:
\code
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: pieMenu.popup(mouseX, mouseY)
}
\endcode
If the menu is opened in a position where some of its menu items would be
outside of \l boundingItem, it is automatically moved to a position where
they will not be hidden. By default, the boundingItem is set to the parent
of the menu. It can also be set to \c null to prevent this behavior.
PieMenu can be displayed at any position on the screen. With a traditional
context menu, the menu would be positioned with its top left corner at the
position of the right click, but since PieMenu is radial, we position it
centered over the position of the right click.
To create a PieMenu that opens after a long press and selects items upon
releasing, you can combine ActivationMode.ActivateOnRelease with a
MouseArea using a Timer:
\code
MouseArea {
id: touchArea
anchors.fill: parent
Timer {
id: pressAndHoldTimer
interval: 300
onTriggered: pieMenu.popup(touchArea.mouseX, touchArea.mouseY);
}
onPressed: pressAndHoldTimer.start()
onReleased: pressAndHoldTimer.stop();
}
PieMenu {
id: pieMenu
triggerMode: TriggerMode.TriggerOnRelease
MenuItem {
text: "Action 1"
onTriggered: print("Action 1")
}
MenuItem {
text: "Action 2"
onTriggered: print("Action 2")
}
MenuItem {
text: "Action 3"
onTriggered: print("Action 3")
}
}
\endcode
You can hide individual menu items by setting their visible property to
\c false. Hiding items does not affect the
\l {PieMenuStyle::}{startAngle} or
\l {PieMenuStyle::}{endAngle}; the
remaining items will grow to consume the available space.
You can create a custom appearance for a PieMenu by assigning a \l {PieMenuStyle}
*/
Control {
id: pieMenu
visible: false
style: Settings.styleComponent(Settings.style, "PieMenuStyle.qml", pieMenu)
/*!
This property reflects the angle (in radians) created by the imaginary
line from the center of the menu to the position of the cursor.
Its value is undefined when the menu is not visible.
*/
readonly property real selectionAngle: {
var centerX = width / 2;
var centerY = height / 2;
var targetX = __protectedScope.selectionPos.x;
var targetY = __protectedScope.selectionPos.y;
var xDistance = centerX - targetX;
var yDistance = centerY - targetY;
var angleToTarget = Math.atan2(xDistance, yDistance) * -1;
angleToTarget;
}
/*!
\qmlproperty enumeration PieMenu::activationMode
This property determines the method for selecting items in the menu.
\list
\li An activationMode of \a ActivationMode.ActivateOnPress means that menu
items will only be selected when a mouse press event occurs over them.
\li An activationMode of \a ActivationMode.ActivateOnRelease means that menu
items will only be selected when a mouse release event occurs over them.
This means that the user must keep the mouse button down after opening
the menu and release the mouse over the item they wish to select.
\li An activationMode of \a ActivationMode.ActivateOnClick means that menu
items will only be selected when the user clicks once over them.
\endlist
\warning Changing the activationMode while the menu is visible will
result in undefined behavior.
\deprecated Use triggerMode instead.
*/
property alias activationMode: pieMenu.triggerMode
/*!
\qmlproperty enumeration PieMenu::triggerMode
This property determines the method for selecting items in the menu.
\list
\li A triggerMode of \a TriggerMode.TriggerOnPress means that menu
items will only be selected when a mouse press event occurs over them.
\li A triggerMode of \a TriggerMode.TriggerOnRelease means that menu
items will only be selected when a mouse release event occurs over them.
This means that the user must keep the mouse button down after opening
the menu and release the mouse over the item they wish to select.
\li A triggerMode of \a TriggerMode.TriggerOnClick means that menu
items will only be selected when the user clicks once over them.
\endlist
\warning Changing the triggerMode while the menu is visible will
result in undefined behavior.
*/
property int triggerMode: TriggerMode.TriggerOnClick
/*!
\qmlproperty list<MenuItem> menuItems
The list of menu items displayed by this menu.
You can assign menu items by declaring them as children of PieMenu:
\code
PieMenu {
MenuItem {
text: "Action 1"
onTriggered: function() { print("Action 1"); }
}
MenuItem {
text: "Action 2"
onTriggered: function() { print("Action 2"); }
}
MenuItem {
text: "Action 3"
onTriggered: function() { print("Action 3"); }
}
}
\endcode
*/
default property alias menuItems: defaultPropertyHack.menuItems
QtObject {
// Can't specify a list as a default property (QTBUG-10822)
id: defaultPropertyHack
property list<MenuItem> menuItems
}
/*!
\qmlproperty int PieMenu::currentIndex
The index of the the menu item that is currently under the mouse,
or \c -1 if there is no such item.
*/
readonly property alias currentIndex: protectedScope.currentIndex
/*!
\qmlproperty int PieMenu::currentItem
The menu item that is currently under the mouse, or \c null if there is
no such item.
*/
readonly property alias currentItem: protectedScope.currentItem
/*!
This property defines the text that is shown above the menu when
there is no current menu item (currentIndex is \c -1).
The default value is \c "" (an empty string).
*/
property string title: ""
/*!
The item which the menu must stay within.
A typical use case for PieMenu involves:
\list
\li A MouseArea that determines the clickable area within which the
menu can be opened.
\li The bounds that the menu must not go outside of.
\endlist
Although they sound similar, they have different purposes. Consider the
example below:
\image piemenu-boundingItem-example.png Canvas boundingItem example
The user can only open the menu within the inner rectangle. In this
case, they've opened the menu on the edge of the MouseArea, but there
would not be enough room to display the entire menu centered at the
cursor position, so it was moved to the left.
If for some reason we didn't want this restriction, we can set
boundingItem to \c null:
\image piemenu-boundingItem-null-example.png Canvas null boundingItem example
By default, the menu's \l {Item::}{parent} is the boundingItem.
*/
property Item boundingItem: parent
/*!
\qmlmethod void popup(real x, real y)
Opens the menu at coordinates \a x, \a y.
*/
function popup(x, y) {
if (x !== undefined)
pieMenu.x = x - pieMenu.width / 2;
if (y !== undefined)
pieMenu.y = y - pieMenu.height / 2;
pieMenu.visible = true;
}
/*!
\qmlmethod void addItem(string text)
Adds a \a text item to the end of the menu items.
Equivalent to passing calling \c insertItem(menuItems.length, text).
Returns the newly added item.
*/
function addItem(text) {
return insertItem(menuItems.length, text);
}
/*!
\qmlmethod void insertItem(int before, string text)
Inserts a MenuItem with \a text before the index at \a before.
To insert an item at the end, pass \c menuItems.length.
Returns the newly inserted item, or \c null if \a before is invalid.
*/
function insertItem(before, text) {
if (before < 0 || before > menuItems.length) {
return null;
}
var newItems = __protectedScope.copyItemsToJsArray();
var newItem = Qt.createQmlObject("import QtQuick.Controls 1.1; MenuItem {}", pieMenu, "");
newItem.text = text;
newItems.splice(before, 0, newItem);
menuItems = newItems;
return newItem;
}
/*!
\qmlmethod void removeItem(item)
Removes \a item from the menu.
*/
function removeItem(item) {
for (var i = 0; i < menuItems.length; ++i) {
if (menuItems[i] === item) {
var newItems = __protectedScope.copyItemsToJsArray();
newItems.splice(i, 1);
menuItems = newItems;
break;
}
}
}
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: !Settings.hasTouchScreen && triggerMode !== TriggerMode.TriggerOnRelease
acceptedButtons: Qt.LeftButton | Qt.RightButton
onContainsMouseChanged: if (!containsMouse) __protectedScope.currentIndex = -1
objectName: "PieMenu internal MouseArea"
// The mouse thief also updates the selectionPos, so we can't bind to
// this mouseArea's mouseX/mouseY.
onPositionChanged: {
__protectedScope.selectionPos = Qt.point(mouseX, mouseY)
}
}
/*! \internal */
property alias __mouseThief: mouseThief
CppUtils.MouseThief {
id: mouseThief
onPressed: {
__protectedScope.selectionPos = Qt.point(mouseX, mouseY);
if (__protectedScope.handleEvent(ActivationMode.ActivateOnPress)) {
mouseThief.acceptCurrentEvent();
// We handled the press event, so we can reset this now.
mouseThief.receivedPressEvent = false;
}
}
onReleased: {
__protectedScope.selectionPos = Qt.point(mouseX, mouseY);
if (__protectedScope.handleEvent(ActivationMode.ActivateOnRelease)) {
mouseThief.acceptCurrentEvent();
// We handled the press event, so we can reset this now.
mouseThief.receivedPressEvent = false;
}
__protectedScope.pressedIndex = -1;
}
onClicked: {
__protectedScope.selectionPos = Qt.point(mouseX, mouseY);
if (__protectedScope.handleEvent(ActivationMode.ActivateOnClick)) {
mouseThief.acceptCurrentEvent();
}
// Clicked is the last stage in a click event (press, release, click),
// so we can safely set this to false now.
mouseThief.receivedPressEvent = false;
}
onTouchUpdate: __protectedScope.selectionPos = Qt.point(mouseX, mouseY)
}
onVisibleChanged: {
// parent check is for when it's created without a parent,
// which we do in the tests, for example.
if (parent) {
if (visible) {
if (boundingItem)
__protectedScope.moveWithinBounds();
// We need to grab the mouse so that we can detect released()
// (which is only emitted after pressed(), which our MouseArea can't
// emit as it didn't have focus until we were made visible).
mouseThief.grabMouse(mouseArea);
} else {
mouseThief.ungrabMouse();
__protectedScope.selectionPos = Qt.point(width / 2, height / 2);
}
}
}
onSelectionAngleChanged: __protectedScope.checkForCurrentItem()
/*! \internal */
property QtObject __protectedScope: QtObject {
id: protectedScope
property int currentIndex: -1
property MenuItem currentItem: currentIndex != -1 ? visibleItems[currentIndex] : null
property point selectionPos: Qt.point(width / 2, height / 2)
property int pressedIndex: -1
readonly property var localRect: mapFromItem(mouseArea, mouseArea.mouseX, mouseArea.mouseY)
readonly property var visibleItems: {
var items = [];
for (var i = 0; i < menuItems.length; ++i) {
if (menuItems[i].visible) {
items.push(menuItems[i]);
}
}
return items;
}
onSelectionPosChanged: __protectedScope.checkForCurrentItem()
// Can't bind directly, because the menu sets this to (0, 0) on closing.
onLocalRectChanged: {
if (visible)
selectionPos = Qt.point(localRect.x, localRect.y);
}
function copyItemsToJsArray() {
var newItems = [];
for (var j = 0; j < menuItems.length; ++j) {
newItems.push(menuItems[j]);
}
return newItems;
}
/*!
Returns \c true if the mouse is over the section at \a itemIndex.
*/
function isMouseOver(itemIndex) {
if (__style == null)
return false;
// Our mouse angle's origin is north naturally, but the section angles need to be
// altered to have their origin north, so we need to remove the alteration here in order to compare properly.
// For example, section 0 will start at -1.57, whereas we want it to start at 0.
var sectionStart = __protectedScope.sectionStartAngle(itemIndex) + Math.PI / 2;
var sectionEnd = __protectedScope.sectionEndAngle(itemIndex) + Math.PI / 2;
var selAngle = selectionAngle;
var isWithinOurAngle = false;
if (sectionStart > CppUtils.MathUtils.pi2) {
sectionStart %= CppUtils.MathUtils.pi2;
} else if (sectionStart < -CppUtils.MathUtils.pi2) {
sectionStart %= -CppUtils.MathUtils.pi2;
}
if (sectionEnd > CppUtils.MathUtils.pi2) {
sectionEnd %= CppUtils.MathUtils.pi2;
} else if (sectionEnd < -CppUtils.MathUtils.pi2) {
sectionEnd %= -CppUtils.MathUtils.pi2;
}
// If the section crosses the -180 => 180 wrap-around point (from atan2),
// temporarily rotate the section so it doesn't.
if (sectionStart > Math.PI) {
var difference = sectionStart - Math.PI;
selAngle -= difference;
sectionStart -= difference;
sectionEnd -= difference;
} else if (sectionStart < -Math.PI) {
difference = Math.abs(sectionStart - (-Math.PI));
selAngle += difference;
sectionStart += difference;
sectionEnd += difference;
}
if (sectionEnd > Math.PI) {
difference = sectionEnd - Math.PI;
selAngle -= difference;
sectionStart -= difference;
sectionEnd -= difference;
} else if (sectionEnd < -Math.PI) {
difference = Math.abs(sectionEnd - (-Math.PI));
selAngle += difference;
sectionStart += difference;
sectionEnd += difference;
}
// If we moved the mouse past -180 or 180, we need to move it back within,
// without changing its actual direction.
if (selAngle > Math.PI) {
selAngle = selAngle - CppUtils.MathUtils.pi2;
} else if (selAngle < -Math.PI) {
selAngle += CppUtils.MathUtils.pi2;
}
if (sectionStart > sectionEnd) {
isWithinOurAngle = selAngle >= sectionEnd && selAngle < sectionStart;
} else {
isWithinOurAngle = selAngle >= sectionStart && selAngle < sectionEnd;
}
var x1 = width / 2;
var y1 = height / 2;
var x2 = __protectedScope.selectionPos.x;
var y2 = __protectedScope.selectionPos.y;
var distanceFromCenter = Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2);
var cancelRadiusSquared = __style.cancelRadius * __style.cancelRadius;
var styleRadiusSquared = __style.radius * __style.radius;
var isWithinOurRadius = distanceFromCenter >= cancelRadiusSquared
&& distanceFromCenter < styleRadiusSquared;
return isWithinOurAngle && isWithinOurRadius;
}
readonly property real arcRange: endAngleRadians - startAngleRadians
/*!
The size of one section in radians.
*/
readonly property real sectionSize: arcRange / visibleItems.length
readonly property real startAngleRadians: CppUtils.MathUtils.degToRadOffset(__style.startAngle)
readonly property real endAngleRadians: CppUtils.MathUtils.degToRadOffset(__style.endAngle)
readonly property real circumferenceOfFullRange: 2 * Math.PI * __style.radius
readonly property real percentageOfFullRange: (arcRange / (Math.PI * 2))
readonly property real circumferenceOfSection: (sectionSize / arcRange) * (percentageOfFullRange * circumferenceOfFullRange)
function sectionStartAngle(section) {
var start = startAngleRadians + section * sectionSize;
return start;
}
function sectionCenterAngle(section) {
return (sectionStartAngle(section) + sectionEndAngle(section)) / 2;
}
function sectionEndAngle(section) {
var end = startAngleRadians + section * sectionSize + sectionSize;
return end;
}
function handleEvent(eventType) {
if (!visible)
return false;
checkForCurrentItem();
if (eventType === TriggerMode.TriggerOnPress)
pressedIndex = currentIndex;
if (eventType === TriggerMode.TriggerOnPress && triggerMode === TriggerMode.TriggerOnClick) {
// We *MUST* accept press events if we plan on also accepting the release
// (aka click, since we create that ourselves) event. If we don't, the
// external mouse area gets the press event but not the release event,
// and won't open until a release event is received, which means until the
// user taps twice on the external mouse area.
// Usually, we accept the current event in the onX MouseThief event handlers above,
// but there we set receivedPressEvent to false if this function says it handled
// the event, which we don't want, since TriggerOnClick is expecting to have
// received a press event. So, we ensure that receivedPressEvent stays true
// by saying we didn't handle the event, even though we actually do.
mouseThief.acceptCurrentEvent();
return false;
}
if (triggerMode === eventType) {
if (eventType === TriggerMode.TriggerOnClick && !mouseThief.receivedPressEvent) {
// When the trigger mode is TriggerOnClick, we can't
// act on a click event if we didn't receive the press.
return false;
}
// Setting visible to false resets the selectionPos to the center
// of the menu, which in turn causes the currentItem check to be re-evaluated,
// which sees that there's no current item because the selectionPos is centered.
// To avoid all of that, we store these variables before setting visible to false.
var currentItemBeforeClosing = currentItem;
var selectionPosBeforeClosing = selectionPos;
var currentIndexBeforeClosing = currentIndex;
// If the cursor was over an item; trigger it. If it wasn't,
// close our menu regardless. We do this first so that it's
// possible to keep the menu open by setting visible to true in onTriggered.
visible = false;
if (currentItemBeforeClosing) {
currentItemBeforeClosing.trigger();
}
if (visible && !Settings.hasTouchScreen && !Settings.isMobile) {
// The user kept the menu open in onTriggered, so restore the hover stuff.
selectionPos = selectionPosBeforeClosing;
currentIndex = currentIndexBeforeClosing;
}
// If the trigger mode and event are Release, we should ensure
// that we received a press event beforehand. If we didn't, we shouldn't steal
// the event in MouseThief's event filter.
return mouseThief.receivedPressEvent;
}
return false;
}
function checkForCurrentItem() {
// Use a temporary varibable because setting currentIndex to -1 here
// will trigger onCurrentIndexChanged.
if (!!visibleItems) {
var hoveredIndex = -1;
for (var i = 0; i < visibleItems.length; ++i) {
if (isMouseOver(i)) {
hoveredIndex = i;
break;
}
}
currentIndex = hoveredIndex;
}
}
function simplifyAngle(angle) {
var simplified = angle % 360;
if (simplified < 0)
simplified += 360;
return simplified;
}
function isWithinBottomEdge() {
var start = simplifyAngle(pieMenu.__style.startAngle);
var end = simplifyAngle(pieMenu.__style.endAngle);
return start >= 270 && end <= 90 && ((start < 360 && end <= 360) || (start >= 0 && end > 0));
}
function isWithinTopEdge() {
var start = simplifyAngle(pieMenu.__style.startAngle);
var end = simplifyAngle(pieMenu.__style.endAngle);
return start >= 90 && start < 270 && end > 90 && end <= 270;
}
function isWithinLeftEdge() {
var start = simplifyAngle(pieMenu.__style.startAngle);
var end = simplifyAngle(pieMenu.__style.endAngle);
return (start === 360 || start >= 0) && start < 180 && end > 0 && end <= 180;
}
function isWithinRightEdge() {
var start = simplifyAngle(pieMenu.__style.startAngle);
var end = simplifyAngle(pieMenu.__style.endAngle);
return start >= 180 && start < 360 && end > 180 && (end === 360 || end === 0);
}
/*!
Moves the menu if it would open with parts outside of \a rootParent.
*/
function moveWithinBounds() {
// Find the bounding rect of the bounding item in the parent's referential.
var topLeft = boundingItem.mapToItem(pieMenu.parent, 0, 0);
var topRight = boundingItem.mapToItem(pieMenu.parent, boundingItem.width, 0);
var bottomLeft = boundingItem.mapToItem(pieMenu.parent, 0, boundingItem.height);
var bottomRight = boundingItem.mapToItem(pieMenu.parent, boundingItem.width, boundingItem.height);
// If the boundingItem is rotated, normalize the bounding rect.
topLeft.x = Math.min(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x);
topLeft.y = Math.min(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);
bottomRight.x = Math.max(topLeft.x, topRight.x, bottomLeft.x, bottomRight.x);
bottomRight.y = Math.max(topLeft.y, topRight.y, bottomLeft.y, bottomRight.y);
if (pieMenu.x < topLeft.x && !isWithinLeftEdge()) {
// The width and height of the menu is always that of a full circle,
// so the menu is not always outside an edge when it's outside the edge -
// it depends on the start and end angles.
pieMenu.x = topLeft.x;
} else if (pieMenu.x + pieMenu.width > bottomRight.x && !isWithinRightEdge()) {
pieMenu.x = bottomRight.x - pieMenu.width;
}
if (pieMenu.y < topLeft.y && !isWithinTopEdge()) {
pieMenu.y = topLeft.y;
} else if (pieMenu.y + pieMenu.height > bottomRight.y && !isWithinBottomEdge()) {
pieMenu.y = bottomRight.y - pieMenu.height;
}
}
}
}

View File

@@ -0,0 +1,51 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
/*!
\internal
*/
Button {
id: button
style: Settings.styleComponent(Settings.style, "CircularButtonStyle.qml", button)
}

View File

@@ -0,0 +1,136 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
QtObject {
id: circularButtonStyleHelper
property Item control
property color buttonColorUpTop: "#e3e3e3"
property color buttonColorUpBottom: "#b3b3b3"
property color buttonColorDownTop: "#d3d3d3"
property color buttonColorDownBottom: "#939393"
property color outerArcColorTop: "#9c9c9c"
property color outerArcColorBottom: Qt.rgba(0.941, 0.941, 0.941, 0.29)
property color innerArcColorTop: "#e3e3e3"
property color innerArcColorBottom: "#acacac"
property real innerArcColorBottomStop: 0.4
property color shineColor: Qt.rgba(1, 1, 1, 0.29)
property real smallestAxis: control ? Math.min(control.width, control.height) : 0
property real outerArcLineWidth: smallestAxis * 0.04
property real innerArcLineWidth: Math.max(1, outerArcLineWidth * 0.1)
property real shineArcLineWidth: Math.max(1, outerArcLineWidth * 0.1)
property real implicitWidth: Math.round(TextSingleton.implicitHeight * 8)
property real implicitHeight: Math.round(TextSingleton.implicitHeight * 8)
property color textColorUp: "#4e4e4e"
property color textColorDown: "#303030"
property color textRaisedColorUp: "#ffffff"
property color textRaisedColorDown: "#e3e3e3"
property real radius: (smallestAxis * 0.5) - outerArcLineWidth - innerArcLineWidth
property real halfRadius: radius / 2
property real outerArcRadius: innerArcRadius + outerArcLineWidth / 2
property real innerArcRadius: radius + innerArcLineWidth / 2
property real shineArcRadius: outerArcRadius + outerArcLineWidth / 2 - shineArcLineWidth / 2
property real zeroAngle: Math.PI * 0.5
property color buttonColorTop: control && control.pressed ? buttonColorDownTop : buttonColorUpTop
property color buttonColorBottom: control && control.pressed ? buttonColorDownBottom : buttonColorUpBottom
function toPixels(percentageOfSmallestAxis) {
return percentageOfSmallestAxis * smallestAxis;
}
function paintBackground(ctx) {
ctx.reset();
if (outerArcRadius < 0 || radius < 0)
return;
var xCenter = ctx.canvas.width / 2;
var yCenter = ctx.canvas.height / 2;
/* Draw outer arc */
ctx.beginPath();
ctx.lineWidth = outerArcLineWidth;
ctx.arc(xCenter, yCenter, outerArcRadius, 0, Math.PI * 2, false);
var gradient = ctx.createRadialGradient(xCenter, yCenter - halfRadius,
0, xCenter, yCenter - halfRadius, radius * 1.5);
gradient.addColorStop(0, outerArcColorTop);
gradient.addColorStop(1, outerArcColorBottom);
ctx.strokeStyle = gradient;
ctx.stroke();
/* Draw the shine along the bottom */
ctx.beginPath();
ctx.lineWidth = shineArcLineWidth;
ctx.arc(xCenter, yCenter, shineArcRadius, 0, Math.PI, false);
gradient = ctx.createLinearGradient(xCenter, yCenter + radius, xCenter, yCenter);
gradient.addColorStop(0, shineColor);
gradient.addColorStop(0.5, "rgba(255, 255, 255, 0)");
ctx.strokeStyle = gradient;
ctx.stroke();
/* Draw inner arc */
ctx.beginPath();
ctx.lineWidth = innerArcLineWidth + 1;
ctx.arc(xCenter, yCenter, innerArcRadius, 0, Math.PI * 2, false);
gradient = ctx.createLinearGradient(xCenter, yCenter - halfRadius,
xCenter, yCenter + halfRadius);
gradient.addColorStop(0, innerArcColorTop);
gradient.addColorStop(innerArcColorBottomStop, innerArcColorBottom);
ctx.strokeStyle = gradient;
ctx.stroke();
/* Draw the button's body */
ctx.beginPath();
ctx.ellipse(xCenter - radius, yCenter - radius, radius * 2, radius * 2);
gradient = ctx.createRadialGradient(xCenter, yCenter + radius * 0.85, 0,
xCenter, yCenter + radius * 0.85, radius * (0.85 * 2));
gradient.addColorStop(1, buttonColorTop);
gradient.addColorStop(0, buttonColorBottom);
ctx.fillStyle = gradient;
ctx.fill();
}
}

View File

@@ -0,0 +1,145 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
// Workaround for QTBUG-37751; we need this import for RangeModel, although we shouldn't.
import QtQuick.Controls 1.1
import QtQuick.Controls.Private 1.0
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
Control {
id: label
style: Settings.styleComponent(Settings.style, "CircularTickmarkLabelStyle.qml", label)
property alias minimumValue: range.minimumValue
property alias maximumValue: range.maximumValue
property alias stepSize: range.stepSize
RangeModel {
id: range
minimumValue: 0
maximumValue: 100
stepSize: 0
// Not used.
value: minimumValue
}
/*!
This property determines the angle at which the first tickmark is drawn.
*/
property real minimumValueAngle: -145
/*!
This property determines the angle at which the last tickmark is drawn.
*/
property real maximumValueAngle: 145
/*!
The range between \l minimumValueAngle and \l maximumValueAngle, in
degrees.
*/
readonly property real angleRange: maximumValueAngle - minimumValueAngle
/*!
The interval at which tickmarks are displayed.
*/
property real tickmarkStepSize: 10
/*!
The distance in pixels from the outside of the control (outerRadius) at
which the outermost point of the tickmark line is drawn.
*/
property real tickmarkInset: 0.0
/*!
The amount of tickmarks displayed.
*/
readonly property int tickmarkCount: __tickmarkCount
/*!
The amount of minor tickmarks between each tickmark.
*/
property int minorTickmarkCount: 4
/*!
The distance in pixels from the outside of the control (outerRadius) at
which the outermost point of the minor tickmark line is drawn.
*/
property real minorTickmarkInset: 0.0
/*!
The distance in pixels from the outside of the control (outerRadius) at
which the center of the value marker text is drawn.
*/
property real labelInset: __style.__protectedScope.toPixels(0.19)
/*!
The interval at which tickmark labels are displayed.
*/
property real labelStepSize: tickmarkStepSize
/*!
The amount of tickmark labels displayed.
*/
readonly property int labelCount: (maximumValue - minimumValue) / labelStepSize + 1
/*! \internal */
readonly property real __tickmarkCount: tickmarkStepSize > 0 ? (maximumValue - minimumValue) / tickmarkStepSize + 1 : 0
/*!
This property determines whether or not the control displays tickmarks,
minor tickmarks, and labels.
*/
property bool tickmarksVisible: true
/*!
Returns \a value as an angle in degrees.
For example, if minimumValueAngle is set to \c 270 and maximumValueAngle
is set to \c 90, this function will return \c 270 when passed
minimumValue and \c 90 when passed maximumValue.
*/
function valueToAngle(value) {
var normalised = (value - minimumValue) / (maximumValue - minimumValue);
return (maximumValueAngle - minimumValueAngle) * normalised + minimumValueAngle;
}
}

View File

@@ -0,0 +1,123 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.0
import QtGraphicalEffects 1.0
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Extras.Private 1.1
import QtQuick.Extras.Private.CppUtils 1.0
Control {
id: root
x: handleArea.centerOfHandle.x - width / 2
y: handleArea.centerOfHandle.y - height / 2
style: Settings.styleComponent(Settings.style, "HandleStyle.qml", root)
/*!
The angle of the handle along the circumference of \l rotationRadius in
radians, scaled to be in the range of 0.0 to 1.0.
*/
property alias value: range.value
RangeModel {
id: range
minimumValue: 0.0
maximumValue: 1.0
stepSize: 0
value: minimumValue
}
/*!
The angle in radians where the dial starts.
*/
property real zeroAngle: 0
/*!
The radius of the rotation of this handle.
*/
property real rotationRadius: 50
/*!
The center of the dial. This is the origin point for the handle's
rotation.
*/
property real dialXCenter: 0
property real dialYCenter: 0
/*!
This property holds the amount of extra room added to each side of
the handle to make it easier to drag on touch devices.
*/
property real allowance: Math.max(width, height) * 1.5
/*
The function used to determine the handle's value from the position of
the mouse.
Can be set to provide custom value calculation. It expects these
parameters: \c mouseX, \c mouseY, \c xCenter, \c yCenter, \c zeroAngle
*/
property var valueFromMouse: handleArea.valueFromMouse
property alias handleArea: handleArea
MouseArea {
id: handleArea
// Respond to value changes by calculating the new center of the handle.
property point centerOfHandle: MathUtils.centerAlongCircle(dialXCenter, dialYCenter,
0, 0, MathUtils.valueToAngle(value, 1, zeroAngle), rotationRadius);
anchors.fill: parent
anchors.margins: -allowance
onPositionChanged: {
// Whenever the handle is moved with the mouse, update the value.
value = root.valueFromMouse(mouse.x + centerOfHandle.x - allowance,
mouse.y + centerOfHandle.y - allowance, dialXCenter, dialYCenter, zeroAngle);
}
// A helper function for onPositionChanged.
function valueFromMouse(mouseX, mouseY, xCenter, yCenter, zeroAngle) {
return MathUtils.angleToValue(
MathUtils.halfPi - Math.atan2(mouseX - xCenter, mouseY - yCenter), 1, zeroAngle);
}
}
}

View File

@@ -0,0 +1,102 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.3
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
import QtQuick.Extras.Private.CppUtils 1.0
Loader {
id: iconLoader
active: iconSource != ""
property PieMenu control: null
property QtObject styleData: null
readonly property string iconSource: styleData && styleData.index < control.__protectedScope.visibleItems.length
? control.__protectedScope.visibleItems[styleData.index].iconSource
: ""
sourceComponent: Image {
id: iconImage
source: iconSource
x: pos.x
y: pos.y
scale: scaleFactor
readonly property point pos: MathUtils.centerAlongCircle(
iconLoader.parent.width / 2, iconLoader.parent.height / 2, width, height,
MathUtils.degToRadOffset(sectionCenterAngle(styleData.index)), control.__style.__iconOffset)
/*
The icons should scale with the menu at some point, so that they
stay within the bounds of each section. We down-scale the image by
whichever of the following amounts are larger:
a) The amount by which the largest dimension's diagonal size exceeds
the "selectable" radius. The selectable radius is the distance in pixels
between lines A and B in the incredibly visually appealing image below:
__________
- B -
/ \
/ ____ \
| / A \ |
--------| |--------
b) The amount by which the diagonal exceeds the circumference of
one section.
*/
readonly property real scaleFactor: {
var largestDimension = Math.max(iconImage.sourceSize.width, iconImage.sourceSize.height) * Math.sqrt(2);
// TODO: add padding
var radiusDifference = largestDimension - control.__style.__selectableRadius;
var circumferenceDifference = largestDimension - Math.abs(control.__protectedScope.circumferenceOfSection);
if (circumferenceDifference > 0 || radiusDifference > 0) {
// We need to down-scale.
if (radiusDifference > circumferenceDifference) {
return control.__style.__selectableRadius / largestDimension;
} else {
return Math.abs(control.__protectedScope.circumferenceOfSection) / largestDimension;
}
}
return 1;
}
}
}

View File

@@ -0,0 +1,44 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
pragma Singleton
import QtQuick 2.1
Text {
}

View File

@@ -0,0 +1 @@
module QtQuick.Extras.Private

View File

@@ -0,0 +1,119 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
/*!
\qmltype StatusIndicator
\inqmlmodule QtQuick.Extras
\since 5.5
\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.4
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 {StatusIndicatorStyle}.
*/
Control {
id: statusIndicator
style: Settings.styleComponent(Settings.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
/*!
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
}

View File

@@ -0,0 +1,71 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
/*!
\qmltype ToggleButton
\inqmlmodule QtQuick.Extras
\since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A push button that toggles between two states.
\image togglebutton-unchecked.png An unchecked ToggleButton
An unchecked ToggleButton.
\image togglebutton-checked.png A checked ToggleButton
A checked ToggleButton.
The ToggleButton is a simple extension of Qt Quick Controls' Button, using
the checked property to toggle between two states: \e checked and
\e unchecked. It enhances the visibility of a checkable button's state by
placing color-coded indicators around the button.
You can create a custom appearance for a ToggleButton by assigning a
\l {ToggleButtonStyle}.
*/
Button {
id: button
checkable: true
style: Settings.styleComponent(Settings.style, "ToggleButtonStyle.qml", button)
}

View File

@@ -0,0 +1,478 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQml 2.14 as Qml
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Controls.Private 1.0
import QtQuick.Extras 1.4
import QtQuick.Extras.Private 1.0
import QtQuick.Layouts 1.0
/*!
\qmltype Tumbler
\inqmlmodule QtQuick.Extras
\since 5.5
\ingroup extras
\ingroup extras-interactive
\brief A control that can have several spinnable wheels, each with items
that can be selected.
\image tumbler.png A Tumbler
\note Tumbler requires Qt 5.5.0 or later.
The Tumbler control is used with one or more TumblerColumn items, which
define the content of each column:
\code
Tumbler {
TumblerColumn {
model: 5
}
TumblerColumn {
model: [0, 1, 2, 3, 4]
}
TumblerColumn {
model: ["A", "B", "C", "D", "E"]
}
}
\endcode
You can also use a traditional model with roles:
\code
Rectangle {
width: 220
height: 350
color: "#494d53"
ListModel {
id: listModel
ListElement {
foo: "A"
bar: "B"
baz: "C"
}
ListElement {
foo: "A"
bar: "B"
baz: "C"
}
ListElement {
foo: "A"
bar: "B"
baz: "C"
}
}
Tumbler {
anchors.centerIn: parent
TumblerColumn {
model: listModel
role: "foo"
}
TumblerColumn {
model: listModel
role: "bar"
}
TumblerColumn {
model: listModel
role: "baz"
}
}
}
\endcode
\section1 Limitations
For technical reasons, the model count must be equal to or greater than
\l {TumblerStyle::}{visibleItemCount}
plus one. The
\l {TumblerStyle::}{visibleItemCount}
must also be an odd number.
You can create a custom appearance for a Tumbler by assigning a
\l {TumblerStyle}. To style
individual columns, use the \l {TumblerColumn::delegate}{delegate} and
\l {TumblerColumn::highlight}{highlight} properties of TumblerColumn.
*/
Control {
id: tumbler
/*
\qmlproperty Component Tumbler::style
The style Component for this control.
*/
style: Settings.styleComponent(Settings.style, "TumblerStyle.qml", tumbler)
ListModel {
id: columnModel
}
/*!
\qmlproperty int Tumbler::columnCount
The number of columns in the Tumbler.
*/
readonly property alias columnCount: columnModel.count
/*! \internal */
function __isValidColumnIndex(index) {
return index >= 0 && index < columnCount/* && columnRepeater.children.length === columnCount*/;
}
/*! \internal */
function __isValidColumnAndItemIndex(columnIndex, itemIndex) {
return __isValidColumnIndex(columnIndex) && itemIndex >= 0 && itemIndex < __viewAt(columnIndex).count;
}
/*!
\qmlmethod int Tumbler::currentIndexAt(int columnIndex)
Returns the current index of the column at \a columnIndex, or \c null
if \a columnIndex is invalid.
*/
function currentIndexAt(columnIndex) {
if (!__isValidColumnIndex(columnIndex))
return -1;
return columnModel.get(columnIndex).columnObject.currentIndex;
}
/*!
\qmlmethod void Tumbler::setCurrentIndexAt(int columnIndex, int itemIndex, int interval)
Sets the current index of the column at \a columnIndex to \a itemIndex. The animation
length can be set with \a interval, which defaults to \c 0.
Does nothing if \a columnIndex or \a itemIndex are invalid.
*/
function setCurrentIndexAt(columnIndex, itemIndex, interval) {
if (!__isValidColumnAndItemIndex(columnIndex, itemIndex))
return;
var view = columnRepeater.itemAt(columnIndex).view;
if (view.currentIndex !== itemIndex) {
view.highlightMoveDuration = typeof interval !== 'undefined' ? interval : 0;
view.currentIndex = itemIndex;
view.highlightMoveDuration = Qt.binding(function(){ return __highlightMoveDuration; });
}
}
/*!
\qmlmethod TumblerColumn Tumbler::getColumn(int columnIndex)
Returns the column at \a columnIndex or \c null if the index is
invalid.
*/
function getColumn(columnIndex) {
if (!__isValidColumnIndex(columnIndex))
return null;
return columnModel.get(columnIndex).columnObject;
}
/*!
\qmlmethod TumblerColumn Tumbler::addColumn(TumblerColumn column)
Adds a \a column and returns the added column.
The \a column argument can be an instance of TumblerColumn,
or a \l Component. The component has to contain a TumblerColumn.
Otherwise \c null is returned.
*/
function addColumn(column) {
return insertColumn(columnCount, column);
}
/*!
\qmlmethod TumblerColumn Tumbler::insertColumn(int index, TumblerColumn column)
Inserts a \a column at the given \a index and returns the inserted column.
The \a column argument can be an instance of TumblerColumn,
or a \l Component. The component has to contain a TumblerColumn.
Otherwise, \c null is returned.
*/
function insertColumn(index, column) {
var object = column;
if (typeof column["createObject"] === "function") {
object = column.createObject(root);
} else if (object.__tumbler) {
console.warn("Tumbler::insertColumn(): you cannot add a column to multiple Tumblers")
return null;
}
if (index >= 0 && index <= columnCount && object.accessibleRole === Accessible.ColumnHeader) {
object.__tumbler = tumbler;
object.__index = index;
columnModel.insert(index, { columnObject: object });
return object;
}
if (object !== column)
object.destroy();
console.warn("Tumbler::insertColumn(): invalid argument");
return null;
}
/*
Try making one selection bar by invisible highlight item hack, so that bars go across separators
*/
Component.onCompleted: {
for (var i = 0; i < data.length; ++i) {
var column = data[i];
if (column.accessibleRole === Accessible.ColumnHeader)
addColumn(column);
}
}
/*! \internal */
readonly property alias __columnRow: columnRow
/*! \internal */
property int __highlightMoveDuration: 300
/*! \internal */
function __viewAt(index) {
if (!__isValidColumnIndex(index))
return null;
return columnRepeater.itemAt(index).view;
}
/*! \internal */
readonly property alias __movementDelayTimer: movementDelayTimer
// When the up/down arrow keys are held down on a PathView,
// the movement of the items is limited to the highlightMoveDuration,
// but there is no built-in guard against trying to move the items at
// the speed of the auto-repeat key presses. This results in sluggish
// movement, so we enforce a delay with a timer to avoid this.
Timer {
id: movementDelayTimer
interval: __highlightMoveDuration
}
Loader {
id: backgroundLoader
sourceComponent: __style.background
anchors.fill: columnRow
}
Loader {
id: frameLoader
sourceComponent: __style.frame
anchors.fill: columnRow
anchors.leftMargin: -__style.padding.left
anchors.rightMargin: -__style.padding.right
anchors.topMargin: -__style.padding.top
anchors.bottomMargin: -__style.padding.bottom
}
Row {
id: columnRow
x: __style.padding.left
y: __style.padding.top
Repeater {
id: columnRepeater
model: columnModel
delegate: Item {
id: columnItem
width: columnPathView.width + separatorDelegateLoader.width
height: columnPathView.height
readonly property int __columnIndex: index
// For index-related functions and tests.
readonly property alias view: columnPathView
readonly property alias separator: separatorDelegateLoader.item
PathView {
id: columnPathView
width: columnObject.width
height: tumbler.height - tumbler.__style.padding.top - tumbler.__style.padding.bottom
visible: columnObject.visible
clip: true
Qml.Binding {
target: columnObject
property: "__currentIndex"
value: columnPathView.currentIndex
restoreMode: Binding.RestoreBinding
}
// We add one here so that the delegate's don't just appear in the view instantly,
// but rather come from the top/bottom. To account for this adjustment elsewhere,
// we extend the path height by half an item's height at the top and bottom.
pathItemCount: tumbler.__style.visibleItemCount + 1
preferredHighlightBegin: 0.5
preferredHighlightEnd: 0.5
highlightMoveDuration: tumbler.__highlightMoveDuration
highlight: Loader {
id: highlightLoader
objectName: "highlightLoader"
sourceComponent: columnObject.highlight ? columnObject.highlight : __style.highlight
width: columnPathView.width
readonly property int __index: index
property QtObject styleData: QtObject {
readonly property alias index: highlightLoader.__index
readonly property int column: columnItem.__columnIndex
readonly property bool activeFocus: columnPathView.activeFocus
}
}
dragMargin: width / 2
activeFocusOnTab: true
Keys.onDownPressed: {
if (!movementDelayTimer.running) {
columnPathView.incrementCurrentIndex();
movementDelayTimer.start();
}
}
Keys.onUpPressed: {
if (!movementDelayTimer.running) {
columnPathView.decrementCurrentIndex();
movementDelayTimer.start();
}
}
path: Path {
startX: columnPathView.width / 2
startY: -tumbler.__style.__delegateHeight / 2
PathLine {
x: columnPathView.width / 2
y: columnPathView.pathItemCount * tumbler.__style.__delegateHeight - tumbler.__style.__delegateHeight / 2
}
}
model: columnObject.model
delegate: Item {
id: delegateRootItem
property var itemModel: model
implicitWidth: itemDelegateLoader.width
implicitHeight: itemDelegateLoader.height
Loader {
id: itemDelegateLoader
sourceComponent: columnObject.delegate ? columnObject.delegate : __style.delegate
width: columnObject.width
onHeightChanged: tumbler.__style.__delegateHeight = height;
property var model: itemModel
readonly property var __modelData: modelData
readonly property int __columnDelegateIndex: index
property QtObject styleData: QtObject {
readonly property var modelData: itemDelegateLoader.__modelData
readonly property alias index: itemDelegateLoader.__columnDelegateIndex
readonly property int column: columnItem.__columnIndex
readonly property bool activeFocus: columnPathView.activeFocus
readonly property real displacement: {
var count = delegateRootItem.PathView.view.count;
var offset = delegateRootItem.PathView.view.offset;
var d = count - index - offset;
var halfVisibleItems = Math.floor(tumbler.__style.visibleItemCount / 2) + 1;
if (d > halfVisibleItems)
d -= count;
else if (d < -halfVisibleItems)
d += count;
return d;
}
readonly property bool current: delegateRootItem.PathView.isCurrentItem
readonly property string role: columnObject.role
readonly property var value: (itemModel && itemModel.hasOwnProperty(role))
? itemModel[role] // Qml ListModel and QAbstractItemModel
: modelData && modelData.hasOwnProperty(role)
? modelData[role] // QObjectList/QObject
: modelData != undefined ? modelData : "" // Models without role
}
}
}
}
Loader {
anchors.fill: columnPathView
sourceComponent: columnObject.columnForeground ? columnObject.columnForeground : __style.columnForeground
property QtObject styleData: QtObject {
readonly property int column: columnItem.__columnIndex
readonly property bool activeFocus: columnPathView.activeFocus
}
}
Loader {
id: separatorDelegateLoader
objectName: "separatorDelegateLoader"
sourceComponent: __style.separator
// Don't need a separator after the last delegate.
active: __columnIndex < tumbler.columnCount - 1
anchors.left: columnPathView.right
anchors.top: parent.top
anchors.bottom: parent.bottom
visible: columnObject.visible
// Use the width of the first separator to help us
// determine the default separator width.
onWidthChanged: {
if (__columnIndex == 0) {
tumbler.__style.__separatorWidth = width;
}
}
property QtObject styleData: QtObject {
readonly property int index: __columnIndex
}
}
}
}
}
Loader {
id: foregroundLoader
sourceComponent: __style.foreground
anchors.fill: backgroundLoader
}
}

View File

@@ -0,0 +1,171 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Private 1.0
/*!
\qmltype TumblerColumn
\inqmlmodule QtQuick.Extras
\since 5.5
\ingroup extras
\brief A column within a tumbler.
TumblerColumn represents a column within a tumbler, providing the interface
to define the items and width of each column.
\code
Tumbler {
TumblerColumn {
model: [1, 2, 3]
}
TumblerColumn {
model: ["A", "B", "C"]
visible: false
}
}
\endcode
You can create a custom appearance for a Tumbler by assigning a
\l {TumblerStyle}.
*/
QtObject {
id: tumblerColumn
/*! \internal */
property Item __tumbler: null
/*!
\internal
The index of this column within the tumbler.
*/
property int __index: -1
/*!
\internal
The index of the current item, if the PathView has items instantiated,
or the last current index if it doesn't.
*/
property int __currentIndex: -1
property int accessibleRole: Accessible.ColumnHeader
/*!
\qmlproperty int TumblerColumn::currentIndex
This read-only property holds the index of the current item for this
column. If the model count is reduced, the current index will be
reduced to the new count minus one.
\sa {Tumbler::currentIndexAt}, {Tumbler::setCurrentIndexAt}
*/
readonly property alias currentIndex: tumblerColumn.__currentIndex
/*!
This property holds the model that provides data for this column.
*/
property var model: null
/*!
This property holds the model role of this column.
*/
property string role: ""
/*!
The item delegate for this column.
If set, this delegate will be used to display items in this column,
instead of the
\l {TumblerStyle::}{delegate}
property in \l {TumblerStyle}.
The \l {Item::implicitHeight}{implicitHeight} property must be set,
and it must be the same for each delegate.
*/
property Component delegate
/*!
The highlight delegate for this column.
If set, this highlight will be used to display the highlight in this
column, instead of the
\l {TumblerStyle::}{highlight}
property in \l {TumblerStyle}.
*/
property Component highlight
/*!
The foreground of this column.
If set, this component will be used to display the foreground in this
column, instead of the
\l {TumblerStyle::}{columnForeground}
property in \l {TumblerStyle}.
*/
property Component columnForeground
/*!
This property holds the visibility of this column.
*/
property bool visible: true
/*!
This read-only property indicates whether the item has active focus.
See Item's \l {Item::activeFocus}{activeFocus} property for more
information.
*/
readonly property bool activeFocus: {
if (__tumbler === null)
return null;
var view = __tumbler.__viewAt(__index);
return view && view.activeFocus ? true : false;
}
/*!
This property holds the width of this column.
*/
property real width: TextSingleton.implicitHeight * 4
}

View File

@@ -0,0 +1,114 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
Column {
anchors.left: parent.left
anchors.right: parent.right
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("CircularGauge")
SectionLayout {
Label {
text: qsTr("Value")
tooltip: qsTr("Value")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.value
minimumValue: backendValues.minimumValue.value
maximumValue: backendValues.maximumValue.value
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Minimum Value")
tooltip: qsTr("Minimum Value")
}
SecondColumnLayout {
SpinBox {
id: minimumValueSpinBox
backendValue: backendValues.minimumValue
minimumValue: 0
maximumValue: backendValues.maximumValue.value
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Maximum Value")
tooltip: qsTr("Maximum Value")
}
SecondColumnLayout {
SpinBox {
id: maximumValueSpinBox
backendValue: backendValues.maximumValue
minimumValue: backendValues.minimumValue.value
maximumValue: 1000
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Step Size")
tooltip: qsTr("Step Size")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.stepSize
minimumValue: 0
maximumValue: backendValues.maximumValue.value
}
ExpandingSpacer {
}
}
}
}
}

View File

@@ -0,0 +1,96 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
Column {
anchors.left: parent.left
anchors.right: parent.right
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("DelayButton")
SectionLayout {
Label {
text: qsTr("Text")
tooltip: qsTr("Text")
}
SecondColumnLayout {
LineEdit {
backendValue: backendValues.text
showTranslateCheckBox: true
implicitWidth: 180
}
ExpandingSpacer {
}
}
// Label {
// text: qsTr("Disable Button")
// tooltip: qsTr("Disable Button")
// }
// SecondColumnLayout {
// CheckBox {
// backendValue: backendValues.disabled
// implicitWidth: 180
// }
// ExpandingSpacer {
// }
// }
Label {
text: qsTr("Delay")
tooltip: qsTr("Delay")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.delay
minimumValue: 0
maximumValue: 60000
}
ExpandingSpacer {
}
}
}
}
}

View File

@@ -0,0 +1,131 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
Column {
anchors.left: parent.left
anchors.right: parent.right
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Dial")
SectionLayout {
Label {
text: qsTr("Value")
tooltip: qsTr("Value")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.value
minimumValue: backendValues.minimumValue.value
maximumValue: backendValues.maximumValue.value
stepSize: 0.01
decimals: 2
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Minimum Value")
tooltip: qsTr("Minimum Value")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.minimumValue
minimumValue: -1000
maximumValue: backendValues.maximumValue.value
stepSize: 0.01
decimals: 2
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Maximum Value")
tooltip: qsTr("Maximum Value")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.maximumValue
minimumValue: backendValues.minimumValue.value
maximumValue: 1000
stepSize: 0.01
decimals: 2
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Step Size")
tooltip: qsTr("Step Size")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.stepSize
minimumValue: 0
maximumValue: backendValues.maximumValue.value
stepSize: 0.01
decimals: 2
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Tickmarks Visible")
tooltip: qsTr("Tickmarks Visible")
}
SecondColumnLayout {
CheckBox {
backendValue: backendValues.tickmarksVisible
}
ExpandingSpacer {
}
}
}
}
}

View File

@@ -0,0 +1,134 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
Column {
anchors.left: parent.left
anchors.right: parent.right
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Gauge")
SectionLayout {
Label {
text: qsTr("Value")
tooltip: qsTr("Value")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.value
minimumValue: backendValues.minimumValue.value
maximumValue: backendValues.maximumValue.value
stepSize: 0.01
decimals: 2
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Minimum Value")
tooltip: qsTr("Minimum Value")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.minimumValue
minimumValue: 0
maximumValue: backendValues.maximumValue.value
stepSize: 0.01
decimals: 2
}
ExpandingSpacer {
}
}
Label {
text: qsTr("Maximum Value")
tooltip: qsTr("Maximum Value")
}
SecondColumnLayout {
SpinBox {
backendValue: backendValues.maximumValue
minimumValue: backendValues.minimumValue.value
maximumValue: 1000
stepSize: 0.01
decimals: 2
}
ExpandingSpacer {
}
}
// Label {
// text: qsTr("Orientation")
// tooltip: qsTr("Orientation")
// }
// SecondColumnLayout {
// ComboBox {
// id: orientationComboBox
// backendValue: backendValues.orientation
// implicitWidth: 180
// model: ["Vertical", "Horizontal"]
// }
// ExpandingSpacer {
// }
// }
// Label {
// text: qsTr("Tickmark Alignment")
// tooltip: qsTr("Tickmark Alignment")
// }
// SecondColumnLayout {
// ComboBox {
// backendValue: backendValues.orientation
// implicitWidth: 180
// model: orientationComboBox.currentText === "Vertical" ? ["AlignLeft", "AlignRight"] : ["AlignTop", "AlignBottom"]
// }
// ExpandingSpacer {
// }
// }
}
}
}

View File

@@ -0,0 +1,83 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.1 as Controls
import QtQuick.Controls.Styles 1.1
Column {
anchors.left: parent.left
anchors.right: parent.right
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Picture")
SectionLayout {
Label {
text: qsTr("Source")
tooltip: qsTr("Source")
}
SecondColumnLayout {
LineEdit {
backendValue: backendValues.source
showTranslateCheckBox: false
implicitWidth: 180
}
ExpandingSpacer {
}
}
}
}
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Color")
ColorEditor {
caption: qsTr("Color")
backendValue: backendValues.color
supportGradient: false
}
}
}

View File

@@ -0,0 +1,103 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
import QtQuick.Controls 1.1 as Controls
import QtQuick.Controls.Styles 1.1
Column {
anchors.left: parent.left
anchors.right: parent.right
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("PieMenu")
SectionLayout {
Label {
text: qsTr("Trigger Mode")
tooltip: qsTr("Trigger Mode")
}
SecondColumnLayout {
// Work around ComboBox string => int problem.
Controls.ComboBox {
id: comboBox
property variant backendValue: backendValues.triggerMode
property color textColor: "white"
implicitWidth: 180
model: ["TriggerOnPress", "TriggerOnRelease", "TriggerOnClick"]
QtObject {
property variant valueFromBackend: comboBox.backendValue
onValueFromBackendChanged: {
comboBox.currentIndex = comboBox.find(comboBox.backendValue.valueToString);
}
}
onCurrentTextChanged: {
if (backendValue === undefined)
return;
if (backendValue.value !== currentText)
backendValue.value = comboBox.currentIndex
}
style: CustomComboBoxStyle {
textColor: comboBox.textColor
}
ExtendedFunctionButton {
x: 2
y: 4
backendValue: comboBox.backendValue
visible: comboBox.enabled
}
}
ExpandingSpacer {
}
}
}
}
}

View File

@@ -0,0 +1,79 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
Column {
anchors.left: parent.left
anchors.right: parent.right
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("StatusIndicator")
SectionLayout {
Label {
text: qsTr("Active")
tooltip: qsTr("Active")
}
SecondColumnLayout {
CheckBox {
backendValue: backendValues.active
implicitWidth: 100
}
ExpandingSpacer {
}
}
}
}
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("Color")
ColorEditor {
caption: qsTr("Color")
backendValue: backendValues.color
supportGradient: false
}
}
}

View File

@@ -0,0 +1,95 @@
/****************************************************************************
**
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Extras module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** 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 https://www.qt.io/terms-conditions. For further
** information use the contact form at https://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.LGPL3 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-3.0.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 (at your option) the GNU General
** Public license version 3 or any later version approved by the KDE Free
** Qt Foundation. The licenses are as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Please review the following
** information to ensure the GNU General Public License requirements will
** be met: https://www.gnu.org/licenses/gpl-2.0.html and
** https://www.gnu.org/licenses/gpl-3.0.html.
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import HelperWidgets 2.0
import QtQuick.Layouts 1.0
Column {
anchors.left: parent.left
anchors.right: parent.right
Section {
anchors.left: parent.left
anchors.right: parent.right
caption: qsTr("ToggleButton")
SectionLayout {
Label {
text: qsTr("Text")
tooltip: qsTr("Text")
}
SecondColumnLayout {
LineEdit {
backendValue: backendValues.text
showTranslateCheckBox: true
implicitWidth: 180
}
ExpandingSpacer {
}
}
// Label {
// text: qsTr("Disable Button")
// tooltip: qsTr("Disable Button")
// }
// SecondColumnLayout {
// CheckBox {
// backendValue: backendValues.disabled
// implicitWidth: 180
// }
// ExpandingSpacer {
// }
// }
Label {
text: qsTr("Checked")
tooltip: qsTr("Checked")
}
SecondColumnLayout {
CheckBox {
backendValue: backendValues.checked
implicitWidth: 180
}
ExpandingSpacer {
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 340 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -0,0 +1,122 @@
MetaInfo {
Type {
name: "QtQuick.Extras.DelayButton"
icon: "images/delaybutton-icon16.png"
ItemLibraryEntry {
name: "Delay Button"
category: "Qt Quick - Extras"
libraryIcon: "images/delaybutton-icon.png"
version: "1.0"
requiredImport: "QtQuick.Extras"
Property {
name: "text"
type: "binding"
value: "qsTr(\"Button\")"
}
}
}
Type {
name: "QtQuick.Extras.ToggleButton"
icon: "images/togglebutton-icon16.png"
ItemLibraryEntry {
name: "Toggle Button"
category: "Qt Quick - Extras"
libraryIcon: "images/togglebutton-icon.png"
version: "1.0"
requiredImport: "QtQuick.Extras"
Property {
name: "text"
type: "binding"
value: "qsTr(\"Button\")"
}
}
}
Type {
name: "QtQuick.Extras.Gauge"
icon: "images/gauge-icon16.png"
ItemLibraryEntry {
name: "Gauge"
category: "Qt Quick - Extras"
libraryIcon: "images/gauge-icon.png"
version: "1.0"
requiredImport: "QtQuick.Extras"
}
}
Type {
name: "QtQuick.Extras.CircularGauge"
icon: "images/circulargauge-icon16.png"
ItemLibraryEntry {
name: "Circular Gauge"
category: "Qt Quick - Extras"
libraryIcon: "images/circulargauge-icon.png"
version: "1.0"
requiredImport: "QtQuick.Extras"
}
}
Type {
name: "QtQuick.Extras.PieMenu"
icon: "images/piemenu-icon16.png"
ItemLibraryEntry {
name: "Pie Menu"
category: "Qt Quick - Extras"
libraryIcon: "images/piemenu-icon.png"
version: "1.0"
requiredImport: "QtQuick.Extras"
}
}
Type {
name: "QtQuick.Extras.Dial"
icon: "images/dial-icon16.png"
ItemLibraryEntry {
name: "Dial"
category: "Qt Quick - Extras"
libraryIcon: "images/dial-icon.png"
version: "1.0"
requiredImport: "QtQuick.Extras"
}
}
Type {
name: "QtQuick.Extras.StatusIndicator"
icon: "images/statusindicator-icon16.png"
ItemLibraryEntry {
name: "Status Indicator"
category: "Qt Quick - Extras"
libraryIcon: "images/statusindicator-icon.png"
version: "1.1"
requiredImport: "QtQuick.Extras"
}
}
Type {
name: "QtQuick.Extras.Tumbler"
icon: "images/tumbler-icon16.png"
ItemLibraryEntry {
name: "Tumbler"
category: "Qt Quick - Extras"
libraryIcon: "images/tumbler-icon.png"
version: "1.2"
requiredImport: "QtQuick.Extras"
}
}
Type {
name: "QtQuick.Extras.Picture"
icon: "images/picture-icon16.png"
ItemLibraryEntry {
name: "Picture"
category: "Qt Quick - Extras"
libraryIcon: "images/picture-icon.png"
version: "1.3"
requiredImport: "QtQuick.Extras"
}
}
}

View File

@@ -0,0 +1,657 @@
import QtQuick.tooling 1.2
// This file describes the plugin-supplied types contained in the library.
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
// 'qmlplugindump -nonrelocatable QtQuick.Extras 1.4'
Module {
dependencies: [
"QtGraphicalEffects 1.12",
"QtQml 2.14",
"QtQml.Models 2.2",
"QtQuick 2.9",
"QtQuick.Controls 1.5",
"QtQuick.Controls.Styles 1.4",
"QtQuick.Layouts 1.1",
"QtQuick.Window 2.2"
]
Component {
name: "QQuickActivationMode"
exports: ["QtQuick.Extras/ActivationMode 1.0"]
isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "ActivationMode"
values: {
"ActivateOnPress": 0,
"ActivateOnRelease": 1,
"ActivateOnClick": 2
}
}
}
Component {
name: "QQuickCircularProgressBar"
defaultProperty: "data"
prototype: "QQuickPaintedItem"
exports: ["QtQuick.Extras.Private.CppUtils/CircularProgressBar 1.1"]
exportMetaObjectRevisions: [0]
Property { name: "progress"; type: "double" }
Property { name: "barWidth"; type: "double" }
Property { name: "inset"; type: "double" }
Property { name: "minimumValueAngle"; type: "double" }
Property { name: "maximumValueAngle"; type: "double" }
Property { name: "backgroundColor"; type: "QColor" }
Signal {
name: "progressChanged"
Parameter { name: "progress"; type: "double" }
}
Signal {
name: "barWidthChanged"
Parameter { name: "barWidth"; type: "double" }
}
Signal {
name: "insetChanged"
Parameter { name: "inset"; type: "double" }
}
Signal {
name: "minimumValueAngleChanged"
Parameter { name: "minimumValueAngle"; type: "double" }
}
Signal {
name: "maximumValueAngleChanged"
Parameter { name: "maximumValueAngle"; type: "double" }
}
Signal {
name: "backgroundColorChanged"
Parameter { name: "backgroundColor"; type: "QColor" }
}
Method { name: "clearStops" }
Method {
name: "addStop"
Parameter { name: "position"; type: "double" }
Parameter { name: "color"; type: "QColor" }
}
Method { name: "redraw" }
}
Component {
name: "QQuickFlatProgressBar"
defaultProperty: "data"
prototype: "QQuickPaintedItem"
exports: ["QtQuick.Extras.Private.CppUtils/FlatProgressBar 1.1"]
exportMetaObjectRevisions: [0]
Property { name: "stripeOffset"; type: "double" }
Property { name: "progress"; type: "double" }
Property { name: "indeterminate"; type: "bool" }
Signal {
name: "stripeOffsetChanged"
Parameter { name: "stripeOffset"; type: "double" }
}
Signal {
name: "progressChanged"
Parameter { name: "progress"; type: "double" }
}
Signal {
name: "indeterminateChanged"
Parameter { name: "indeterminate"; type: "bool" }
}
Method { name: "repaint" }
Method { name: "restartAnimation" }
Method { name: "onVisibleChanged" }
Method { name: "onWidthChanged" }
Method { name: "onHeightChanged" }
}
Component {
name: "QQuickMathUtils"
prototype: "QObject"
exports: ["QtQuick.Extras.Private.CppUtils/MathUtils 1.0"]
isCreatable: false
isSingleton: true
exportMetaObjectRevisions: [0]
Property { name: "pi2"; type: "double"; isReadonly: true }
Method {
name: "degToRad"
type: "double"
Parameter { name: "degrees"; type: "double" }
}
Method {
name: "degToRadOffset"
type: "double"
Parameter { name: "degrees"; type: "double" }
}
Method {
name: "radToDeg"
type: "double"
Parameter { name: "radians"; type: "double" }
}
Method {
name: "radToDegOffset"
type: "double"
Parameter { name: "radians"; type: "double" }
}
Method {
name: "centerAlongCircle"
type: "QPointF"
Parameter { name: "xCenter"; type: "double" }
Parameter { name: "yCenter"; type: "double" }
Parameter { name: "width"; type: "double" }
Parameter { name: "height"; type: "double" }
Parameter { name: "angleOnCircle"; type: "double" }
Parameter { name: "distanceAlongRadius"; type: "double" }
}
Method {
name: "roundEven"
type: "double"
Parameter { name: "number"; type: "double" }
}
}
Component {
name: "QQuickMouseThief"
prototype: "QObject"
exports: ["QtQuick.Extras.Private.CppUtils/MouseThief 1.0"]
exportMetaObjectRevisions: [0]
Property { name: "receivedPressEvent"; type: "bool" }
Signal {
name: "pressed"
Parameter { name: "mouseX"; type: "int" }
Parameter { name: "mouseY"; type: "int" }
}
Signal {
name: "released"
Parameter { name: "mouseX"; type: "int" }
Parameter { name: "mouseY"; type: "int" }
}
Signal {
name: "clicked"
Parameter { name: "mouseX"; type: "int" }
Parameter { name: "mouseY"; type: "int" }
}
Signal {
name: "touchUpdate"
Parameter { name: "mouseX"; type: "int" }
Parameter { name: "mouseY"; type: "int" }
}
Signal { name: "handledEventChanged" }
Method {
name: "grabMouse"
Parameter { name: "item"; type: "QQuickItem"; isPointer: true }
}
Method { name: "ungrabMouse" }
Method { name: "acceptCurrentEvent" }
}
Component {
name: "QQuickPicture"
defaultProperty: "data"
prototype: "QQuickPaintedItem"
exports: ["QtQuick.Extras/Picture 1.4"]
exportMetaObjectRevisions: [0]
Property { name: "source"; type: "QUrl" }
Property { name: "color"; type: "QColor" }
}
Component {
name: "QQuickTriggerMode"
exports: ["QtQuick.Extras/TriggerMode 1.3"]
isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "TriggerMode"
values: {
"TriggerOnPress": 0,
"TriggerOnRelease": 1,
"TriggerOnClick": 2
}
}
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras.Private/CircularButton 1.0"
exports: ["QtQuick.Extras.Private/CircularButton 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "isDefault"; type: "bool" }
Property { name: "menu"; type: "Menu_QMLTYPE_38"; isPointer: true }
Property { name: "checkable"; type: "bool" }
Property { name: "checked"; type: "bool" }
Property { name: "exclusiveGroup"; type: "QQuickExclusiveGroup1"; isPointer: true }
Property { name: "action"; type: "QQuickAction1"; isPointer: true }
Property { name: "activeFocusOnPress"; type: "bool" }
Property { name: "text"; type: "string" }
Property { name: "tooltip"; type: "string" }
Property { name: "iconSource"; type: "QUrl" }
Property { name: "iconName"; type: "string" }
Property { name: "__position"; type: "string" }
Property { name: "__iconOverriden"; type: "bool"; isReadonly: true }
Property { name: "__action"; type: "QQuickAction1"; isPointer: true }
Property { name: "__iconAction"; type: "QQuickAction1"; isReadonly: true; isPointer: true }
Property { name: "__behavior"; type: "QVariant" }
Property { name: "__effectivePressed"; type: "bool" }
Property { name: "pressed"; type: "bool"; isReadonly: true }
Property { name: "hovered"; type: "bool"; isReadonly: true }
Signal { name: "clicked" }
Method { name: "accessiblePressAction"; type: "QVariant" }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QObject"
name: "QtQuick.Extras.Private/CircularButtonStyleHelper 1.0"
exports: ["QtQuick.Extras.Private/CircularButtonStyleHelper 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
Property { name: "control"; type: "QQuickItem"; isPointer: true }
Property { name: "buttonColorUpTop"; type: "QColor" }
Property { name: "buttonColorUpBottom"; type: "QColor" }
Property { name: "buttonColorDownTop"; type: "QColor" }
Property { name: "buttonColorDownBottom"; type: "QColor" }
Property { name: "outerArcColorTop"; type: "QColor" }
Property { name: "outerArcColorBottom"; type: "QColor" }
Property { name: "innerArcColorTop"; type: "QColor" }
Property { name: "innerArcColorBottom"; type: "QColor" }
Property { name: "innerArcColorBottomStop"; type: "double" }
Property { name: "shineColor"; type: "QColor" }
Property { name: "smallestAxis"; type: "double" }
Property { name: "outerArcLineWidth"; type: "double" }
Property { name: "innerArcLineWidth"; type: "double" }
Property { name: "shineArcLineWidth"; type: "double" }
Property { name: "implicitWidth"; type: "double" }
Property { name: "implicitHeight"; type: "double" }
Property { name: "textColorUp"; type: "QColor" }
Property { name: "textColorDown"; type: "QColor" }
Property { name: "textRaisedColorUp"; type: "QColor" }
Property { name: "textRaisedColorDown"; type: "QColor" }
Property { name: "radius"; type: "double" }
Property { name: "halfRadius"; type: "double" }
Property { name: "outerArcRadius"; type: "double" }
Property { name: "innerArcRadius"; type: "double" }
Property { name: "shineArcRadius"; type: "double" }
Property { name: "zeroAngle"; type: "double" }
Property { name: "buttonColorTop"; type: "QColor" }
Property { name: "buttonColorBottom"; type: "QColor" }
Method {
name: "toPixels"
type: "QVariant"
Parameter { name: "percentageOfSmallestAxis"; type: "QVariant" }
}
Method {
name: "paintBackground"
type: "QVariant"
Parameter { name: "ctx"; type: "QVariant" }
}
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/CircularGauge 1.0"
exports: ["QtQuick.Extras/CircularGauge 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "tickmarksVisible"; type: "bool" }
Property { name: "minimumValue"; type: "double" }
Property { name: "maximumValue"; type: "double" }
Property { name: "value"; type: "double" }
Property { name: "stepSize"; type: "double" }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras.Private/CircularTickmarkLabel 1.0"
exports: ["QtQuick.Extras.Private/CircularTickmarkLabel 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "minimumValueAngle"; type: "double" }
Property { name: "maximumValueAngle"; type: "double" }
Property { name: "angleRange"; type: "double"; isReadonly: true }
Property { name: "tickmarkStepSize"; type: "double" }
Property { name: "tickmarkInset"; type: "double" }
Property { name: "tickmarkCount"; type: "int"; isReadonly: true }
Property { name: "minorTickmarkCount"; type: "int" }
Property { name: "minorTickmarkInset"; type: "double" }
Property { name: "labelInset"; type: "double" }
Property { name: "labelStepSize"; type: "double" }
Property { name: "labelCount"; type: "int"; isReadonly: true }
Property { name: "__tickmarkCount"; type: "double"; isReadonly: true }
Property { name: "tickmarksVisible"; type: "bool" }
Property { name: "minimumValue"; type: "double" }
Property { name: "maximumValue"; type: "double" }
Property { name: "stepSize"; type: "double" }
Method {
name: "valueToAngle"
type: "QVariant"
Parameter { name: "value"; type: "QVariant" }
}
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/DelayButton 1.0"
exports: ["QtQuick.Extras/DelayButton 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "delay"; type: "int" }
Property { name: "__progress"; type: "double" }
Property { name: "progress"; type: "double"; isReadonly: true }
Signal { name: "activated" }
Property { name: "isDefault"; type: "bool" }
Property { name: "menu"; type: "Menu_QMLTYPE_38"; isPointer: true }
Property { name: "checkable"; type: "bool" }
Property { name: "checked"; type: "bool" }
Property { name: "exclusiveGroup"; type: "QQuickExclusiveGroup1"; isPointer: true }
Property { name: "action"; type: "QQuickAction1"; isPointer: true }
Property { name: "activeFocusOnPress"; type: "bool" }
Property { name: "text"; type: "string" }
Property { name: "tooltip"; type: "string" }
Property { name: "iconSource"; type: "QUrl" }
Property { name: "iconName"; type: "string" }
Property { name: "__position"; type: "string" }
Property { name: "__iconOverriden"; type: "bool"; isReadonly: true }
Property { name: "__action"; type: "QQuickAction1"; isPointer: true }
Property { name: "__iconAction"; type: "QQuickAction1"; isReadonly: true; isPointer: true }
Property { name: "__behavior"; type: "QVariant" }
Property { name: "__effectivePressed"; type: "bool" }
Property { name: "pressed"; type: "bool"; isReadonly: true }
Property { name: "hovered"; type: "bool"; isReadonly: true }
Signal { name: "clicked" }
Method { name: "accessiblePressAction"; type: "QVariant" }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/Dial 1.0"
exports: ["QtQuick.Extras/Dial 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "__wrap"; type: "bool" }
Property { name: "activeFocusOnPress"; type: "bool" }
Property { name: "tickmarksVisible"; type: "bool" }
Property { name: "value"; type: "double" }
Property { name: "minimumValue"; type: "double" }
Property { name: "maximumValue"; type: "double" }
Property { name: "hovered"; type: "bool"; isReadonly: true }
Property { name: "stepSize"; type: "double" }
Property { name: "pressed"; type: "bool"; isReadonly: true }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/Dial 1.1"
exports: ["QtQuick.Extras/Dial 1.1"]
exportMetaObjectRevisions: [1]
isComposite: true
defaultProperty: "data"
Property { name: "__wrap"; type: "bool" }
Property { name: "activeFocusOnPress"; type: "bool" }
Property { name: "tickmarksVisible"; type: "bool" }
Property { name: "value"; type: "double" }
Property { name: "minimumValue"; type: "double" }
Property { name: "maximumValue"; type: "double" }
Property { name: "hovered"; type: "bool"; isReadonly: true }
Property { name: "stepSize"; type: "double" }
Property { name: "pressed"; type: "bool"; isReadonly: true }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/Gauge 1.0"
exports: ["QtQuick.Extras/Gauge 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "orientation"; type: "int" }
Property { name: "tickmarkAlignment"; type: "int" }
Property { name: "__tickmarkAlignment"; type: "int" }
Property { name: "__tickmarksInside"; type: "bool" }
Property { name: "tickmarkStepSize"; type: "double" }
Property { name: "minorTickmarkCount"; type: "int" }
Property { name: "formatValue"; type: "QVariant" }
Property { name: "minimumValue"; type: "double" }
Property { name: "value"; type: "double" }
Property { name: "maximumValue"; type: "double" }
Property { name: "font"; type: "QFont" }
Property { name: "__hiddenText"; type: "QQuickText"; isReadonly: true; isPointer: true }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/PieMenu 1.0"
exports: ["QtQuick.Extras/PieMenu 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "menuItems"
Property { name: "selectionAngle"; type: "double"; isReadonly: true }
Property { name: "triggerMode"; type: "int" }
Property { name: "title"; type: "string" }
Property { name: "boundingItem"; type: "QQuickItem"; isPointer: true }
Property { name: "__protectedScope"; type: "QObject"; isPointer: true }
Property { name: "activationMode"; type: "int" }
Property { name: "menuItems"; type: "QQuickMenuItem1"; isList: true; isReadonly: true }
Property { name: "currentIndex"; type: "int"; isReadonly: true }
Property { name: "currentItem"; type: "QQuickMenuItem1"; isReadonly: true; isPointer: true }
Property { name: "__mouseThief"; type: "QQuickMouseThief"; isReadonly: true; isPointer: true }
Method {
name: "popup"
type: "QVariant"
Parameter { name: "x"; type: "QVariant" }
Parameter { name: "y"; type: "QVariant" }
}
Method {
name: "addItem"
type: "QVariant"
Parameter { name: "text"; type: "QVariant" }
}
Method {
name: "insertItem"
type: "QVariant"
Parameter { name: "before"; type: "QVariant" }
Parameter { name: "text"; type: "QVariant" }
}
Method {
name: "removeItem"
type: "QVariant"
Parameter { name: "item"; type: "QVariant" }
}
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickLoader"
name: "QtQuick.Extras.Private/PieMenuIcon 1.0"
exports: ["QtQuick.Extras.Private/PieMenuIcon 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "control"; type: "PieMenu_QMLTYPE_98"; isPointer: true }
Property { name: "styleData"; type: "QObject"; isPointer: true }
Property { name: "iconSource"; type: "string"; isReadonly: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/StatusIndicator 1.0"
exports: ["QtQuick.Extras/StatusIndicator 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "active"; type: "bool" }
Property { name: "color"; type: "QColor" }
Property { name: "on"; type: "bool" }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/StatusIndicator 1.1"
exports: ["QtQuick.Extras/StatusIndicator 1.1"]
exportMetaObjectRevisions: [1]
isComposite: true
defaultProperty: "data"
Property { name: "active"; type: "bool" }
Property { name: "color"; type: "QColor" }
Property { name: "on"; type: "bool" }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickText"
name: "QtQuick.Extras.Private/TextSingleton 1.0"
exports: ["QtQuick.Extras.Private/TextSingleton 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
isCreatable: false
isSingleton: true
defaultProperty: "data"
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/ToggleButton 1.0"
exports: ["QtQuick.Extras/ToggleButton 1.0"]
exportMetaObjectRevisions: [0]
isComposite: true
defaultProperty: "data"
Property { name: "isDefault"; type: "bool" }
Property { name: "menu"; type: "Menu_QMLTYPE_38"; isPointer: true }
Property { name: "checkable"; type: "bool" }
Property { name: "checked"; type: "bool" }
Property { name: "exclusiveGroup"; type: "QQuickExclusiveGroup1"; isPointer: true }
Property { name: "action"; type: "QQuickAction1"; isPointer: true }
Property { name: "activeFocusOnPress"; type: "bool" }
Property { name: "text"; type: "string" }
Property { name: "tooltip"; type: "string" }
Property { name: "iconSource"; type: "QUrl" }
Property { name: "iconName"; type: "string" }
Property { name: "__position"; type: "string" }
Property { name: "__iconOverriden"; type: "bool"; isReadonly: true }
Property { name: "__action"; type: "QQuickAction1"; isPointer: true }
Property { name: "__iconAction"; type: "QQuickAction1"; isReadonly: true; isPointer: true }
Property { name: "__behavior"; type: "QVariant" }
Property { name: "__effectivePressed"; type: "bool" }
Property { name: "pressed"; type: "bool"; isReadonly: true }
Property { name: "hovered"; type: "bool"; isReadonly: true }
Signal { name: "clicked" }
Method { name: "accessiblePressAction"; type: "QVariant" }
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QQuickFocusScope"
name: "QtQuick.Extras/Tumbler 1.2"
exports: ["QtQuick.Extras/Tumbler 1.2"]
exportMetaObjectRevisions: [2]
isComposite: true
defaultProperty: "data"
Property { name: "__highlightMoveDuration"; type: "int" }
Property { name: "columnCount"; type: "int"; isReadonly: true }
Property { name: "__columnRow"; type: "QQuickRow"; isReadonly: true; isPointer: true }
Property { name: "__movementDelayTimer"; type: "QQmlTimer"; isReadonly: true; isPointer: true }
Method {
name: "__isValidColumnIndex"
type: "QVariant"
Parameter { name: "index"; type: "QVariant" }
}
Method {
name: "__isValidColumnAndItemIndex"
type: "QVariant"
Parameter { name: "columnIndex"; type: "QVariant" }
Parameter { name: "itemIndex"; type: "QVariant" }
}
Method {
name: "currentIndexAt"
type: "QVariant"
Parameter { name: "columnIndex"; type: "QVariant" }
}
Method {
name: "setCurrentIndexAt"
type: "QVariant"
Parameter { name: "columnIndex"; type: "QVariant" }
Parameter { name: "itemIndex"; type: "QVariant" }
Parameter { name: "interval"; type: "QVariant" }
}
Method {
name: "getColumn"
type: "QVariant"
Parameter { name: "columnIndex"; type: "QVariant" }
}
Method {
name: "addColumn"
type: "QVariant"
Parameter { name: "column"; type: "QVariant" }
}
Method {
name: "insertColumn"
type: "QVariant"
Parameter { name: "index"; type: "QVariant" }
Parameter { name: "column"; type: "QVariant" }
}
Method {
name: "__viewAt"
type: "QVariant"
Parameter { name: "index"; type: "QVariant" }
}
Property { name: "style"; type: "QQmlComponent"; isPointer: true }
Property { name: "__style"; type: "QObject"; isPointer: true }
Property { name: "__panel"; type: "QQuickItem"; isPointer: true }
Property { name: "styleHints"; type: "QVariant" }
Property { name: "__styleData"; type: "QObject"; isPointer: true }
}
Component {
prototype: "QObject"
name: "QtQuick.Extras/TumblerColumn 1.2"
exports: ["QtQuick.Extras/TumblerColumn 1.2"]
exportMetaObjectRevisions: [2]
isComposite: true
Property { name: "__tumbler"; type: "QQuickItem"; isPointer: true }
Property { name: "__index"; type: "int" }
Property { name: "__currentIndex"; type: "int" }
Property { name: "model"; type: "QVariant" }
Property { name: "role"; type: "string" }
Property { name: "delegate"; type: "QQmlComponent"; isPointer: true }
Property { name: "highlight"; type: "QQmlComponent"; isPointer: true }
Property { name: "columnForeground"; type: "QQmlComponent"; isPointer: true }
Property { name: "visible"; type: "bool" }
Property { name: "activeFocus"; type: "bool"; isReadonly: true }
Property { name: "width"; type: "double" }
Property { name: "currentIndex"; type: "int"; isReadonly: true }
}
}

View File

@@ -0,0 +1,7 @@
module QtQuick.Extras
plugin qtquickextrasplugin
classname QtQuickExtrasPlugin
#typeinfo plugins.qmltypes
depends QtGraphicalEffects 1.0
depends QtQml 2.14