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

New commits:
commit 777503f2a0ba6ea0c25c23084f36dcefaf886e4f
Author:     Michael Weghorn <[email protected]>
AuthorDate: Thu Jan 15 15:22:26 2026 +0100
Commit:     Michael Weghorn <[email protected]>
CommitDate: Thu Jan 15 21:07:54 2026 +0100

    tdf#130857 qt weld: Allow toggling all checkbox TreeView items
    
    In QtInstanceTreeView::set_toggle, mark the item as
    checkable, in addition to setting the check state.
    
    Otherwise, checkbox items in the treeview other than
    those in the special checkbox column (that can be enabled
    via weld::TreeView::enable_toggle_buttons and for which
    QtInstanceTreeView::do_insert would then take care
    of setting the checkable state) would only display
    the current state, but couldn't be toggled by the
    user e.g. by clicking on the checkbox.
    
    (Seen with the "Toolbars" tab in the "View" ->
    "User Interface" dialog with Heiko's WIP change
    https://gerrit.libreoffice.org/c/core/+/195836/9
    applied that adds more checkbox columns.)
    
    Change-Id: I46a21877b371888c143b0de636fc66f407ce9e73
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197357
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <[email protected]>

diff --git a/vcl/qt5/QtInstanceTreeView.cxx b/vcl/qt5/QtInstanceTreeView.cxx
index a0d07d45019c..98d765cdbc84 100644
--- a/vcl/qt5/QtInstanceTreeView.cxx
+++ b/vcl/qt5/QtInstanceTreeView.cxx
@@ -369,6 +369,7 @@ void QtInstanceTreeView::set_toggle(const weld::TreeIter& 
rIter, TriState eState
 
     GetQtInstance().RunInMainThread([&] {
         QModelIndex aIndex = nCol == -1 ? toggleButtonModelIndex(rIter) : 
modelIndex(rIter, nCol);
+        itemFromIndex(aIndex)->setCheckable(true);
         itemFromIndex(aIndex)->setCheckState(toQtCheckState(eState));
     });
 }

Reply via email to