def __init__(self): QWidget.__init__(self, flags=Qt.Widget) layout = QBoxLayout(QBoxLayout.TopToBottom) pb = QPushButton("Hello") layout.addWidget(pb) layout.setSizeConstraint(QBoxLayout.SetFixedSize) self.setLayout(layout)
def __init__(self, parent=None): super(FlowSolvingPopup, self).__init__(parent) layout = QBoxLayout(QBoxLayout.TopToBottom) layout.setSpacing(0) layout.setContentsMargins(0, 0, 0, 0) self._solverWidget = FlowSolverWidget() self._solverWidget.finished.connect(self._solverFinished) layout.addWidget(self._solverWidget) status = QStatusBar() status.setSizeGripEnabled(False) self._againButton = QPushButton("next") self._againButton.setVisible(False) self._againButton.clicked.connect(self._againClicked) status.addPermanentWidget(self._againButton) self._abortButton = QPushButton("close") self._abortButton.clicked.connect(self._abortClicked) status.addPermanentWidget(self._abortButton) self._messageLabel = QLabel("ready") status.addWidget(self._messageLabel) layout.addWidget(status) layout.setSizeConstraint(QLayout.SetFixedSize) self.setLayout(layout) self._timer = QTimer() self._timer.timeout.connect(self._timerTick)