mirror of
https://github.com/Lerking/pyqt6-examples.git
synced 2025-07-21 04:01:15 +02:00
Added docstrings. /JL
This commit is contained in:
7
main.py
7
main.py
@@ -1,3 +1,5 @@
|
||||
'''pyqt6 example'''
|
||||
|
||||
import sys
|
||||
from PyQt6.QtWidgets import (
|
||||
QApplication,
|
||||
@@ -6,6 +8,7 @@ from PyQt6.QtWidgets import (
|
||||
)
|
||||
import common
|
||||
class MainWindow(QMainWindow):
|
||||
'''MainWindow Class'''
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.setWindowTitle("My App "+common.VERSION)
|
||||
@@ -17,12 +20,14 @@ class MainWindow(QMainWindow):
|
||||
self.setCentralWidget(button)
|
||||
|
||||
def the_button_was_clicked(self):
|
||||
'''Slot/signal'''
|
||||
print("Clicked!")
|
||||
|
||||
def the_button_was_toggled(self, checked):
|
||||
'''Slot/signal'''
|
||||
print("Checked?", checked)
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
app.exec()
|
||||
app.exec()
|
||||
|
Reference in New Issue
Block a user