What values should I return if I don't want to implement selections in a
QAbstractItemView?
Considering a normal Model class defined by just implementing pure
functions from QAbstractItemModel.
I have to display the model with a pie chart (like in this example) and I
thought of derive from QAbstractItemView and just reimplement its
protected slots.
The fact is that QAbstractItemView force me to implement other pure
virtual functions:
virtual QModelIndex moveCursor(CursorAction, Qt::KeyboardModifiers);
virtual int horizontalOffset() const;
virtual int verticalOffset() const;
virtual bool isIndexHidden(const QModelIndex&) const;
virtual void setSelection(const QRect&, QItemSelectionModel::SelectionFlags);
virtual QRegion visualRegionForSelection(const QItemSelection&) const;
virtual QRect visualRect (const QModelIndex&) const;
virtual void scrollTo(const QModelIndex&, ScrollHint);
virtual QModelIndex indexAt(const QPoint&) const;
Most of this functions are useless in my case and as of right now I am
returning 0, default values (for example return QRect();) or invalid
values (for example return QModelIndex()).
My question is: what are these functions supposed to be used for? Can I
just ignore them, the way I am doing, and not expect repercussions?
No comments:
Post a Comment