Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47430

TreeView: on collapse only bindings in items below collapsed item are evaluated

    XMLWordPrintable

Details

    Description

      • download this example http://doc.qt.io/qt-5/qtquickcontrols-filesystembrowser-example.html
      • add code that relies on some variable, for example currentIndex
        TableViewColumn {
        	title: "Test"
        	width: 100
        	delegate: Rectangle
        	{
        		function isParentOf(parent, child)
        		{
        			while(child.parent != "QModelIndex()")
        			{
        				if(parent === child.parent)
        				{
        					return true;
        				}
        				child = child.parent;
        			}
        			return false;
        		}
        		color: (styleData.selected || isParentOf(styleData.index, view.currentIndex)) ? "red" : "blue"
        		//color: (view.currentIndex === styleData.index) ? Qt.rgba(Math.random(), Math.random(), Math.random(), 1.0) : Qt.rgba(Math.random(), Math.random(), Math.random(), 1.0)
        		border.width: styleData.selected ? 2 : 0
        	}
        }
        
      • expand any item, select subitem, collapse item
      • currentIndex changed but only items below collapsed item (not even collapsed item itself) reacts

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mdrost Mateusz Drost
            Votes:
            8 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes