commit 42cd95b23772f7d22b155ecab0a94af661615d0d Author: Dan Date: Wed Apr 2 09:53:15 2025 -0400 Initial Commit diff --git a/1.py b/1.py new file mode 100644 index 0000000..fb23d43 --- /dev/null +++ b/1.py @@ -0,0 +1,20 @@ +from PySide6.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton +import sys + +class MainWindow(QMainWindow): + def __init__(self): + super().__init__() + + self.setWindowTitle('my App') + button=QPushButton('Press me') + + self.setMinimumSize(400,300) + + self.setCentralWidget(button) + +app = QApplication(sys.argv) + +window = MainWindow() +window.show() + +app.exec() \ No newline at end of file diff --git a/2.py b/2.py new file mode 100644 index 0000000..44594c2 --- /dev/null +++ b/2.py @@ -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() \ No newline at end of file diff --git a/2_1.py b/2_1.py new file mode 100644 index 0000000..846f6ec --- /dev/null +++ b/2_1.py @@ -0,0 +1,31 @@ +from PySide6.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton +import sys + +class MainWindow(QMainWindow): + def __init__(self): + super().__init__() + + self.is_checked = True + + self.setWindowTitle('my App') + self.setMinimumSize(400,300) + + button=QPushButton('Press me') + button.setCheckable(True) + button.clicked.connect(self.toggled) + button.setChecked(self.is_checked) + + self.setCentralWidget(button) + + + def toggled(self, checked): + self.is_checked = checked + + print(self.is_checked) + +app = QApplication(sys.argv) + +window = MainWindow() +window.show() + +app.exec() \ No newline at end of file diff --git a/2_2.py b/2_2.py new file mode 100644 index 0000000..9b9cc13 --- /dev/null +++ b/2_2.py @@ -0,0 +1,31 @@ +from PySide6.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton, QLabel, QLineEdit, QHBoxLayout, \ + QVBoxLayout +import sys + +class MainWindow(QMainWindow): + def __init__(self): + super().__init__() + + self.setWindowTitle('my App') + self.setMinimumSize(400,300) + + self.label=QLabel() + + self.input=QLineEdit() + self.input.textChanged.connect(self.label.setText) + + layout=QVBoxLayout() + layout.addWidget(self.input) + layout.addWidget(self.label) + + container=QWidget() + container.setLayout(layout) + + self.setCentralWidget(container) + +app = QApplication(sys.argv) + +window = MainWindow() +window.show() + +app.exec() \ No newline at end of file diff --git a/HC_Test.py b/HC_Test.py new file mode 100644 index 0000000..ab7bb8b --- /dev/null +++ b/HC_Test.py @@ -0,0 +1,36 @@ +from PySide6.QtWidgets import QApplication, QWidget, QMainWindow, QPushButton, QLabel, QLineEdit, QHBoxLayout, \ + QVBoxLayout, QTextEdit +import sys + +class MainWindow(QMainWindow): + def __init__(self): + super().__init__() + + self.setWindowTitle('my App') + self.setMinimumSize(400,300) + + self.input=QTextEdit() + + self.button = QPushButton('Submit') + self.button.connect(self.testSubmit) + + layout=QVBoxLayout() + layout.addWidget(self.input) + layout.addWidget(self.button) + + + container=QWidget() + container.setLayout(layout) + + self.setCentralWidget(container) + + def testSubmit(self): + values = self.input.toPlainText() + print(values) + +app = QApplication(sys.argv) + +window = MainWindow() +window.show() + +app.exec() \ No newline at end of file