Skip to content

Class QfValueMapModelBase

ClassList > QfValueMapModelBase

More...

  • #include <qfvaluemapmodelbase.h>

Inherits the following classes: QAbstractListModel

Public Signals

Type Name
signal void mapChanged

Public Functions

Type Name
QfValueMapModelBase (QObject * parent=nullptr)
QVariant data (const QModelIndex & index, int role=Qt::DisplayRole) override const
QVariant keyForValue (const QString & value) const
int keyToIndex (const QVariant & key) const
QVariant map () const
QHash< int, QByteArray > roleNames () override const
int rowCount (const QModelIndex & parent=QModelIndex()) override const
void setMap (const QVariant & map)

Detailed Description

A base model that manages the key/value pairs for a ValueMap widget.

Public Signals Documentation

signal mapChanged

void QfValueMapModelBase::mapChanged;

Emitted when the map changes.


Public Functions Documentation

function QfValueMapModelBase

explicit QfValueMapModelBase::QfValueMapModelBase (
    QObject * parent=nullptr
) 

Create a new value map model base


function data

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

function keyForValue

QVariant QfValueMapModelBase::keyForValue (
    const QString & value
) const

Returns the key for a value or an invalid QVariant if not found.


function keyToIndex

int QfValueMapModelBase::keyToIndex (
    const QVariant & key
) const

Returns the row (index) of a key or -1 if not found.


function map

QVariant QfValueMapModelBase::map () const

The map, see the property description


function roleNames

QHash< int, QByteArray > QfValueMapModelBase::roleNames () override const

function rowCount

int QfValueMapModelBase::rowCount (
    const QModelIndex & parent=QModelIndex()
) override const

function setMap

void QfValueMapModelBase::setMap (
    const QVariant & map
) 

The map, see the property description



The documentation for this class was generated from the following file src/gui/qfvaluemapmodelbase.h