LeechCraft 0.6.70-16373-g319c272718
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
rolenamesmixin.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <utility>
12#include <QHash>
13
14namespace LC::Util
15{
29 template<typename Model>
30 class RoleNamesMixin : public Model
31 {
32 QHash<int, QByteArray> RoleNames_;
33 protected:
34 using Model::Model;
35
42 void setRoleNames (const QHash<int, QByteArray>& roleNames)
43 {
44 RoleNames_ = roleNames;
45 }
46
56 QHash<int, QByteArray> roleNames () const override
57 {
58 return RoleNames_;
59 }
60 };
61}
Wraps differences between role names handling in Qt4 and Qt5.
void setRoleNames(const QHash< int, QByteArray > &roleNames)
Sets the role names to roleNames.
QHash< int, QByteArray > roleNames() const override
Returns the role names.
@ Model
The human-readable name of the device model (QString).
Definition deviceroles.h:97