Guard against the event.

Signed-off-by: Yuhang Zhao <2546789017@qq.com>
This commit is contained in:
Yuhang Zhao 2020-10-18 13:23:59 +08:00
parent f38b86e992
commit ae92a00628
1 changed files with 20 additions and 18 deletions

View File

@ -187,6 +187,7 @@ bool Widget::nativeEvent(const QByteArray &eventType, void *message, long *resul
Q_ASSERT(eventType == "windows_generic_MSG"); Q_ASSERT(eventType == "windows_generic_MSG");
Q_ASSERT(message); Q_ASSERT(message);
Q_ASSERT(result); Q_ASSERT(result);
if (ui->customizeTitleBarCB->isChecked()) {
const auto msg = static_cast<LPMSG>(message); const auto msg = static_cast<LPMSG>(message);
const auto getCursorPosition = [](const LPARAM lParam) -> QPoint { const auto getCursorPosition = [](const LPARAM lParam) -> QPoint {
return {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)}; return {GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)};
@ -207,5 +208,6 @@ bool Widget::nativeEvent(const QByteArray &eventType, void *message, long *resul
default: default:
break; break;
} }
}
return QWidget::nativeEvent(eventType, message, result); return QWidget::nativeEvent(eventType, message, result);
} }