Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import sys
- from PySide2 import QtWidgets, QtGui, QtCore
- class MyDialog(QtWidgets.QDialog):
- def __init__(self, parent=None):
- super(MyDialog, self).__init__(parent)
- layout = QtWidgets.QVBoxLayout()
- buttons = QtWidgets.QDialogButtonBox(
- QtWidgets.QDialogButtonBox.Ok |QtWidgets.QDialogButtonBox.Cancel,
- QtCore.Qt.Horizontal, self)
- buttons.accepted.connect(self.accept)
- buttons.rejected.connect(self.reject)
- layout.addWidget(buttons)
- self.setLayout(layout)
- if __name__ == '__main__':
- app = QtWidgets.QApplication(sys.argv)
- win = MyDialog()
- result = win.exec_()
- print(result)
- sys.exit(app.exec_())
Add Comment
Please, Sign In to add comment