10 #include <QtWidgets/QWidget>
11 #include <QtGui/QValidator>
12 #include <QtCore/QVariant>
14 #include <QtDesigner/QExtensionFactory>
15 #include <QtDesigner/QDesignerTaskMenuExtension>
34 TableItem() : key(0), value(0), validator(0), removeButton(0) {};
35 TableItem(
const TableItem& orig) : key(orig.key), value(orig.value), validator(orig.validator), removeButton(orig.removeButton) {};
50 virtual void setLabel(
const std::string&);
53 virtual void setDefaultValue(
const std::string&);
56 virtual void setLabel(
const QString&);
58 virtual QString label()
const;
62 virtual void removeItem(
int);
65 virtual void onAddItem() = 0;
66 virtual void onRemoveItem();
69 virtual int currentRowFor(
QObject* sender)
const;
75 virtual QWidget* createKey(
const DtString&);
76 virtual QWidget* createValue();
88 typedef std::vector<TableItem>
Table;
97 Q_PROPERTY(
int rangeTop READ rangeTop WRITE setRangeTop)
98 Q_PROPERTY(
int rangeBottom READ rangeBottom WRITE setRangeBottom)
106 virtual
void setRange(
double bottom,
double top);
109 virtual
DtReaderWriter* createBoundVariable(const std::
string& variableName);
112 virtual
void setupFromBoundVariable(const
DtReaderWriter* variableName);
116 static makVrv::DtUnicode codeVariableType()
121 static std::string designerGroup()
123 return tr(
"VR-Forces Data Entry").toUtf8().constData();
126 static std::string headerFile()
128 return tr(
"<vrfGuiCoreQt/simpleMapVariableWidgets.h>").toUtf8().constData();
131 static std::string variableName()
133 return tr(
"integerMapValue").toUtf8().constData();
136 virtual void addItem(
const DtString&,
int);
137 virtual void onAddItem();
147 Q_PROPERTY(qreal rangeTop READ rangeTop WRITE setRangeTop)
148 Q_PROPERTY(qreal rangeBottom READ rangeBottom WRITE setRangeBottom)
156 virtual
void setRange(
double bottom,
double top);
159 virtual
DtReaderWriter* createBoundVariable(const std::
string& variableName);
162 virtual
void setupFromBoundVariable(const
DtReaderWriter* variableName);
166 static makVrv::DtUnicode codeVariableType()
171 static std::string designerGroup()
173 return tr(
"VR-Forces Data Entry").toUtf8().constData();
176 static std::string headerFile()
178 return tr(
"<vrfGuiCoreQt/simpleMapVariableWidgets.h>").toUtf8().constData();
181 static std::string variableName()
183 return tr(
"doubleMapValue").toUtf8().constData();
186 virtual void addItem(
const DtString&,
double);
187 virtual void onAddItem();
204 virtual void setRange(
double bottom,
double top);
207 virtual DtReaderWriter* createBoundVariable(
const std::string& variableName);
210 virtual void setupFromBoundVariable(
const DtReaderWriter* variableName);
217 static std::string designerGroup()
219 return tr(
"VR-Forces Data Entry").toUtf8().constData();
222 static std::string headerFile()
224 return tr(
"<vrfGuiCoreQt/simpleMapVariableWidgets.h>").toUtf8().constData();
227 static std::string variableName()
229 return tr(
"stringMapValue").toUtf8().constData();
235 virtual void onAddItem();