Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

QTreeView clear selection

Tags:

qt

qtreeview

I want to clear the treeView selection, I use static_cast<QTreeView*>(mContext)->selectionModel()->clear();, static_cast<QTreeView*>(mContext) being the tree I'm talking about, however a secondary light blue selection remain, how can I remove the selection entirely?

Thanks!

like image 544
yonutix Avatar asked Jul 31 '26 22:07

yonutix


1 Answers

To clear the selection use clearSelection

static_cast<QTreeView*>(mContext)->selectionModel()->clearSelection();
like image 79
ahmed Avatar answered Aug 03 '26 18:08

ahmed