LeechCraft  0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
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 
14 namespace 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 }
void setRoleNames(const QHash< int, QByteArray > &roleNames)
Sets the role names to roleNames.
QHash< int, QByteArray > roleNames() const override
Returns the role names.
Provides Qt4-style role names setters.
The human-readable name of the device model (QString).
Definition: deviceroles.h:107