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 = QString( "" ) );
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 doubleXYDesc();
182 static QString double180RotDesc();
183 static QString intTranspDesc();
184 static QString unitsMmMuDesc();
185 static QString unitsMmMuPercentDesc();
186 static QString colorNoAlphaDesc();
187 static QString colorAlphaDesc();
188 static QString textHorzAlignDesc();
189 static QString textVertAlignDesc();
190 static QString penJoinStyleDesc();
191 static QString blendModesDesc();
192 static QString svgPathDesc();
193 static QString paperSizeDesc();
194 static QString paperOrientationDesc();
200 void setActive(
bool active );
205 void disableEnabledWidgets(
bool disable );
210 void checkCheckedWidgets(
bool check );
217 void dataDefinedChanged(
const QString& definition );
223 void dataDefinedActivated(
bool active );
226 void mouseReleaseEvent( QMouseEvent *event );
236 void setExpression( QString exp ) { mProperty.insert(
"expression", exp ); }
241 void setField( QString field ) { mProperty.insert(
"field", field ); }
244 void showDescriptionDialog();
245 void showExpressionDialog();
250 QStringList mFieldNameList;
251 QStringList mFieldTypeList;
252 QMap< QString, QString > mProperty;
253 QList< QPointer<QWidget> > mEnabledWidgets;
254 QList< QPointer<QWidget> > mCheckedWidgets;
257 QAction* mActionDataTypes;
260 QAction* mActionActive;
261 QAction* mActionDescription;
262 QAction* mActionExpDialog;
263 QAction* mActionExpression;
264 QAction* mActionPasteExpr;
265 QAction* mActionCopyExpr;
266 QAction* mActionClearExpr;
268 DataTypes mDataTypes;
269 QString mDataTypesString;
270 QString mInputDescription;
271 QString mFullDescription;
273 QString mCurrentDefinition;
275 static QIcon mIconDataDefine;
276 static QIcon mIconDataDefineOn;
277 static QIcon mIconDataDefineError;
278 static QIcon mIconDataDefineExpression;
279 static QIcon mIconDataDefineExpressionOn;
280 static QIcon mIconDataDefineExpressionError;
283 void aboutToShowMenu();
284 void menuActionTriggered( QAction* action );
287 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsDataDefinedButton::DataTypes )
290 #endif // QGSDATADEFINEDBUTTON_H