swift
actionhotkeylistmodel.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (C) 2013 swift Project Community / Contributors
2 // SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-swift-pilot-client-1
3 
5 
6 #ifndef SWIFT_GUI_MODELS_ACTIONHOTKEYLISTMODEL_H
7 #define SWIFT_GUI_MODELS_ACTIONHOTKEYLISTMODEL_H
8 
9 #include <QAbstractTableModel>
10 #include <QObject>
11 #include <QVariant>
12 #include <Qt>
13 
14 #include "gui/swiftguiexport.h"
16 
17 class QModelIndex;
18 
19 namespace swift::gui::models
20 {
22  class SWIFT_GUI_EXPORT CActionHotkeyListModel : public QAbstractTableModel
23  {
24  Q_OBJECT
25 
26  public:
28  enum ItemRole
29  {
30  ActionHotkeyRole = Qt::UserRole
31  };
32 
34  CActionHotkeyListModel(QObject *parent = nullptr);
35 
37  virtual ~CActionHotkeyListModel() override {}
38 
40  int rowCount(const QModelIndex &parent = QModelIndex()) const override;
41 
43  int columnCount(const QModelIndex &parent = QModelIndex()) const override;
44 
46  QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
47 
49  bool setData(const QModelIndex &index, const QVariant &var, int role) override;
50 
52  QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
53 
55  bool insertRows(int position, int rows, const QModelIndex &index) override;
56 
58  bool removeRows(int position, int rows, const QModelIndex &index) override;
59 
61  void clear();
62 
63  private:
65  };
66 } // namespace swift::gui::models
67 
68 #endif // SWIFT_GUI_MODELS_ACTIONHOTKEYLISTMODEL_H
Value object encapsulating a list of hotkeys.
Models to be used with views, mainly QTableView.
#define SWIFT_GUI_EXPORT
Export a class or function from the library.