Qtreeview selection highlighted problem?
hello, Now i write a program with qtreeview and subclassing qabstractItemModel ,it works
and display properly .but when I selected a item in treeview , selection item doesn't highlighted? anyone know how to control to highlighted selection?
I write flag function
such as
Qt::ItemFlags GDOSGrassModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
return Qt::ItemIsEnabled;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
Re: Qtreeview selection highlighted problem?
I foud that similar question :
http://lists.trolltech.com/qt-intere...ad00451-0.html
but I still do not know how to slove these problem?
Re: Qtreeview selection highlighted problem?
Does it work if you change your flags() method to:
Code:
Qt
::ItemFlags GDOSGrassModel
::flags(const QModelIndex &index
) const{
}
?
Re: Qtreeview selection highlighted problem?
thanks, I try it ,but it doesn't work still. Are there other setting can be done?
Quote:
Originally Posted by
jacek
Does it work if you change your flags() method to:
Code:
Qt
::ItemFlags GDOSGrassModel
::flags(const QModelIndex &index
) const{
}
?
Re: Qtreeview selection highlighted problem?
Quote:
Originally Posted by
thefisher
thanks, I try it ,but it doesn't work still. Are there other setting can be done?
If it doesn't work, then the problem might be in some other place. Do you use a custom delegate? What is the value of view's selectionMode property?