Compare commits
No commits in common. "0692a45f09b7f8109088f990195a7701f81353fd" and "3d8667781dddf7b927ce346a029d8137141a1921" have entirely different histories.
0692a45f09
...
3d8667781d
1 changed files with 2 additions and 29 deletions
|
|
@ -1,40 +1,13 @@
|
||||||
|
from PySide6.QtWidgets import QApplication, QWidget
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from PySide6.QtCore import QSize, Qt
|
|
||||||
from PySide6.QtWidgets import QApplication, QMainWindow, QPushButton
|
|
||||||
|
|
||||||
|
|
||||||
# Subclass QMainWindow to customize your application's main window
|
|
||||||
class leekMainWindow(QMainWindow):
|
|
||||||
def __init__(self):
|
|
||||||
super().__init__()
|
|
||||||
|
|
||||||
self.setWindowTitle("Leek!")
|
|
||||||
|
|
||||||
button = QPushButton("Press Me!")
|
|
||||||
button.setCheckable(True)
|
|
||||||
button.clicked.connect(self.button_clicked)
|
|
||||||
button.clicked.connect(self.button_toggled)
|
|
||||||
|
|
||||||
self.setMaximumSize(QSize(800,600))
|
|
||||||
self.setMinimumSize(QSize(400,300))
|
|
||||||
|
|
||||||
# Set the central widget of the Window.
|
|
||||||
self.setCentralWidget(button)
|
|
||||||
|
|
||||||
def button_clicked(self):
|
|
||||||
print("Button was clicked")
|
|
||||||
|
|
||||||
def button_toggled(self, checked):
|
|
||||||
print("Checked?", checked )
|
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# If you know you won't use command line arguments QApplication([]) works too.
|
# If you know you won't use command line arguments QApplication([]) works too.
|
||||||
app = QApplication(sys.argv)
|
app = QApplication(sys.argv)
|
||||||
|
|
||||||
# Create a Qt widget, which will be our window.
|
# Create a Qt widget, which will be our window.
|
||||||
window = leekMainWindow()
|
window = QWidget()
|
||||||
window.show() # IMPORTANT!!!!! Windows are hidden by default.
|
window.show() # IMPORTANT!!!!! Windows are hidden by default.
|
||||||
|
|
||||||
# Start the event loop.
|
# Start the event loop.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue