summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/qt5/Qt5MainWindow.hxx3
-rw-r--r--vcl/qt5/Qt5Frame.cxx10
-rw-r--r--vcl/qt5/Qt5MainWindow.cxx4
3 files changed, 9 insertions, 8 deletions
diff --git a/vcl/inc/qt5/Qt5MainWindow.hxx b/vcl/inc/qt5/Qt5MainWindow.hxx
index a0836170f644..f1e91b489532 100644
--- a/vcl/inc/qt5/Qt5MainWindow.hxx
+++ b/vcl/inc/qt5/Qt5MainWindow.hxx
@@ -34,8 +34,7 @@ class Qt5MainWindow : public QMainWindow
void moveEvent(QMoveEvent*) override;
public:
- Qt5MainWindow(Qt5Frame& rFrame, QWidget* parent = Q_NULLPTR,
- Qt::WindowFlags f = Qt::WindowFlags());
+ Qt5MainWindow(Qt5Frame& rFrame, Qt::WindowFlags f = Qt::WindowFlags());
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 070e17a742a9..ed5f306d7ab0 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -139,18 +139,20 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
else if ((nStyle & SalFrameStyleFlags::FLOAT)
&& !(nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION))
aWinFlags |= Qt::Popup;
- else if (nStyle & SalFrameStyleFlags::DIALOG && pParent)
- aWinFlags |= Qt::Dialog;
else if (nStyle & SalFrameStyleFlags::TOOLWINDOW)
aWinFlags |= Qt::Tool;
+ // top level windows can't be transient in Qt, so make them dialogs, if they have a parent. At least
+ // the plasma shell relies on this setting to skip dialogs in the window list. And Qt Xcb will just
+ // set transient for the types Dialog, Sheet, Tool, SplashScreen, ToolTip, Drawer and Popup.
+ else if (nStyle & SalFrameStyleFlags::DIALOG || m_pParent)
+ aWinFlags |= Qt::Dialog;
else
aWinFlags |= Qt::Window;
}
if (aWinFlags == Qt::Window)
{
- QWidget* pParentWidget = m_pParent ? m_pParent->asChild() : nullptr;
- m_pTopLevel = new Qt5MainWindow(*this, pParentWidget, aWinFlags);
+ m_pTopLevel = new Qt5MainWindow(*this, aWinFlags);
m_pQWidget = new Qt5Widget(*this, aWinFlags);
m_pTopLevel->setCentralWidget(m_pQWidget);
m_pTopLevel->setFocusProxy(m_pQWidget);
diff --git a/vcl/qt5/Qt5MainWindow.cxx b/vcl/qt5/Qt5MainWindow.cxx
index a78097fb66c3..a2a0d6cea86f 100644
--- a/vcl/qt5/Qt5MainWindow.cxx
+++ b/vcl/qt5/Qt5MainWindow.cxx
@@ -15,8 +15,8 @@
#include <QtGui/QAccessible>
#include <QtGui/QCloseEvent>
-Qt5MainWindow::Qt5MainWindow(Qt5Frame& rFrame, QWidget* parent, Qt::WindowFlags f)
- : QMainWindow(parent, f)
+Qt5MainWindow::Qt5MainWindow(Qt5Frame& rFrame, Qt::WindowFlags f)
+ : QMainWindow(nullptr, f)
, m_rFrame(rFrame)
{
QAccessible::installFactory(Qt5AccessibleWidget::customFactory);