LeechCraft 0.6.70-17609-g3dde4097dd
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{
28 template<typename Model>
29 class RoleNamesMixin : public Model
30 {
31 QHash<int, QByteArray> RoleNames_;
32 protected:
33 using Model::Model;
34
41 void setRoleNames (const QHash<int, QByteArray>& roleNames)
42 {
43 RoleNames_ = roleNames;
44 }
45
55 QHash<int, QByteArray> roleNames () const override
56 {
57 return RoleNames_;
58 }
59 };
60}
Provides Qt4-style role names setters.
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