QtMvvm  1.1.0
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
MsgDelegate.qml
1 import QtQuick 2.10
2 import QtQuick.Controls 2.3
3 import QtQuick.Layouts 1.3
4 import de.skycoder42.QtMvvm.Quick 1.1
5 
29 ItemDelegate {
30  id: _msgDelegate
31 
43  property alias indicatorComponent: _indicator.sourceComponent
55  property alias indicatorSource: _indicator.source
56 
70  property string editDialogType: type
71 
73  signal showInput(string key, string title, string type, var defaultValue, var properties);
74 
75  text: title
76 
77  ToolTip.visible: pressed && tooltip != ""
78  ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
79  ToolTip.text: tooltip
80  onPressAndHold: QuickPresenter.hapticLongPress()
81 
82  onClicked: showInput(key, title, editDialogType, inputValue, properties)
83 
84  contentItem: GridLayout {
85  columns: 2
86  rows: 2
87 
88  Label {
89  id: _titleLabel
90  text: _msgDelegate.text
91  Layout.row: 0
92  Layout.column: 0
93  font.bold: true
94  elide: Label.ElideRight
95  Layout.fillWidth: true
96  }
97 
98  Label {
99  id: _peviewLabel
100  visible: preview
101  Layout.row: 1
102  Layout.column: 0
103  text: preview
104  wrapMode: Text.WordWrap
105  Layout.fillWidth: true
106  }
107 
108  Loader {
109  id: _indicator
110  visible: item
111  asynchronous: false
112  clip: true
113 
114  Layout.row: 0
115  Layout.column: 1
116  Layout.rowSpan: 2
117  Layout.minimumWidth: item ? implicitWidth : 0
118  Layout.maximumWidth: item ? implicitWidth : 0
119  }
120  }
121 }
static void hapticLongPress()
Performs haptic feedback of a long press (Android only)
The QML import for the QtMvvmQuick QML module.
Definition: ActionButton.qml:4
A QML singleton to access common presenter methods globally.