struct DefaultRoleNames : public QHash<int, QByteArray>
{
DefaultRoleNames() {
- (*this)[Qt::DisplayRole] = "display";
- (*this)[Qt::DecorationRole] = "decoration";
- (*this)[Qt::EditRole] = "edit";
- (*this)[Qt::ToolTipRole] = "toolTip";
- (*this)[Qt::StatusTipRole] = "statusTip";
- (*this)[Qt::WhatsThisRole] = "whatsThis";
+ insert(Qt::DisplayRole, "display");
+ insert(Qt::DecorationRole, "decoration");
+ insert(Qt::EditRole, "edit");
+ insert(Qt::ToolTipRole, "toolTip");
+ insert(Qt::StatusTipRole, "statusTip");
+ insert(Qt::WhatsThisRole, "whatsThis");
}
};
-Q_GLOBAL_STATIC(DefaultRoleNames, qDefaultRoleNames)
-
const QHash<int,QByteArray> &QAbstractItemModelPrivate::defaultRoleNames()
{
- return *qDefaultRoleNames();
+ static const DefaultRoleNames qDefaultRoleNames;
+ return qDefaultRoleNames;
}