vcl/qt5/QtInstanceToolbar.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
New commits: commit ec89ee253bb1634432b7ec3b022bb0603dcd7497 Author: Michael Weghorn <[email protected]> AuthorDate: Fri Feb 6 02:01:56 2026 +0100 Commit: Michael Weghorn <[email protected]> CommitDate: Fri Feb 6 10:15:52 2026 +0100 tdf#130857 qt weld: Implement index-based QtInstanceToolbar::set_item_image This will e.g. be used for the "Properties" sidebar deck in Writer, once support for using native Qt widgets for that one is declared. Change-Id: Ic46ba19b4d113438eb28d3fdc3812fe3a4ca1125 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198810 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/vcl/qt5/QtInstanceToolbar.cxx b/vcl/qt5/QtInstanceToolbar.cxx index 2eb40e6fb08d..1c6709c30cc6 100644 --- a/vcl/qt5/QtInstanceToolbar.cxx +++ b/vcl/qt5/QtInstanceToolbar.cxx @@ -252,9 +252,18 @@ void QtInstanceToolbar::set_item_label(int, const OUString&) assert(false && "Not implemented yet"); } -void QtInstanceToolbar::set_item_image(int, const css::uno::Reference<css::graphic::XGraphic>&) +void QtInstanceToolbar::set_item_image(int nIndex, + const css::uno::Reference<css::graphic::XGraphic>& rIcon) { - assert(false && "Not implemented yet"); + SolarMutexGuard g; + + GetQtInstance().RunInMainThread([&] { + QAction* pAction = m_pToolBar->actions().at(nIndex); + assert(pAction); + QToolButton* pToolButton = qobject_cast<QToolButton*>(m_pToolBar->widgetForAction(pAction)); + assert(pToolButton && "No tool button at the given index"); + pToolButton->setIcon(toQPixmap(rIcon)); + }); } void QtInstanceToolbar::set_item_tooltip_text(int, const OUString&)
