解决双标题栏问题

This commit is contained in:
sunzhen 2023-05-15 20:39:57 +08:00
parent 8ca1215ba6
commit 7eacbe5a5e
2 changed files with 11 additions and 0 deletions

View File

@ -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()) {

View File

@ -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();