bool ChatWindow::event(QEvent *AEvent) { if (AEvent->type() == QEvent::KeyPress) { static QKeyEvent *sentEvent = NULL; QKeyEvent *keyEvent = static_cast<QKeyEvent*>(AEvent); if (sentEvent!=keyEvent && !keyEvent->text().isEmpty()) { sentEvent = keyEvent; FEditWidget->textEdit()->setFocus(); QCoreApplication::sendEvent(FEditWidget->textEdit(),AEvent); sentEvent = NULL; AEvent->accept(); return true; } } else if (AEvent->type() == QEvent::WindowActivate) { emit tabPageActivated(); } else if (AEvent->type() == QEvent::WindowDeactivate) { emit tabPageDeactivated(); } return QMainWindow::event(AEvent); }
bool NormalWindow::event(QEvent *AEvent) { if (AEvent->type() == QEvent::WindowActivate) emit tabPageActivated(); else if (AEvent->type() == QEvent::WindowDeactivate) emit tabPageDeactivated(); return QMainWindow::event(AEvent); }
bool CustomMailPage::event(QEvent *AEvent) { if (AEvent->type() == QEvent::WindowActivate) { emit tabPageActivated(); } else if (AEvent->type() == QEvent::WindowDeactivate) { emit tabPageDeactivated(); } return QWidget::event(AEvent); }