summaryrefslogtreecommitdiff
path: root/source/main_qt.py
diff options
context:
space:
mode:
authornasrlol <nsrddyn@gmail.com>2024-12-03 02:02:04 +0100
committernasrlol <nsrddyn@gmail.com>2024-12-03 02:02:04 +0100
commit1a3c5ac8cbbf6e3fa72983156ff279b57785852a (patch)
treefe0ecd90b0113284624e1740a4b7fae3c944b46a /source/main_qt.py
parent88567c71a6f9d78870e4c0ced326ae24f4b965aa (diff)
made the cli application
Diffstat (limited to 'source/main_qt.py')
-rw-r--r--source/main_qt.py50
1 files changed, 50 insertions, 0 deletions
diff --git a/source/main_qt.py b/source/main_qt.py
new file mode 100644
index 0000000..5a37a88
--- /dev/null
+++ b/source/main_qt.py
@@ -0,0 +1,50 @@
+from PySide6.QtWidgets import (
+ QApplication,
+ QLabel,
+ QMainWindow,
+ QPushButton,
+ QVBoxLayout,
+ QWidget,
+)
+from PySide6.QtCore import Qt
+import hardware_driver as lcd
+import features as fe
+import sys
+
+F = fe.feat()
+L = lcd.LCD()
+
+
+class mainWindow(QMainWindow):
+ def __init__(self):
+ super().__init__()
+ self.setWindowTitle("I2C CONTROLLER")
+ self.setGeometry(200, 100, 800, 300)
+ self.mainUI()
+
+ def mainUI(self):
+ central_widget = QWidget(self)
+ self.setCentralWidget(central_widget)
+
+ self.label = QLabel("CONNECTED TO I2C DEVICE", self)
+ self.label.setAlignment(Qt.AlignCenter)
+
+ self.button = QPushButton("Clear Screen", self)
+ self.button.clicked.connect(self.clear_screen)
+
+ layout = QVBoxLayout()
+ layout.addWidget(self.label)
+ layout.addWidget(self.button)
+
+ central_widget.setLayout(layout)
+
+ def clear_screen(self):
+ F.clear()
+ self.label.setText("Cleared the LCD screen")
+
+
+if __name__ == "__main__":
+ app = QApplication(sys.argv)
+ window = mainWindow()
+ window.show()
+ sys.exit(app.exec())