From 7eacbe5a5e48637458ac8dfece7681a59712dc0f Mon Sep 17 00:00:00 2001 From: sunzhen <13820329802@163.com> Date: Mon, 15 May 2023 20:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8F=8C=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=A0=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/windows/menu-main-window.cpp | 10 ++++++++++ src/windows/menu-main-window.h | 1 + 2 files changed, 11 insertions(+) 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();