解决双标题栏问题

This commit is contained in:
sunzhen 2023-05-15 20:39:57 +08:00 committed by hewenfei
parent ab7e0490d9
commit 4ae0c56f5d
2 changed files with 11 additions and 0 deletions

View File

@ -516,9 +516,19 @@ bool MenuWindow::event(QEvent *event)
updateGeometry(); updateGeometry();
return true; return true;
} }
if (event->type() == QEvent::UpdateRequest) {
WindowHelper::removeHeaderBar(this);
}
return QQuickView::event(event); return QQuickView::event(event);
} }
void MenuWindow::showEvent(QShowEvent *event)
{
//为了主动触发一次updaterequet事件
update();
QQuickView::showEvent(event);
}
void MenuWindow::onActiveFocusItemChanged() void MenuWindow::onActiveFocusItemChanged()
{ {
if (activeFocusItem()) { if (activeFocusItem()) {

View File

@ -140,6 +140,7 @@ protected:
void exposeEvent(QExposeEvent *event) override; void exposeEvent(QExposeEvent *event) override;
void focusOutEvent(QFocusEvent *event) override; void focusOutEvent(QFocusEvent *event) override;
bool event(QEvent *event) override; bool event(QEvent *event) override;
void showEvent(QShowEvent *event) override;
private: private:
void init(); void init();