vcl/qt5/QtInstanceTreeView.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f4d87639be7741cd95426bfc216f9ea51255fdca
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Aug 28 13:33:52 2025 +0200
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Aug 28 18:47:32 2025 +0200

    tdf#130857 qt weld: Pass parent when setting tree entry text on insert
    
    Take the parent into account when creating the TreeIter
    passed to QtInstanceTreeView::set_text.
    
    This makes the "Tools" -> "AutoText" show the tree view
    entries as expected again in a WIP branch where support for
    using native Qt widgets with SAL_VCL_QT_USE_WELDED_WIDGETS=1
    is declared.
    
    This broke previously with
    
        commit 44e08e5b7fef8d9aa65e81e6a9a1367b177f473c
        Author: Michael Weghorn <[email protected]>
        Date:   Sun Aug 3 22:36:37 2025 +0200
    
            tdf#130857 qt weld: Use text col in TreeView::insert
    
    which had resulted in top-level entries always getting used
    instead of the children of the given parent.
    
    Change-Id: I0b63ccba426e737c6bae968cd9dc8c88d8436e9e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190327
    Reviewed-by: Michael Weghorn <[email protected]>
    Tested-by: Jenkins

diff --git a/vcl/qt5/QtInstanceTreeView.cxx b/vcl/qt5/QtInstanceTreeView.cxx
index fa5126f42f78..9c84203f7c97 100644
--- a/vcl/qt5/QtInstanceTreeView.cxx
+++ b/vcl/qt5/QtInstanceTreeView.cxx
@@ -75,7 +75,7 @@ void QtInstanceTreeView::insert(const weld::TreeIter* 
pParent, int nPos, const O
         const QModelIndex aIndex = modelIndex(nPos, 0, aParentIndex);
         QStandardItem* pItem = itemFromIndex(aIndex);
         if (pStr)
-            set_text(treeIter(nPos), *pStr);
+            set_text(treeIter(nPos, aParentIndex), *pStr);
         if (pId)
             pItem->setData(toQString(*pId), ROLE_ID);
 

Reply via email to