
Originally Posted by
xtal256
No, i don't want to go that far.
You don't want to trivially address the problem and would rather duplicate data? Curious, but each to their own.
Here is what you are avoiding:
{
Q_OBJECT
public:
CheckStateFilterProxy
(QObject * parent
= 0): { }
{
if (role == Qt::CheckStateRole)
}
};
class CheckStateFilterProxy: public QSortFilterProxyModel
{
Q_OBJECT
public:
CheckStateFilterProxy(QObject * parent = 0):
QSortFilterProxyModel(parent)
{ }
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const
{
if (role == Qt::CheckStateRole)
return QVariant();
return QSortFilterProxyModel::data(index, role);
}
};
To copy to clipboard, switch view to plain text mode
Bookmarks