- # Next two rows: Position selection
- mainBox.addWidget(QtGui.QLabel('Select the position of the external screen relative to the internal one:'))
- mainBox.addLayout(posBox)
-
- btn = QtGui.QPushButton('Left', self)
- btn.clicked.connect(self.left)
- posBox.addWidget(btn)
-
- btn = QtGui.QPushButton('Right', self)
- btn.clicked.connect(self.right)
- btn.setFocus()
- posBox.addWidget(btn)
-
- btn = QtGui.QPushButton('External only', self)
- btn.clicked.connect(self.externalOnly)
- posBox.addWidget(btn)
-
- # Finalization
- self.setLayout(mainBox)
- self.setWindowTitle('External screen setup')
+ # last row: buttons
+ buttons = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self)
+ buttons.accepted.connect(self.accept)
+ buttons.rejected.connect(self.reject)
+
+ # add them all to the window
+ makeLayout(self, QtGui.QVBoxLayout(), [posBox, resBox, buttons])