PDA

View Full Version : [solved]QVariant QAbstractItemModel::data()



Qiieha
17th July 2015, 08:59
Hello,

I have a very short question about the data-method of QAbstractItemModel:


QVariant QAbstractItemModel::data(const QModelIndex & index, int role = Qt::DisplayRole) const

Why is the role declaration not marked as const?


QVariant QAbstractItemModel::data(const QModelIndex & index, const int role = Qt::DisplayRole) const


thank you!

anda_skoa
17th July 2015, 10:33
It is just not very common to pass simple types as const, e.g. the C++ standard library doesn't do that either.

Cheers,
_