def get_size(self): dialog = QInputDialog(self) i, okPressed = QInputDialog.getInt(dialog, "Size of sudoku", "Choose the size of sudoku", 3, 2, 100, 1) if okPressed: self.sudoku_size = i dialog.close()
def get_size(self): global sudoku_size dialog = QInputDialog(self) i, okPressed = QInputDialog.getInt(dialog, "Size of sudoku", "Choose the size of sudoku", 3, 2, 100, 1) if okPressed: sudoku_size = i else: sudoku_size = 2 dialog.close()
class AddPatientState(MyState): def __init__(self, name: str, parent=None): super().__init__(name=name, parent=parent) self.dialog = QInputDialog() self.dialog.setWindowTitle('Add patient') self.dialog.setLabelText('Enter patient id:') self.signal_cancel = self.dialog.rejected self.signal_ok = self.dialog.accepted def onEntry(self, event: QEvent): super().onEntry(event) self.dialog.open() def onExit(self, event: QEvent): super().onExit(event) self.dialog.close()