Skip to content

Instantly share code, notes, and snippets.

@dridk
Created October 13, 2021 19:46
Show Gist options
  • Save dridk/437756bc1bd77550ac231aad6249b9e1 to your computer and use it in GitHub Desktop.
Save dridk/437756bc1bd77550ac231aad6249b9e1 to your computer and use it in GitHub Desktop.
qt example
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_()
@dridk
Copy link
Author

dridk commented Oct 13, 2021

Installer pyside :

pip install PySide2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment