vcl/qt5/QtInstanceBuilder.cxx | 1 + vcl/qt5/QtInstanceImage.cxx | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-)
New commits: commit b211e848e21b1bf6df23d8f877a3d09e09535e41 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Dec 10 17:51:41 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Dec 10 20:37:44 2024 +0100 tdf#130857 qt weld: Support dialog to choose UI variant Declare support for the "View" -> "User Interface" dialog that allows to choose a UI variant. This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. Currently, there's some black background behind the images displaying the different UI variants, which is presumably due to alpha not being handled the way it should somewhere, This should be further investigated at some point, but I don't consider it blocking at the moment since the native Qt dialogs are not used by default. (Letting QtInstanceWidget::create_virtual_device create a virtual device with a separate alpha channel as SalInstanceWidget::create_virtual_device does would result in the background being white instead of black, as it is for the non-welded dialog with qt6.) Change-Id: I198750a27e13476b59569bda60949e286b567c5a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178254 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index 17c5f20a943e..d1f5ef206bbf 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -58,6 +58,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile) u"cui/ui/securityoptionsdialog.ui"_ustr, u"cui/ui/splitcellsdialog.ui"_ustr, u"cui/ui/tipofthedaydialog.ui"_ustr, + u"cui/ui/toolbarmodedialog.ui"_ustr, u"modules/scalc/ui/inputstringdialog.ui"_ustr, u"modules/scalc/ui/insertcells.ui"_ustr, u"modules/scalc/ui/selectsource.ui"_ustr, commit 56fb85cf0a5b01aa03c3f60e288e3e8d2971308a Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Dec 10 17:51:26 2024 +0100 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Tue Dec 10 20:37:36 2024 +0100 tdf#130857 qt weld: Implement QtInstanceImage::set_image(VirtualDevice*) In addition, make sure that all of the QtInstanceImage::set_image variants are run in the main thread. Change-Id: I6808239480a02306de46a9dd4734477c905f666b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178253 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/qt5/QtInstanceImage.cxx b/vcl/qt5/QtInstanceImage.cxx index 1d56edea08e9..291ca5504013 100644 --- a/vcl/qt5/QtInstanceImage.cxx +++ b/vcl/qt5/QtInstanceImage.cxx @@ -21,14 +21,26 @@ QtInstanceImage::QtInstanceImage(QLabel* pLabel) void QtInstanceImage::set_from_icon_name(const OUString& rIconName) { - m_pLabel->setPixmap(loadQPixmapIcon(rIconName)); + SolarMutexGuard g; + + GetQtInstance().RunInMainThread([&] { m_pLabel->setPixmap(loadQPixmapIcon(rIconName)); }); } -void QtInstanceImage::set_image(VirtualDevice*) { assert(false && "Not implemented yet"); } +void QtInstanceImage::set_image(VirtualDevice* pDevice) +{ + SolarMutexGuard g; + + GetQtInstance().RunInMainThread([&] { + if (pDevice) + m_pLabel->setPixmap(toQPixmap(*pDevice)); + }); +} void QtInstanceImage::set_image(const css::uno::Reference<css::graphic::XGraphic>& rGraphic) { - m_pLabel->setPixmap(toQPixmap(rGraphic)); + SolarMutexGuard g; + + GetQtInstance().RunInMainThread([&] { m_pLabel->setPixmap(toQPixmap(rGraphic)); }); } /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */