-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_qml.py
More file actions
28 lines (26 loc) · 760 Bytes
/
Copy pathtest_qml.py
File metadata and controls
28 lines (26 loc) · 760 Bytes
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
import sys
from PyQt6.QtGui import QGuiApplication
from PyQt6.QtQml import QQmlApplicationEngine
from basejump.ui_kde.models import OverlayServiceModel
app = QGuiApplication(sys.argv)
engine = QQmlApplicationEngine()
overlayService = OverlayServiceModel()
engine.rootContext().setContextProperty("overlayService", overlayService)
engine.loadData(b"""
import QtQuick
import QtQuick.Controls
ApplicationWindow {
visible: true
Component.onCompleted: {
console.log("Calling...");
try {
var ret = overlayService.createOverlaySet("Test", "Desc", ["pkg1"], [], []);
console.log("Result:", ret);
} catch(e) {
console.log("Error:", e);
}
Qt.quit();
}
}
""")
sys.exit(app.exec())