Chatterino
CommandModel.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <QObject>
4 
7 
8 namespace chatterino {
9 
10 class CommandController;
11 
12 class CommandModel : public SignalVectorModel<Command>
13 {
14  explicit CommandModel(QObject *parent);
15 
16  enum Column {
17  Trigger = 0,
18  CommandFunc = 1,
19  ShowInMessageContextMenu = 2,
20  COUNT,
21  };
22 
23 protected:
24  // turn a vector item into a model row
25  virtual Command getItemFromRow(std::vector<QStandardItem *> &row,
26  const Command &command) override;
27 
28  // turns a row in the model into a vector item
29  virtual void getRowFromItem(const Command &item,
30  std::vector<QStandardItem *> &row) override;
31 
32  friend class CommandController;
33 };
34 
35 } // namespace chatterino
Definition: Command.hpp:10
Definition: Application.cpp:48
Definition: CommandController.hpp:26
virtual void getRowFromItem(const Command &item, std::vector< QStandardItem *> &row) override
Definition: CommandModel.cpp:25
Definition: SignalVectorModel.hpp:15
Definition: CommandModel.hpp:12
virtual Command getItemFromRow(std::vector< QStandardItem *> &row, const Command &command) override
Definition: CommandModel.cpp:14