setFlags( index, flags( index ) ~ Qt::ItemIsEnabled ); // disables the item at index
setFlags( index, flags( index ) | Qt::ItemIsEnabled ); // enables the item at index
setFlags( index, flags( index ) ~ Qt::ItemIsEnabled ); // disables the item at index
setFlags( index, flags( index ) | Qt::ItemIsEnabled ); // enables the item at index
To copy to clipboard, switch view to plain text mode
Should do it. Call the first one before you populate, call the second one after population is finished. You should probably call setExpanded( index, false ) on the tree view first to ensure that the parent is colapsed before populating the children.
Bookmarks