aboutsummaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorHenning Gruendl <henning.gruendl@qt.io>2019-08-23 15:17:26 +0200
committerThomas Hartmann <thomas.hartmann@qt.io>2019-08-23 13:37:03 +0000
commit9f7fe2fb8238b19ad6578b5759fd3f1bf8f13ded (patch)
tree6a650603243ab0c4c68635f32b02dcfd2f065db2 /share
parent995f09d6dc2e0d9b1e9ed3c3429ca07ed2a155ce (diff)
QmlDesigner: Add AbstractButton wrapper
Add AbstractButton wrapper to HelperWidgets this enables tooltips on Buttons again. Change-Id: If82bfcf3097f9e09d5cc19e4363b2428ad0ca872 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'share')
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AbstractButton.qml42
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml34
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir1
3 files changed, 59 insertions, 18 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AbstractButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AbstractButton.qml
new file mode 100644
index 0000000000..82cd07977a
--- /dev/null
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AbstractButton.qml
@@ -0,0 +1,42 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of Qt Creator.
+**
+** 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 General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** 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-3.0.html.
+**
+****************************************************************************/
+
+import QtQuick 2.1
+import StudioControls 1.0 as StudioControls
+import StudioTheme 1.0 as StudioTheme
+
+StudioControls.AbstractButton {
+ id: button
+
+ property alias tooltip: toolTipArea.tooltip
+
+ ToolTipArea {
+ id: toolTipArea
+ anchors.fill: parent
+ // Without setting the acceptedButtons property the clicked event won't
+ // reach the AbstractButton, it will be consumed by the ToolTipArea
+ acceptedButtons: Qt.NoButton
+ }
+}
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml
index 963f578221..17966d2e9b 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml
@@ -40,10 +40,10 @@ StudioControls.ButtonRow {
id: group
}
- StudioControls.AbstractButton {
+ AbstractButton {
checkable: true
buttonIcon: StudioTheme.Constants.anchorTop
- //tooltip: qsTr("Anchor item to the top.")
+ tooltip: qsTr("Anchor item to the top.")
property bool topAnchored: anchorBackend.topAnchored
onTopAnchoredChanged: {
@@ -61,10 +61,10 @@ StudioControls.ButtonRow {
}
}
- StudioControls.AbstractButton {
+ AbstractButton {
checkable: true
buttonIcon: StudioTheme.Constants.anchorBottom
- //tooltip: qsTr("Anchor item to the bottom.")
+ tooltip: qsTr("Anchor item to the bottom.")
property bool bottomAnchored: anchorBackend.bottomAnchored
onBottomAnchoredChanged: {
@@ -80,13 +80,12 @@ StudioControls.ButtonRow {
anchorBackend.bottomAnchored = false;
}
}
-
}
- StudioControls.AbstractButton {
+ AbstractButton {
checkable: true
buttonIcon: StudioTheme.Constants.anchorLeft
- //tooltip: qsTr("Anchor item to the left.")
+ tooltip: qsTr("Anchor item to the left.")
property bool leftAnchored: anchorBackend.leftAnchored
onLeftAnchoredChanged: {
@@ -104,10 +103,10 @@ StudioControls.ButtonRow {
}
}
- StudioControls.AbstractButton {
+ AbstractButton {
checkable: true
buttonIcon: StudioTheme.Constants.anchorRight
- //tooltip: qsTr("Anchor item to the right.")
+ tooltip: qsTr("Anchor item to the right.")
property bool rightAnchored: anchorBackend.rightAnchored
onRightAnchoredChanged: {
@@ -125,15 +124,14 @@ StudioControls.ButtonRow {
}
}
- StudioControls.AbstractButton {
+ AbstractButton {
enabled: false
}
-
- StudioControls.AbstractButton {
+ AbstractButton {
checkable: true
buttonIcon: StudioTheme.Constants.anchorFill
- //tooltip: qsTr("Fill parent item.")
+ tooltip: qsTr("Fill parent item.")
property bool isFilled: anchorBackend.isFilled
onIsFilledChanged: {
@@ -149,14 +147,14 @@ StudioControls.ButtonRow {
}
}
- StudioControls.AbstractButton {
+ AbstractButton {
enabled: false
}
- StudioControls.AbstractButton {
+ AbstractButton {
checkable: true
buttonIcon: StudioTheme.Constants.centerVertical
- //tooltip: qsTr("Anchor item vertically.")
+ tooltip: qsTr("Anchor item vertically.")
property bool verticalCentered: anchorBackend.verticalCentered;
onVerticalCenteredChanged: {
@@ -176,10 +174,10 @@ StudioControls.ButtonRow {
}
}
- StudioControls.AbstractButton {
+ AbstractButton {
checkable: true
buttonIcon: StudioTheme.Constants.centerHorizontal
- //tooltip: qsTr("Anchor item horizontally.")
+ tooltip: qsTr("Anchor item horizontally.")
property bool horizontalCentered: anchorBackend.horizontalCentered;
onHorizontalCenteredChanged: {
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir
index f72e226ba0..11d39ed9e3 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/qmldir
@@ -1,3 +1,4 @@
+AbstractButton 2.0 AbstractButton.qml
ActionIndicator 2.0 ActionIndicator.qml
AligmentHorizontalButtons 2.0 AligmentHorizontalButtons.qml
AligmentVerticalButtons 2.0 AligmentVerticalButtons.qml