20 : QAbstractItemModel( parent )
29 : QAbstractItemModel( parent )
30 , mColumnData( columnData )
43 if ( !mColumnData.isEmpty() )
45 return mColumnData.value(
index.column() ).value( role );
55 return mData.value( Qt::ToolTipRole, mText );
58 return mData.value( role );
65 if (
index.isValid() )
71 return QAbstractItemModel::flags(
index );
77 if ( !hasIndex( row, column,
parent ) )
82 return createIndex( row, column );
104 if ( !mColumnData.empty() )
105 return mColumnData.size();
QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const override
Qt::ItemFlags flags(const QModelIndex &index) const override
int columnCount(const QModelIndex &parent=QModelIndex()) const override
QVariant data(const QModelIndex &index, int role) const override
QModelIndex parent(const QModelIndex &index) const override
QgsSingleItemModel(QObject *parent=nullptr, const QString &text=QString(), const QMap< int, QVariant > &data=QMap< int, QVariant >(), Qt::ItemFlags flags=Qt::NoItemFlags)
Constructor for QgsSingleItemModel with the specified parent object and display text.
int rowCount(const QModelIndex &parent=QModelIndex()) const override