Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QRangeModel::ItemAccess< T > Class Template Reference

\inmodule QtCore More...

#include <qrangemodel.h>

Inheritance diagram for QRangeModel::ItemAccess< T >:
Collaboration diagram for QRangeModel::ItemAccess< T >:

Detailed Description

template<typename T>
class QRangeModel::ItemAccess< T >

\inmodule QtCore

The ItemAccess template provides a customization point to control how QRangeModel accesses role data of individual items.

Since
6.11

ItemAccess<T> is a struct template where T specifies the item type. Specialize this template for the type used in your data structure, and implement the relevant class member functions.

template <>
{
static Qt::ItemFlags flags(const ColorEntry &entry)
{
return entry.flags();
}
static QVariant readRole(const ColorEntry &entry, int role)
{
switch (role) {
// ...
}
return {};
}
static bool writeRole(ColorEntry &entry, const QVariant &value, int role)
{
bool ok = false;
switch (role) {
// ...
}
return ok;
}

\dots

};

A specialization of this type will take precedence over any predefined behavior, and over a corresponding specialization of \l{QRangeModel::}{RowOptions}.

Note
Do not specialize this template for types you do not own.

Definition at line 70 of file qrangemodel.h.


The documentation for this class was generated from the following file: