Skip to content
Snippets Groups Projects

Implemented a GUI framework

Merged Felix Goding requested to merge 44-create-basic-gui into develop
All threads resolved!
5 files
+ 0
178
Compare changes
  • Side-by-side
  • Inline
Files
5
+ 0
41
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QLabel
from PyQt5.QtCore import Qt
class MainWindow(QMainWindow):
def __init__(self, *args, **kwargs):
super(MainWindow, self).__init__(*args, **kwargs)
#self.windowTitleChanged.connect(self.onWindowTitleChange)
self.windowTitleChanged.connect(lambda x: self.my_custom_fn())
#self.windowTitleChanged.connect(lambda x: self.my_custom_fn(x))
#self.windowTitleChanged.connect(lambda x: self.my_custom_fn(x, 25))
self.setWindowTitle("B-ASIC")
label = QLabel("Welcome to the our ASIC toolbox, B-ASIC")
label.setAlignment(Qt.AlignCenter)
self.setCentralWidget(label)
def onWindowTitleChange(self, s):
print(s)
def my_custom_fn(self, a="HELLO!", b=5):
print(a, b)
def contextMenuEvent(self, event):
print("Context meny event!")
super(MainWindow, self).contextMenuEvent(event)
app = QApplication(sys.argv)
window = MainWindow()
window.show()
app.exec_()
\ No newline at end of file
Loading