diff options
-rw-r--r-- | vcl/qt5/QtInstanceButton.cxx | 13 |
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) |