summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/qt5/QtMenu.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/vcl/qt5/QtMenu.cxx b/vcl/qt5/QtMenu.cxx
index 50cb1d057431..fd38a0380000 100644
--- a/vcl/qt5/QtMenu.cxx
+++ b/vcl/qt5/QtMenu.cxx
@@ -429,6 +429,10 @@ void QtMenu::SetFrame(const SalFrame* pFrame)
mpQMenuBar = new QMenuBar();
pMainWindow->setMenuBar(mpQMenuBar);
+
+ QPushButton* pButton = static_cast<QPushButton*>(mpQMenuBar->cornerWidget(Qt::TopRightCorner));
+ if (pButton)
+ connect(pButton, &QPushButton::clicked, this, &QtMenu::slotCloseDocument);
mpQMenu = nullptr;
DoFullMenuUpdate(mpVCLMenu);
@@ -647,6 +651,8 @@ void QtMenu::ShowCloseButton(bool bShow)
return;
QPushButton* pButton = static_cast<QPushButton*>(mpQMenuBar->cornerWidget(Qt::TopRightCorner));
+ if (!pButton && !bShow)
+ return;
if (!pButton)
{
QIcon aIcon;