forked from qt-creator/qt-creator
QmlDesigner: Expand and hide root item
Hide and expand root item in the tree model of the connections editor search result. Change-Id: If6591077fee59542153f2167dfd43c8132b66c95 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
41ee64b8a4
commit
28933f2d4d
@@ -16,17 +16,6 @@ Column {
|
|||||||
|
|
||||||
property var backend
|
property var backend
|
||||||
|
|
||||||
|
|
||||||
/* replaced by ConnectionModelStatementDelegate defined in C++
|
|
||||||
enum ActionType {
|
|
||||||
CallFunction,
|
|
||||||
Assign,
|
|
||||||
ChangeState,
|
|
||||||
SetProperty,
|
|
||||||
PrintMessage,
|
|
||||||
Custom
|
|
||||||
} */
|
|
||||||
|
|
||||||
y: StudioTheme.Values.popupMargin
|
y: StudioTheme.Values.popupMargin
|
||||||
width: parent.width
|
width: parent.width
|
||||||
spacing: root.verticalSpacing
|
spacing: root.verticalSpacing
|
||||||
|
@@ -9,36 +9,24 @@ import StudioTheme as StudioTheme
|
|||||||
T.TreeViewDelegate {
|
T.TreeViewDelegate {
|
||||||
id: control
|
id: control
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
|
|
||||||
implicitWidth: 200
|
implicitWidth: 200
|
||||||
implicitHeight: 30
|
implicitHeight: 30
|
||||||
|
|
||||||
//implicitWidth: leftMargin + __contentIndent + implicitContentWidth + rightPadding + rightMargin
|
|
||||||
//implicitHeight: Math.max(indicator ? indicator.height : 0, implicitContentHeight) * 1.25
|
|
||||||
|
|
||||||
indentation: 12
|
indentation: 12
|
||||||
//leftMargin: 4
|
|
||||||
//rightMargin: 4
|
|
||||||
//spacing: 4
|
|
||||||
|
|
||||||
//topPadding: contentItem ? (height - contentItem.implicitHeight) / 2 : 0
|
|
||||||
leftPadding: control.leftMargin + control.__contentIndent
|
leftPadding: control.leftMargin + control.__contentIndent
|
||||||
|
|
||||||
//required property int row
|
readonly property int customDepth: control.depth - 1
|
||||||
//required property var model
|
|
||||||
readonly property real __contentIndent: !control.isTreeNode ? 0
|
readonly property real __contentIndent: !control.isTreeNode ? 0
|
||||||
: (control.depth * control.indentation)
|
: (control.customDepth * control.indentation)
|
||||||
+ (control.indicator ? control.indicator.width + control.spacing : 0)
|
+ (control.indicator ? control.indicator.width + control.spacing : 0)
|
||||||
|
|
||||||
indicator: Item {
|
indicator: Item {
|
||||||
readonly property real __indicatorIndent: control.leftMargin + (control.depth * control.indentation)
|
x: control.leftMargin + (control.customDepth * control.indentation)
|
||||||
|
|
||||||
x: __indicatorIndent
|
|
||||||
width: 30
|
width: 30
|
||||||
height: 30
|
height: 30
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: caret
|
id: icon
|
||||||
font.family: StudioTheme.Constants.iconFont.family
|
font.family: StudioTheme.Constants.iconFont.family
|
||||||
font.pixelSize: StudioTheme.Values.smallIconFontSize
|
font.pixelSize: StudioTheme.Values.smallIconFontSize
|
||||||
color: control.hovered ? "#111111" : "white" // TODO colors
|
color: control.hovered ? "#111111" : "white" // TODO colors
|
||||||
|
@@ -168,12 +168,13 @@ Controls.Popup {
|
|||||||
clip: true
|
clip: true
|
||||||
model: root.treeModel
|
model: root.treeModel
|
||||||
|
|
||||||
// This is currently a workaround and should be cleaned up. Calling
|
onLayoutChanged: function() {
|
||||||
// expandRecursively every time the filter changes is performance wise not good.
|
treeView.expand(0)
|
||||||
//Connections {
|
}
|
||||||
// target: proxyModel
|
|
||||||
// function onFilterChanged() { treeView.expandRecursively() }
|
rowHeightProvider: function(row) {
|
||||||
//}
|
return (row <= 0) ? 0 : -1
|
||||||
|
}
|
||||||
|
|
||||||
delegate: MyTreeViewDelegate {
|
delegate: MyTreeViewDelegate {
|
||||||
id: treeViewDelegate
|
id: treeViewDelegate
|
||||||
|
Reference in New Issue
Block a user