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 <milian.wolff@kdab.com>
This commit is contained in:
Ulf Hermann
2019-06-28 11:33:06 +02:00
parent 163d5c5ce8
commit bcc62b6f72
9 changed files with 190 additions and 207 deletions

View File

@@ -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