36 lines
814 B
Python
36 lines
814 B
Python
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() |