Object Detection  5.0
Image Processing Using Qt and Opencv
circledetectorpluginmodel.h
1 #ifndef CIRCLEDETECTORPLUGINMODEL_H
2 #define CIRCLEDETECTORPLUGINMODEL_H
3 
4 #include <QAbstractTableModel>
5 #include <QDir>
6 #include <QObject>
7 #include <memory>
8 #include <imageprocessorpluginiface.h>
9 #include "circledetectorpluginmodel_global.h"
10 Q_DECLARE_METATYPE(PluginSharedPointer)
11 
12 CIRCLE_MODEL_BEGIN_NAMESPACE
13 
14 class CIRCLE_MODEL_LIB CircleDetectorPluginModel : public QAbstractTableModel
15 {
16  Q_OBJECT
17 private:
18  class _CircleDetectorPluginModelImpl;
19  friend class _CircleDetectorPluginModelImpl;
20  std::unique_ptr<_CircleDetectorPluginModelImpl> _pimpl;
21 
22 public:
23  CircleDetectorPluginModel(QString path = QDir::currentPath(), QObject *parent = nullptr);
24  enum Type{
25  FILTER = Qt::UserRole + 1,
26  FILTER_NAME,
27  FILTER_DESCRIPTION,
28  FILTER_AUTHOR,
29  FILTER_PATH
30 
31  };
32  Q_ENUM(Type)
33  void loadPlugins();
34  // QAbstractItemModel interface
35  virtual ~CircleDetectorPluginModel();
36  virtual int rowCount(const QModelIndex &parent) const override;
37  virtual int columnCount(const QModelIndex &parent) const override;
38  virtual QVariant data(const QModelIndex &index, int role) const override;
39  QString pluginPath() const;
40  void setPluginPath(const QString &pluginPath);
41  QList<QString> pluginPaths() const;
42  PluginSharedPointerList filters() const;
43  void setFilters(const PluginSharedPointerList &filters);
44 
45 };
46 CIRCLE_MODEL_END_NAMESPACE
47 #endif // CIRCLEDETECTORPLUGINMODEL_H