Only override MainWindow::nativeEvent for Windows
This commit is contained in:
parent
224d5d46c1
commit
d9d39d8e25
|
@ -1530,12 +1530,16 @@ void MainWindow::showEvent(QShowEvent *e) {
|
||||||
|
|
||||||
void MainWindow::closeEvent(QCloseEvent *e) {
|
void MainWindow::closeEvent(QCloseEvent *e) {
|
||||||
|
|
||||||
|
#ifdef Q_OS_MACOS
|
||||||
|
Exit();
|
||||||
|
#else
|
||||||
if (!hidden_ && keep_running_ && e->spontaneous() && QSystemTrayIcon::isSystemTrayAvailable()) {
|
if (!hidden_ && keep_running_ && e->spontaneous() && QSystemTrayIcon::isSystemTrayAvailable()) {
|
||||||
SetHiddenInTray(true);
|
SetHiddenInTray(true);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Exit();
|
Exit();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
QMainWindow::closeEvent(e);
|
QMainWindow::closeEvent(e);
|
||||||
|
|
||||||
|
@ -2745,25 +2749,21 @@ void MainWindow::Raise() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, qintptr *result) {
|
bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, qintptr *result) {
|
||||||
#else
|
#else
|
||||||
bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) {
|
bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Q_UNUSED(eventType);
|
if (exit_count_ == 0 && message) {
|
||||||
Q_UNUSED(result);
|
MSG *msg = static_cast<MSG*>(message);
|
||||||
|
thumbbar_->HandleWinEvent(msg);
|
||||||
#ifdef Q_OS_WIN
|
}
|
||||||
MSG *msg = static_cast<MSG*>(message);
|
return QMainWindow::nativeEvent(eventType, message, result);
|
||||||
thumbbar_->HandleWinEvent(msg);
|
|
||||||
#else
|
|
||||||
Q_UNUSED(message);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
#endif // Q_OS_WIN
|
||||||
|
|
||||||
void MainWindow::AutoCompleteTags() {
|
void MainWindow::AutoCompleteTags() {
|
||||||
|
|
||||||
|
|
|
@ -117,10 +117,12 @@ class MainWindow : public QMainWindow, public PlatformInterface {
|
||||||
void showEvent(QShowEvent *e) override;
|
void showEvent(QShowEvent *e) override;
|
||||||
void closeEvent(QCloseEvent *e) override;
|
void closeEvent(QCloseEvent *e) override;
|
||||||
void keyPressEvent(QKeyEvent *e) override;
|
void keyPressEvent(QKeyEvent *e) override;
|
||||||
|
#ifdef Q_OS_WIN
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||||
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
|
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
|
||||||
#else
|
#else
|
||||||
bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
|
bool nativeEvent(const QByteArray &eventType, void *message, long *result) override;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// PlatformInterface
|
// PlatformInterface
|
||||||
|
|
Loading…
Reference in New Issue