-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.qml
More file actions
51 lines (38 loc) · 1.46 KB
/
Main.qml
File metadata and controls
51 lines (38 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import QtQuick
import QtQuick.Controls
Window {
SystemPalette { id: appPalette; colorGroup: SystemPalette.Active }
width: 640
height: 480
visible: true
title: qsTr("USBGuard GUI Dashboard")
// Set the Window's background color to the system's window color.
// This will correctly switch between white (light mode) and dark grey (dark mode).
color: appPalette.window
TableView {
anchors.fill: parent
columnSpacing: 1
rowSpacing: 1
clip: true
// ----------------------------------------------------
// 1. LINK THE MODEL
// The C++ model exposed via setContextProperty("usbDevicesModel", ...)
// ----------------------------------------------------
model: usbDevicesModel
delegate: Rectangle {
implicitWidth: 150
implicitHeight: 50
// Display the table header in a different color than the table content
color: (header == true) ? appPalette.accent : appPalette.base
//TableView.onPooled: console.log(tabledata + " pooled")
//TableView.onReused: console.log(tabledata + " reused")
Text {
text: tabledata
anchors.centerIn: parent
font.pointSize: 12
// Display the text in the table header in a different color
color: (header == true) ? appPalette.dark : appPalette.text
}
}
}
}