-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
28 lines (21 loc) · 824 Bytes
/
main.py
File metadata and controls
28 lines (21 loc) · 824 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
from PySide6.QtCore import QObject, Slot
from PySide6.QtWidgets import QApplication
from pathlib import Path
from RinUI import RinUIWindow, Theme
import sys
class IconLib(RinUIWindow):
def __init__(self):
super().__init__(Path(__file__).resolve().parent / "assets" / "qml" / "main.qml")
self.setIcon((Path(__file__).parent / "assets" / "images" / "logo.png").as_posix())
# register backend
self.backend = IconLibBackend()
self.engine.rootContext().setContextProperty("Backend", self.backend)
class IconLibBackend(QObject):
@Slot(str)
def copyToClipboard(self, text: str):
QApplication.clipboard().setText(text)
if __name__ == "__main__":
app = QApplication()
icon_lib_main = IconLib()
icon_lib_main.setTheme(Theme.Auto)
sys.exit(app.exec())