class FormatHelp(QDialog): def __init__(self, parent=None): QDialog.__init__(self, parent) self.ui = Ui_FormatHelp() self.ui.setupUi(self) # Send SIGNAL def sendSignal(self): self.emit(SIGNAL("hideWindow()")) # Click on the "Close" button @pyqtSignature("on_btnClose_clicked()") def on_btnClose_clicked(self): self.sendSignal() # React on Escape or "Q" key press def keyPressEvent(self, event): if event.key() == Qt.Key_Escape or event.key() == Qt.Key_Q: self.sendSignal() event.ignore() # Ignore the event # React on window close def closeEvent(self, event): self.sendSignal() event.ignore() # Ignore the closeEvent
class FormatHelp(QDialog): def __init__(self, parent=None): QDialog.__init__(self, parent) self.ui = Ui_FormatHelp() self.ui.setupUi(self) # Send SIGNAL def sendSignal(self): self.emit( SIGNAL("hideWindow()") ) # Click on the "Close" button @pyqtSignature("on_btnClose_clicked()") def on_btnClose_clicked(self): self.sendSignal() # React on Escape or "Q" key press def keyPressEvent(self, event): if event.key() == Qt.Key_Escape or event.key() == Qt.Key_Q: self.sendSignal() event.ignore() # Ignore the event # React on window close def closeEvent(self, event): self.sendSignal() event.ignore() # Ignore the closeEvent
def __init__(self, parent=None): QDialog.__init__(self, parent) self.ui = Ui_FormatHelp() self.ui.setupUi(self)