If I am to inherit from a class, would I have to define all of its virtual and pure virtual functions?
For example, I have a derived class that is inheriting from QAbstractItemModel
. QAbstractItemModel
has the following pure virtual functions. If my derived class is not going to use the index()
and parent()
method, would I need to implement it?
//qabstractitemmodel.h
virtual QModelIndex index(int row, int column,
const QModelIndex &parent = QModelIndex()) const = 0;
virtual QModelIndex parent(const QModelIndex &child) const = 0;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const = 0;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const = 0;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const = 0;