QCAD
Open Source 2D CAD
RPluginInfo.h
Go to the documentation of this file.
1 
20 #ifndef RPLUGININFO_H
21 #define RPLUGININFO_H
22 
23 #include "core_global.h"
24 
25 #include <QMap>
26 #include <QString>
27 #include <QStringList>
28 #include <QMetaType>
29 #include <QVariant>
30 
31 #ifndef RDEFAULT_QVARIANT
32 #define RDEFAULT_QVARIANT QVariant()
33 #endif
34 
43 public:
45  map.insert("QtVersion", qVersion());
46  }
47 
48  void set(const QString& key, const QVariant& value) {
49  map.insert(key, value);
50  }
51 
52  QVariant get(const QString& key, const QVariant& def = RDEFAULT_QVARIANT) const {
53  if (map.contains(key)) {
54  return map.value(key);
55  }
56  return def;
57  }
58 
59  QStringList getKeys() const {
60  return map.keys();
61  }
62 
63 private:
64  QVariantMap map;
65 };
66 
69 
70 #endif
RPluginInfo()
Definition: RPluginInfo.h:44
Information about a plugin.
Definition: RPluginInfo.h:42
#define RDEFAULT_QVARIANT
Copyright (c) 2011-2017 by Andrew Mustun.
Definition: RPluginInfo.h:32
#define QCADCORE_EXPORT
Definition: core_global.h:10
QVariantMap map
Definition: RPluginInfo.h:64
Q_DECLARE_METATYPE(RMath *)
void set(const QString &key, const QVariant &value)
Definition: RPluginInfo.h:48
QStringList getKeys() const
Definition: RPluginInfo.h:59