summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-12-19 21:11:53 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2024-12-20 07:14:54 +0100
commit4a7247ac6c89f6e163c0086c46706f5226dc3d78 (patch)
tree584a78cafe23c796a2a3c6b06c6747ec8168f05b
parent2f5e75ed134cfd0224e03411ca9d7d81f319c91b (diff)
tdf#130857 qt weld: Implement QtInstanceButton::set_image
Change-Id: I326ae219732a5cb389368dbc0566e9f27ce9a66d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178846 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--vcl/qt5/QtInstanceButton.cxx13
1 files changed, 9 insertions, 4 deletions
diff --git a/vcl/qt5/QtInstanceButton.cxx b/vcl/qt5/QtInstanceButton.cxx
index 382d7f2bb853..1f1e61ca4640 100644
--- a/vcl/qt5/QtInstanceButton.cxx
+++ b/vcl/qt5/QtInstanceButton.cxx
@@ -39,14 +39,19 @@ void QtInstanceButton::set_label(const OUString& rText)
m_pButton->setText(toQString(rText));
}
-void QtInstanceButton::set_image(VirtualDevice* /*pDevice*/)
+void QtInstanceButton::set_image(VirtualDevice* pDevice)
{
- assert(false && "Not implemented yet");
+ SolarMutexGuard g;
+ GetQtInstance().RunInMainThread([&] {
+ if (pDevice)
+ m_pButton->setIcon(toQPixmap(*pDevice));
+ });
}
-void QtInstanceButton::set_image(const css::uno::Reference<css::graphic::XGraphic>& /*rImage*/)
+void QtInstanceButton::set_image(const css::uno::Reference<css::graphic::XGraphic>& rImage)
{
- assert(false && "Not implemented yet");
+ SolarMutexGuard g;
+ GetQtInstance().RunInMainThread([&] { m_pButton->setIcon(toQPixmap(rImage)); });
}
void QtInstanceButton::set_from_icon_name(const OUString& rIconName)