diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2024-09-18 10:27:33 +0200 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2024-09-18 20:01:56 +0200 |
commit | 5fb127ffaf6628ac9a757638705948aa5cb94b55 (patch) | |
tree | e871ceda2d7f808a90e09d2851e6291cd9f5630c /vcl | |
parent | 10590d4f1f072630238a1e62fe48afb20ab41644 (diff) |
tdf#130857 qt weld: Pass parent to QtInstanceBuilder
Instead of always passing `nullptr` for the
parent to the `QtInstanceBuilder`, use
`QtInstance::GetNativeParentFromWeldParent` in order
to find a QWidget that can be used for the parent.
This makes the "Save Document?" dialog in the
WIP Gerrit change [1] (patch set 24 that actually
makes use of the parent) properly modal on top
of the Writer window, so the dialog no longer
disappears behind the Writer window when using
Alt+Tab.
[1] https://gerrit.libreoffice.org/c/core/+/161831
Change-Id: I84de0c4808d76020103f10ebaacb03908a6ee815
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173594
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Tested-by: Jenkins
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/qt5/QtInstance.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx index fbfc06ac61ee..2243b3dec590 100644 --- a/vcl/qt5/QtInstance.cxx +++ b/vcl/qt5/QtInstance.cxx @@ -823,9 +823,14 @@ std::unique_ptr<weld::Builder> QtInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile) { if (!QtData::noWeldedWidgets() && QtInstanceBuilder::IsUIFileSupported(rUIFile)) - return std::make_unique<QtInstanceBuilder>(nullptr, rUIRoot, rUIFile); + { + QWidget* pQtParent = GetNativeParentFromWeldParent(pParent); + return std::make_unique<QtInstanceBuilder>(pQtParent, rUIRoot, rUIFile); + } else + { return SalInstance::CreateBuilder(pParent, rUIRoot, rUIFile); + } } weld::MessageDialog* QtInstance::CreateMessageDialog(weld::Widget* pParent, |