Guest User

Untitled

a guest
Jul 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. import sys
  2. from PySide2 import QtWidgets, QtGui, QtCore
  3.  
  4. class MyDialog(QtWidgets.QDialog):
  5. def __init__(self, parent=None):
  6. super(MyDialog, self).__init__(parent)
  7. layout = QtWidgets.QVBoxLayout()
  8. buttons = QtWidgets.QDialogButtonBox(
  9. QtWidgets.QDialogButtonBox.Ok |QtWidgets.QDialogButtonBox.Cancel,
  10. QtCore.Qt.Horizontal, self)
  11. buttons.accepted.connect(self.accept)
  12. buttons.rejected.connect(self.reject)
  13. layout.addWidget(buttons)
  14. self.setLayout(layout)
  15.  
  16. if __name__ == '__main__':
  17. app = QtWidgets.QApplication(sys.argv)
  18. win = MyDialog()
  19. result = win.exec_()
  20. print(result)
  21. sys.exit(app.exec_())
Add Comment
Please, Sign In to add comment