![]() |
LeechCraft
0.6.70-13729-g7046a9d2a7
Modular cross-platform feature rich live environment.
|
Wraps differences between role names handling in Qt4 and Qt5. More...
#include "rolenamesmixin.h"
Protected Member Functions | |
RoleNamesMixin ()=default | |
Default constructor. More... | |
template<typename... Args> | |
RoleNamesMixin (Args &&... args) | |
Constructs the base Model type with the given args. More... | |
void | setRoleNames (const QHash< int, QByteArray > &roleNames) |
Sets the role names to roleNames. More... | |
QHash< int, QByteArray > | roleNames () const override |
Returns the role names. More... | |
Wraps differences between role names handling in Qt4 and Qt5.
Qt4 uses QAbstractItemModel::setRoleNames() to set role names for a (non-virtual) QAbstractItemModel::roleNames() method. Qt5, on the other hand, just suggests overriding the (virtual) roleNames() method. This class provides an uniform interface. This class provides an uniform interface for role names setting.
Model | The original model type to derive from. |
Definition at line 53 of file rolenamesmixin.h.
|
protecteddefault |
Default constructor.
Assumes the existence of a default constructor in the Model type.
|
inlineprotected |
Constructs the base Model type with the given args.
Args | The arguments of the values to pass to the Model constructor. |
[in] | args | The values to pass to the Model constructor. |
Definition at line 73 of file rolenamesmixin.h.
|
inlineoverrideprotected |
Returns the role names.
Returns the mapping from the role value to its name that was previously set via setRoleNames().
Definition at line 98 of file rolenamesmixin.h.
Referenced by LC::Util::RoleNamesMixin< QStandardItemModel >::setRoleNames().
|
inlineprotected |
Sets the role names to roleNames.
[in] | roleNames | The mapping from role value to its name. |
Definition at line 84 of file rolenamesmixin.h.