My Project
ValueSliderValuesInterface.h
1 /*
2  * Copyright (C) 2015 Canonical, Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 3.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef UNITY_SHELL_SCOPES_VALUESLIDERVALUESINTERFACE_H
18 #define UNITY_SHELL_SCOPES_VALUESLIDERVALUESINTERFACE_H
19 
20 #include <unity/SymbolExport.h>
21 #include <QAbstractListModel>
22 
23 namespace unity
24 {
25 namespace shell
26 {
27 namespace scopes
28 {
29 
30 class UNITY_API ValueSliderValuesInterface : public QAbstractListModel
31 {
32  Q_OBJECT
33 
34  Q_ENUMS(SliderValueRoles)
35 
36 public:
37  enum Roles {
38  RoleValue = Qt::UserRole + 1,
39  RoleLabel
40  };
41 
42  QHash<int, QByteArray> roleNames() const override
43  {
44  QHash<int, QByteArray> roles;
45  roles[RoleValue] = "value";
46  roles[RoleLabel] = "label";
47  return roles;
48  }
49 
50 protected:
52  explicit ValueSliderValuesInterface(QObject* parent = 0) : QAbstractListModel(parent) {}
54 };
55 
56 }
57 }
58 }
59 
61 
62 #endif
Definition: ValueSliderValuesInterface.h:30
Top-level namespace for all things Unity-related.
Definition: Version.h:37