15 #ifndef QGSDATADEFINEDBUTTON_H
16 #define QGSDATADEFINEDBUTTON_H
24 #include <QToolButton>
36 Q_PROPERTY( QString usageInfo READ usageInfo WRITE setUsageInfo )
44 AnyType = String | Int | Double
46 Q_DECLARE_FLAGS( DataTypes, DataType )
60 DataTypes datatypes = AnyType,
61 QString description = "" );
74 DataTypes datatypes = AnyType,
75 QString description = QString( "" ) );
77 QMap< QString, QString > definedProperty()
const {
return mProperty; }
82 bool isActive() {
return mProperty.value(
"active" ).toInt(); }
92 QString
getExpression()
const {
return mProperty.value(
"expression" ); }
97 QString
getField()
const {
return mProperty.value(
"field" ); }
124 void setUsageInfo(
const QString& info ) { mUsageInfo = info; updateGui(); }
129 void registerEnabledWidgets( QList<QWidget*> wdgts );
134 void registerEnabledWidget( QWidget* wdgt );
141 QList<QWidget*> registeredEnabledWidgets();
151 void registerCheckedWidgets( QList<QWidget*> wdgts );
156 void registerCheckedWidget( QWidget* wdgt );
163 QList<QWidget*> registeredCheckedWidgets();
173 static QString trString();
174 static QString boolDesc();
175 static QString anyStringDesc();
176 static QString intDesc();
177 static QString intPosDesc();
178 static QString intPosOneDesc();
179 static QString doubleDesc();
180 static QString doublePosDesc();
181 static QString double0to1Desc();
182 static QString doubleXYDesc();
183 static QString double180RotDesc();
184 static QString intTranspDesc();
185 static QString unitsMmMuDesc();
186 static QString unitsMmMuPercentDesc();
187 static QString colorNoAlphaDesc();
188 static QString colorAlphaDesc();
189 static QString textHorzAlignDesc();
190 static QString textVertAlignDesc();
191 static QString penJoinStyleDesc();
192 static QString blendModesDesc();
193 static QString svgPathDesc();
194 static QString filePathDesc();
195 static QString paperSizeDesc();
196 static QString paperOrientationDesc();
197 static QString horizontalAnchorDesc();
198 static QString verticalAnchorDesc();
199 static QString gradientTypeDesc();
200 static QString gradientCoordModeDesc();
201 static QString gradientSpreadDesc();
202 static QString lineStyleDesc();
203 static QString capStyleDesc();
204 static QString fillStyleDesc();
205 static QString markerStyleDesc();
206 static QString customDashDesc();
212 void setActive(
bool active );
217 void disableEnabledWidgets(
bool disable );
222 void checkCheckedWidgets(
bool check );
229 void dataDefinedChanged(
const QString& definition );
235 void dataDefinedActivated(
bool active );
238 void mouseReleaseEvent( QMouseEvent *event )
override;
248 void setExpression( QString exp ) { mProperty.insert(
"expression", exp ); }
253 void setField( QString field ) { mProperty.insert(
"field", field ); }
256 void showDescriptionDialog();
257 void showExpressionDialog();
262 QStringList mFieldNameList;
263 QStringList mFieldTypeList;
264 QMap< QString, QString > mProperty;
265 QList< QPointer<QWidget> > mEnabledWidgets;
266 QList< QPointer<QWidget> > mCheckedWidgets;
269 QAction* mActionDataTypes;
272 QAction* mActionActive;
273 QAction* mActionDescription;
274 QAction* mActionExpDialog;
275 QAction* mActionExpression;
276 QAction* mActionPasteExpr;
277 QAction* mActionCopyExpr;
278 QAction* mActionClearExpr;
280 DataTypes mDataTypes;
281 QString mDataTypesString;
282 QString mInputDescription;
283 QString mFullDescription;
285 QString mCurrentDefinition;
287 static QIcon mIconDataDefine;
288 static QIcon mIconDataDefineOn;
289 static QIcon mIconDataDefineError;
290 static QIcon mIconDataDefineExpression;
291 static QIcon mIconDataDefineExpressionOn;
292 static QIcon mIconDataDefineExpressionError;
295 void aboutToShowMenu();
296 void menuActionTriggered( QAction* action );
299 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsDataDefinedButton::DataTypes )
302 #endif // QGSDATADEFINEDBUTTON_H