diff --git a/src/windows/menu-main-window.cpp b/src/windows/menu-main-window.cpp index c292e6f..e1901ee 100644 --- a/src/windows/menu-main-window.cpp +++ b/src/windows/menu-main-window.cpp @@ -516,9 +516,19 @@ bool MenuWindow::event(QEvent *event) updateGeometry(); return true; } + if (event->type() == QEvent::UpdateRequest) { + WindowHelper::removeHeaderBar(this); + } return QQuickView::event(event); } +void MenuWindow::showEvent(QShowEvent *event) +{ + //为了主动触发一次updaterequet事件 + update(); + QQuickView::showEvent(event); +} + void MenuWindow::onActiveFocusItemChanged() { if (activeFocusItem()) { diff --git a/src/windows/menu-main-window.h b/src/windows/menu-main-window.h index 22b62db..a15403b 100644 --- a/src/windows/menu-main-window.h +++ b/src/windows/menu-main-window.h @@ -140,6 +140,7 @@ protected: void exposeEvent(QExposeEvent *event) override; void focusOutEvent(QFocusEvent *event) override; bool event(QEvent *event) override; + void showEvent(QShowEvent *event) override; private: void init();