From bcc62b6f72ef441c6a82cb69e921e7a5fb0acf75 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 28 Jun 2019 11:33:06 +0200 Subject: Tracing: port to QtQuickControls2 Controls1 is deprecated. Also, we can easily show tooltips for all buttons this way. Change-Id: I08c3e49139aa31f83e6c7585d8e33ee0140ce5b0 Reviewed-by: Milian Wolff --- src/libs/tracing/qml/RowLabel.qml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/libs/tracing/qml/RowLabel.qml') diff --git a/src/libs/tracing/qml/RowLabel.qml b/src/libs/tracing/qml/RowLabel.qml index be394b5e7e..e73d51b291 100644 --- a/src/libs/tracing/qml/RowLabel.qml +++ b/src/libs/tracing/qml/RowLabel.qml @@ -24,8 +24,7 @@ ****************************************************************************/ import QtQuick 2.0 -import QtQuick.Controls 1.2 -import QtQuick.Controls.Styles 1.2 +import QtQuick.Controls 2.2 import TimelineTheme 1.0 Button { @@ -38,25 +37,26 @@ Button { signal setRowHeight(int newHeight) property string labelText: label.description ? label.description : qsTr("[unknown]") - action: Action { - onTriggered: button.selectBySelectionId(); - tooltip: button.labelText + (label.displayName ? (" (" + label.displayName + ")") : "") + + onPressed: selectBySelectionId(); + ToolTip.text: labelText + (label.displayName ? (" (" + label.displayName + ")") : "") + ToolTip.visible: hovered + ToolTip.delay: 1000 + + background: Rectangle { + border.width: 1 + border.color: Theme.color(Theme.Timeline_DividerColor) + color: Theme.color(Theme.PanelStatusBarBackgroundColor) } - style: ButtonStyle { - background: Rectangle { - border.width: 1 - border.color: Theme.color(Theme.Timeline_DividerColor) - color: Theme.color(Theme.PanelStatusBarBackgroundColor) - } - label: TimelineText { - text: button.labelText - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignLeft - elide: Text.ElideRight - color: Theme.color(Theme.PanelTextColorLight) - } + contentItem: TimelineText { + text: button.labelText + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignLeft + elide: Text.ElideRight + color: Theme.color(Theme.PanelTextColorLight) } + MouseArea { hoverEnabled: true property bool resizing: false -- cgit v1.2.3