Created
October 13, 2021 19:46
-
-
Save dridk/437756bc1bd77550ac231aad6249b9e1 to your computer and use it in GitHub Desktop.
qt example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from PySide2.QtWidgets import * | |
import sys | |
class MonWidget(QWidget): | |
def __init__(self, parent=None): | |
super().__init__(parent) | |
hlayout = QHBoxLayout() | |
self.left_button = QPushButton("<") | |
hlayout.addWidget(self.left_button) | |
hlayout.addWidget(QPushButton("True positive")) | |
hlayout.addWidget(QPushButton("other")) | |
hlayout.addWidget(QPushButton("False positive")) | |
hlayout.addWidget(QPushButton(">")) | |
hlayout.addWidget(QPushButton("Export results")) | |
mlayout = QVBoxLayout() | |
mlayout.addWidget(QLabel("A > C")) | |
mlayout.addLayout(hlayout) | |
self.setLayout(mlayout) | |
self.left_button.clicked.connect(self.on_back) | |
def on_back(self): | |
print("action back") | |
if __name__ == "__main__": | |
app = QApplication(sys.argv) | |
w = MonWidget() | |
w.show() | |
app.exec_() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installer pyside :
pip install PySide2