Initial Commit
This commit is contained in:
28
2.py
Normal file
28
2.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from PySide6.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton
|
||||
import sys
|
||||
|
||||
class MainWindow(QMainWindow):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.setWindowTitle('my App')
|
||||
self.setMinimumSize(400,300)
|
||||
|
||||
button=QPushButton('Press me')
|
||||
button.setCheckable(True)
|
||||
button.clicked.connect(self.clicked)
|
||||
button.clicked.connect(self.toggled)
|
||||
self.setCentralWidget(button)
|
||||
|
||||
def clicked(self):
|
||||
print('clicked')
|
||||
|
||||
def toggled(self, checked):
|
||||
print('checked? ', checked)
|
||||
|
||||
app = QApplication(sys.argv)
|
||||
|
||||
window = MainWindow()
|
||||
window.show()
|
||||
|
||||
app.exec()
|
||||
Reference in New Issue
Block a user