def showEvent(self, ev): ret = QDialog.showEvent(self, ev) if self.is_question: try: self.bb.button(self.bb.Yes if self.default_yes else self.bb.No ).setFocus(Qt.OtherFocusReason) except: pass # Buttons were changed else: self.bb.button(self.bb.Ok).setFocus(Qt.OtherFocusReason) return ret
def showEvent(self, ev): ret = QDialog.showEvent(self, ev) self.bb.button(self.bb.Close).setFocus(Qt.FocusReason.OtherFocusReason) return ret
def showEvent(self, ev): ret = QDialog.showEvent(self, ev) self.bb.button(self.bb.Close).setFocus(Qt.OtherFocusReason) return ret