diff --git a/vcl/inc/qt5/QtInstanceTreeView.hxx b/vcl/inc/qt5/QtInstanceTreeView.hxx index 15fab0ff0792..110bc09c8bd2 100644 --- a/vcl/inc/qt5/QtInstanceTreeView.hxx +++ b/vcl/inc/qt5/QtInstanceTreeView.hxx @@ -44,7 +44,7 @@ public: virtual void unselect(int nPos) override; virtual void remove(int pos) override; virtual OUString get_text(int nRow, int nCol = -1) const override; - virtual void set_text(int row, const OUString& rText, int col = -1) override; + virtual void set_text(int nRow, const OUString& rText, int nCol = -1) override; virtual void set_sensitive(int row, bool bSensitive, int col = -1) override; virtual bool get_sensitive(int row, int col) const override; virtual void set_id(int row, const OUString& rId) override; diff --git a/vcl/qt5/QtInstanceTreeView.cxx b/vcl/qt5/QtInstanceTreeView.cxx index e2d28af9932c..23fe407e8033 100644 --- a/vcl/qt5/QtInstanceTreeView.cxx +++ b/vcl/qt5/QtInstanceTreeView.cxx @@ -162,9 +162,20 @@ OUString QtInstanceTreeView::get_text(int nRow, int nCol) const return sText; } -void QtInstanceTreeView::set_text(int, const OUString&, int) +void QtInstanceTreeView::set_text(int nRow, const OUString& rText, int nCol) { - assert(false && "Not implemented yet"); + assert(nCol != -1 && "Support for special index -1 (first text column) not implemented yet"); + + SolarMutexGuard g; + GetQtInstance().RunInMainThread([&] { + QStandardItem* pItem = m_pModel->item(nRow, nCol); + if (!pItem) + { + pItem = new QStandardItem; + m_pModel->setItem(nRow, nCol, pItem); + } + pItem->setText(toQString(rText)); + }); } void QtInstanceTreeView::set_sensitive(int, bool, int) { assert(false && "Not implemented yet"); }