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 00000000000..82cd07977a6 --- /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 963f578221a..17966d2e9bf 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 f72e226ba05..11d39ed9e31 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