QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsrendererv2widget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsrendererv2widget.cpp
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 #include "qgsrendererv2widget.h"
16 #include "qgssymbolv2.h"
17 #include "qgsvectorlayer.h"
18 #include "qgscolordialog.h"
21 #include "qgsmapcanvas.h"
22 #include "qgspanelwidget.h"
23 
24 #include <QMessageBox>
25 #include <QInputDialog>
26 #include <QMenu>
27 
29  : QgsPanelWidget()
30  , mLayer( layer )
31  , mStyle( style )
32  , mMapCanvas( nullptr )
33 {
34  contextMenu = new QMenu( tr( "Renderer Options" ), this );
35 
36  mCopyAction = contextMenu->addAction( tr( "Copy" ), this, SLOT( copy() ) );
37  mCopyAction->setShortcut( QKeySequence( QKeySequence::Copy ) );
38  mPasteAction = contextMenu->addAction( tr( "Paste" ), this, SLOT( paste() ) );
39  mPasteAction->setShortcut( QKeySequence( QKeySequence::Paste ) );
40 
42  contextMenu->addAction( tr( "Change color" ), this, SLOT( changeSymbolColor() ) );
43  contextMenu->addAction( tr( "Change transparency" ), this, SLOT( changeSymbolTransparency() ) );
44  contextMenu->addAction( tr( "Change output unit" ), this, SLOT( changeSymbolUnit() ) );
45 
46  if ( mLayer && mLayer->geometryType() == QGis::Line )
47  {
48  contextMenu->addAction( tr( "Change width" ), this, SLOT( changeSymbolWidth() ) );
49  }
50  else if ( mLayer && mLayer->geometryType() == QGis::Point )
51  {
52  contextMenu->addAction( tr( "Change size" ), this, SLOT( changeSymbolSize() ) );
53  contextMenu->addAction( tr( "Change angle" ), this, SLOT( changeSymbolAngle() ) );
54  }
55 }
56 
58 {
60 }
61 
63 {
64  QList<QgsSymbolV2*> symbolList = selectedSymbols();
65  if ( symbolList.isEmpty() )
66  {
67  return;
68  }
69 
70  QgsSymbolV2* firstSymbol = nullptr;
71  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
72  {
73  if ( symbol )
74  {
75  firstSymbol = symbol;
76  break;
77  }
78  }
79  if ( !firstSymbol )
80  return;
81 
82  QColor color = QgsColorDialogV2::getColor( firstSymbol->color(), this, "Change Symbol Color", true );
83  if ( color.isValid() )
84  {
85  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
86  {
87  if ( symbol )
88  symbol->setColor( color );
89  }
91  }
92 }
93 
95 {
96  QList<QgsSymbolV2*> symbolList = selectedSymbols();
97  if ( symbolList.isEmpty() )
98  {
99  return;
100  }
101 
102  QgsSymbolV2* firstSymbol = nullptr;
103  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
104  {
105  if ( symbol )
106  {
107  firstSymbol = symbol;
108  break;
109  }
110  }
111  if ( !firstSymbol )
112  return;
113 
114  bool ok;
115  double oldTransparency = ( 1 - firstSymbol->alpha() ) * 100; // convert to percents
116  double transparency = QInputDialog::getDouble( this, tr( "Transparency" ), tr( "Change symbol transparency [%]" ), oldTransparency, 0.0, 100.0, 0, &ok );
117  if ( ok )
118  {
119  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
120  {
121  if ( symbol )
122  symbol->setAlpha( 1 - transparency / 100 );
123  }
125  }
126 }
127 
129 {
130  QList<QgsSymbolV2*> symbolList = selectedSymbols();
131  if ( symbolList.isEmpty() )
132  {
133  return;
134  }
135 
136  QgsSymbolV2* firstSymbol = nullptr;
137  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
138  {
139  if ( symbol )
140  {
141  firstSymbol = symbol;
142  break;
143  }
144  }
145  if ( !firstSymbol )
146  return;
147 
148  bool ok;
149  int currentUnit = ( firstSymbol->outputUnit() == QgsSymbolV2::MM ) ? 0 : 1;
150  QString item = QInputDialog::getItem( this, tr( "Symbol unit" ), tr( "Select symbol unit" ), QStringList() << tr( "Millimeter" ) << tr( "Map unit" ), currentUnit, false, &ok );
151  if ( ok )
152  {
153  QgsSymbolV2::OutputUnit unit = ( item.compare( tr( "Millimeter" ) ) == 0 ) ? QgsSymbolV2::MM : QgsSymbolV2::MapUnit;
154 
155  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
156  {
157  if ( symbol )
158  symbol->setOutputUnit( unit );
159  }
161  }
162 }
163 
165 {
166  QList<QgsSymbolV2*> symbolList = selectedSymbols();
167  if ( symbolList.isEmpty() )
168  {
169  return;
170  }
171 
172  QgsDataDefinedWidthDialog dlg( symbolList, mLayer );
173  dlg.setMapCanvas( mMapCanvas );
174 
175  if ( QDialog::Accepted == dlg.exec() )
176  {
177  if ( !dlg.mDDBtn->isActive() )
178  {
179  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
180  {
181  if ( !symbol )
182  continue;
183 
184  if ( symbol->type() == QgsSymbolV2::Line )
185  static_cast<QgsLineSymbolV2*>( symbol )->setWidth( dlg.mSpinBox->value() );
186  }
187  }
189  }
190 }
191 
193 {
194  QList<QgsSymbolV2*> symbolList = selectedSymbols();
195  if ( symbolList.isEmpty() )
196  {
197  return;
198  }
199 
200  QgsDataDefinedSizeDialog dlg( symbolList, mLayer );
201  dlg.setMapCanvas( mMapCanvas );
202 
203  if ( QDialog::Accepted == dlg.exec() )
204  {
205  if ( !dlg.mDDBtn->isActive() )
206  {
207  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
208  {
209  if ( !symbol )
210  continue;
211 
212  if ( symbol->type() == QgsSymbolV2::Marker )
213  static_cast<QgsMarkerSymbolV2*>( symbol )->setSize( dlg.mSpinBox->value() );
214  }
215  }
217  }
218 }
219 
221 {
222  QList<QgsSymbolV2*> symbolList = selectedSymbols();
223  if ( symbolList.isEmpty() )
224  {
225  return;
226  }
227 
228  QgsDataDefinedRotationDialog dlg( symbolList, mLayer );
229  dlg.setMapCanvas( mMapCanvas );
230 
231  if ( QDialog::Accepted == dlg.exec() )
232  {
233  if ( !dlg.mDDBtn->isActive() )
234  {
235  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
236  {
237  if ( !symbol )
238  continue;
239 
240  if ( symbol->type() == QgsSymbolV2::Marker )
241  static_cast<QgsMarkerSymbolV2*>( symbol )->setAngle( dlg.mSpinBox->value() );
242  }
243  }
245  }
246 }
247 
249 {
250  QgsLegendSymbolList symbols = r->legendSymbolItems();
251 
252  QgsSymbolLevelsV2Dialog dlg( symbols, r->usingSymbolLevels(), this );
253 
254  if ( dlg.exec() )
255  {
256  r->setUsingSymbolLevels( dlg.usingLevels() );
257  emit widgetChanged();
258  }
259 }
260 
262 {
263  mMapCanvas = canvas;
264 }
265 
267 {
268  return mMapCanvas;
269 }
270 
272 {
273  apply();
274 }
275 
276 
277 
279 
280 #include "qgsfield.h"
281 
282 QgsRendererV2DataDefinedMenus::QgsRendererV2DataDefinedMenus( QMenu* menu, QgsVectorLayer* layer, const QString& rotationField, const QString& sizeScaleField, QgsSymbolV2::ScaleMethod scaleMethod )
283  : QObject( menu )
284  , mLayer( layer )
285 {
286  mRotationMenu = new QMenu( tr( "Rotation field" ) );
287  mSizeScaleMenu = new QMenu( tr( "Size scale field" ) );
288 
292 
295 
297 
298  QAction* aScaleByArea = new QAction( tr( "Scale area" ), mSizeMethodActionGroup );
299  QAction* aScaleByDiameter = new QAction( tr( "Scale diameter" ), mSizeMethodActionGroup );
300 
301  aScaleByArea->setCheckable( true );
302  aScaleByDiameter->setCheckable( true );
303 
304  if ( scaleMethod == QgsSymbolV2::ScaleDiameter )
305  {
306  aScaleByDiameter->setChecked( true );
307  }
308  else
309  {
310  aScaleByArea->setChecked( true );
311  }
312 
314 
315  //@todo cleanup the class since Rotation and SizeScale are now
316  //defined using QgsDataDefinedButton
317  //
318  //menu->addMenu( mRotationMenu );
319  //menu->addMenu( mSizeScaleMenu );
320 
321  connect( mSizeMethodActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( scaleMethodSelected( QAction* ) ) );
322  connect( mRotationAttributeActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( rotationFieldSelected( QAction* ) ) );
323  connect( mSizeAttributeActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( sizeScaleFieldSelected( QAction* ) ) );
324 }
325 
327 {
328  delete mSizeMethodActionGroup;
331  delete mRotationMenu;
332  delete mSizeScaleMenu;
333 }
334 
335 void QgsRendererV2DataDefinedMenus::populateMenu( QMenu* menu, const QString& fieldName, QActionGroup *actionGroup )
336 {
337  QAction* aExpr = new QAction( tr( "- expression -" ), actionGroup );
338  aExpr->setCheckable( true );
339  menu->addAction( aExpr );
340  menu->addSeparator();
341  QAction* aNo = new QAction( tr( "- no field -" ), actionGroup );
342  aNo->setCheckable( true );
343  menu->addAction( aNo );
344  menu->addSeparator();
345 
346  bool hasField = false;
347  Q_FOREACH ( const QgsField& fld, mLayer->fields() )
348  {
349  if ( fld.type() == QVariant::Int || fld.type() == QVariant::Double )
350  {
351  QAction* a = new QAction( fld.name(), actionGroup );
352  a->setCheckable( true );
353  if ( fieldName == fld.name() )
354  {
355  a->setChecked( true );
356  hasField = true;
357  }
358  menu->addAction( a );
359  }
360  }
361 
362  if ( !hasField )
363  {
364  if ( fieldName.isEmpty() )
365  {
366  aNo->setChecked( true );
367  }
368  else
369  {
370  aExpr->setChecked( true );
371  aExpr->setText( tr( "- expression -" ) + fieldName );
372  }
373  }
374 
375 }
376 
378 {
379  if ( !a )
380  return;
381 
382  QString fldName = a->text();
383 #if 0
384  updateMenu( mRotationAttributeActionGroup, fldName );
385 #endif
386  if ( fldName == tr( "- no field -" ) )
387  {
388  fldName = QString();
389  }
390  else if ( fldName.startsWith( tr( "- expression -" ) ) )
391  {
392  QString expr( fldName );
393  expr.replace( 0, tr( "- expression -" ).length(), "" );
394  QgsExpressionBuilderDialog dialog( mLayer, expr );
395  if ( !dialog.exec() ) return;
396  fldName = dialog.expressionText();
397  Q_ASSERT( !QgsExpression( fldName ).hasParserError() );
398  a->setText( tr( "- expression -" ) + fldName );
399  }
400 
401  emit rotationFieldChanged( fldName );
402 }
403 
405 {
406  if ( !a )
407  return;
408 
409  QString fldName = a->text();
410 #if 0
411  updateMenu( mSizeAttributeActionGroup, fldName );
412 #endif
413  if ( fldName == tr( "- no field -" ) )
414  {
415  fldName = QString();
416  }
417  else if ( fldName.startsWith( tr( "- expression -" ) ) )
418  {
419  QString expr( fldName );
420  expr.replace( 0, tr( "- expression -" ).length(), "" );
421  QgsExpressionBuilderDialog dialog( mLayer, expr );
422  if ( !dialog.exec() ) return;
423  fldName = dialog.expressionText();
424  Q_ASSERT( !QgsExpression( fldName ).hasParserError() );
425  a->setText( tr( "- expression -" ) + fldName );
426  }
427 
428  emit sizeScaleFieldChanged( fldName );
429 }
430 
432 {
433  if ( !a )
434  return;
435 
436  if ( a->text() == tr( "Scale area" ) )
437  {
439  }
440  else if ( a->text() == tr( "Scale diameter" ) )
441  {
443  }
444 }
445 #if 0 // MK: is there any reason for this?
446 void QgsRendererV2DataDefinedMenus::updateMenu( QActionGroup* actionGroup, QString fieldName )
447 {
448  Q_FOREACH ( QAction* a, actionGroup->actions() )
449  {
450  a->setChecked( a->text() == fieldName );
451  }
452 }
453 #endif
454 
456  : mSymbolList( symbolList )
457  , mLayer( layer )
458  , mMapCanvas( nullptr )
459 {
460  setupUi( this );
461  setWindowFlags( Qt::WindowStaysOnTopHint );
462  mLabel->setText( label );
463  connect( mDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( dataDefinedChanged() ) );
464  connect( mDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( dataDefinedChanged() ) );
465 
466 }
467 
469 {
470  mMapCanvas = canvas;
471  Q_FOREACH ( QgsDataDefinedButton* ddButton, findChildren<QgsDataDefinedButton*>() )
472  {
473  if ( ddButton->assistant() )
474  ddButton->assistant()->setMapCanvas( mMapCanvas );
475  }
476 }
477 
479 {
480  return mMapCanvas;
481 }
482 
483 static QgsExpressionContext _getExpressionContext( const void* context )
484 {
485  const QgsDataDefinedValueDialog* widget = ( const QgsDataDefinedValueDialog* ) context;
486 
487  QgsExpressionContext expContext;
491  if ( widget->mapCanvas() )
492  {
495  }
496  else
497  {
499  }
500 
501  if ( widget->vectorLayer() )
502  expContext << QgsExpressionContextUtils::layerScope( widget->vectorLayer() );
503 
504  return expContext;
505 }
506 
507 void QgsDataDefinedValueDialog::init( const QString & description )
508 {
510  mDDBtn->init( mLayer, &dd, QgsDataDefinedButton::Double, description );
511  mDDBtn->registerGetExpressionContextCallback( &_getExpressionContext, this );
512 
513  QgsSymbolV2* initialSymbol = nullptr;
514  Q_FOREACH ( QgsSymbolV2* symbol, mSymbolList )
515  {
516  if ( symbol )
517  {
518  initialSymbol = symbol;
519  }
520  }
521  mSpinBox->setValue( initialSymbol ? value( initialSymbol ) : 0 );
522  mSpinBox->setEnabled( !mDDBtn->isActive() );
523 }
524 
526 {
527  if ( mSymbolList.isEmpty() || !mSymbolList.back() )
528  return QgsDataDefined();
529 
530  // check that all symbols share the same size expression
532  Q_FOREACH ( QgsSymbolV2 * it, mSymbolList )
533  {
534  if ( !it || symbolDataDefined( it ) != dd )
535  return QgsDataDefined();
536  }
537  return dd;
538 }
539 
541 {
542  QgsDataDefined dd = mDDBtn->currentDataDefined();
543  mSpinBox->setEnabled( !dd.isActive() );
544 
545  if ( // shall we remove datadefined expressions for layers ?
546  ( symbolDataDefined().isActive() && !dd.isActive() )
547  // shall we set the "en masse" expression for properties ?
548  || dd.isActive() )
549  {
550  Q_FOREACH ( QgsSymbolV2 * it, mSymbolList )
551  setDataDefined( it, dd );
552  }
553 }
554 
556 {
557  const QgsMarkerSymbolV2* marker = static_cast<const QgsMarkerSymbolV2*>( symbol );
558  return marker->dataDefinedSize();
559 }
560 
562 {
563  static_cast<QgsMarkerSymbolV2*>( symbol )->setDataDefinedSize( dd );
564  static_cast<QgsMarkerSymbolV2*>( symbol )->setScaleMethod( QgsSymbolV2::ScaleDiameter );
565 }
566 
567 
569 {
570  const QgsMarkerSymbolV2* marker = static_cast<const QgsMarkerSymbolV2*>( symbol );
571  return marker->dataDefinedAngle();
572 }
573 
575 {
576  static_cast<QgsMarkerSymbolV2*>( symbol )->setDataDefinedAngle( dd );
577 }
578 
579 
581 {
582  const QgsLineSymbolV2* line = static_cast<const QgsLineSymbolV2*>( symbol );
583  return line->dataDefinedWidth();
584 }
585 
587 {
588  static_cast<QgsLineSymbolV2*>( symbol )->setDataDefinedWidth( dd );
589 }
590 
591 void QgsRendererV2Widget::apply()
592 {
593 
594 }
QgsDataDefined dataDefinedAngle() const
Returns data defined angle for whole symbol (including all symbol layers).
double value(const QgsSymbolV2 *symbol) const override
void setText(const QString &text)
Class for parsing and evaluation of expressions (formerly called "search strings").
void showSymbolLevelsDialog(QgsFeatureRendererV2 *r)
show a dialog with renderer&#39;s symbol level settings
void sizeScaleFieldChanged(const QString &fldName)
const QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
virtual QList< QgsSymbolV2 * > selectedSymbols()
Subclasses may provide the capability of changing multiple symbols at once by implementing the follow...
void setupUi(QWidget *widget)
OutputUnit
The unit of the output.
Definition: qgssymbolv2.h:65
void changeSymbolTransparency()
Change opacity of selected symbols.
A container class for data source field mapping or expression.
QString getItem(QWidget *parent, const QString &title, const QString &label, const QStringList &items, int current, bool editable, bool *ok, QFlags< Qt::WindowType > flags, QFlags< Qt::InputMethodHint > inputMethodHints)
QString name
Definition: qgsfield.h:52
void init(const QString &description)
void changeSymbolSize()
Change marker sizes of selected symbols.
static QgsExpressionContextScope * atlasScope(const QgsAtlasComposition *atlas)
Creates a new scope which contains variables and functions relating to a QgsAtlasComposition.
void addActions(QList< QAction * > actions)
void setDataDefined(QgsSymbolV2 *symbol, const QgsDataDefined &dd) override
void setChecked(bool)
void setDataDefined(QgsSymbolV2 *symbol, const QgsDataDefined &dd) override
Calculate scale by the diameter.
Definition: qgssymbolv2.h:93
void addAction(QAction *action)
QgsMapCanvas * mMapCanvas
Q_DECL_DEPRECATED QgsRendererV2DataDefinedMenus(QMenu *menu, QgsVectorLayer *layer, const QString &rotationField, const QString &sizeScaleField, QgsSymbolV2::ScaleMethod scaleMethod)
int exec()
SymbolType type() const
Definition: qgssymbolv2.h:107
Line symbol.
Definition: qgssymbolv2.h:82
Base class for any widget that can be shown as a inline panel.
void changeSymbolWidth()
Change line widths of selected symbols.
void populateMenu(QMenu *menu, const QString &fieldName, QActionGroup *actionGroup)
QString tr(const char *sourceText, const char *disambiguation, int n)
Map canvas is a class for displaying all GIS data types on a canvas.
Definition: qgsmapcanvas.h:109
double value(const QgsSymbolV2 *symbol) const override
Marker symbol.
Definition: qgssymbolv2.h:81
QgsFields fields() const
Returns the list of fields of this layer.
The QgsMapSettings class contains configuration for rendering of the map.
void changeSymbolAngle()
Change marker angles of selected symbols.
void setColor(const QColor &color)
QgsDataDefined dataDefinedWidth() const
Returns data defined size for whole symbol (including all symbol layers).
Utility classes for "en masse" size definition.
The output shall be in millimeters.
Definition: qgssymbolv2.h:67
QgsVectorLayer * mLayer
static QgsExpressionContextScope * globalScope()
Creates a new scope which contains variables and functions relating to the global QGIS context...
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, const QString &rule="")
return a list of item text / symbol
void changeSymbolUnit()
Change units mm/map units of selected symbols.
const QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
QgsDataDefinedValueDialog(const QList< QgsSymbolV2 *> &symbolList, QgsVectorLayer *layer, const QString &label)
Constructor.
bool isEmpty() const
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the dialog.
bool isEmpty() const
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
The output shall be in map unitx.
Definition: qgssymbolv2.h:68
void changeSymbolColor()
Change color of selected symbols.
QGis::GeometryType geometryType() const
Returns point, line or polygon.
double getDouble(QWidget *parent, const QString &title, const QString &label, double value, double min, double max, int decimals, bool *ok, QFlags< Qt::WindowType > flags)
double value(const QgsSymbolV2 *symbol) const override
QAction * addSeparator()
bool usingSymbolLevels() const
Encapsulate a field in an attribute table or data source.
Definition: qgsfield.h:44
void applyChanges()
This method should be called whenever the renderer is actually set on the layer.
QgsDataDefinedAssistant * assistant()
Returns the assistant used to defined the data defined object properties, if set. ...
Single scope for storing variables and functions for use within a QgsExpressionContext.
QAction * exec()
qreal alpha() const
Get alpha transparency 1 for opaque, 0 for invisible.
Definition: qgssymbolv2.h:204
void scaleMethodChanged(QgsSymbolV2::ScaleMethod scaleMethod)
virtual double value(const QgsSymbolV2 *) const =0
A button for defining data source field mappings or expressions.
void widgetChanged()
Emitted when the widget state changes.
QgsRendererV2Widget(QgsVectorLayer *layer, QgsStyleV2 *style)
void setShortcut(const QKeySequence &shortcut)
void setDataDefined(QgsSymbolV2 *symbol, const QgsDataDefined &dd) override
void setCheckable(bool)
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
void contextMenuViewCategories(QPoint p)
QgsSymbolV2::OutputUnit outputUnit() const
void setUsingSymbolLevels(bool usingSymbolLevels)
QString & replace(int position, int n, QChar after)
QList< QgsSymbolV2 * > mSymbolList
void setWindowFlags(QFlags< Qt::WindowType > type)
QList< QAction * > actions() const
static QColor getColor(const QColor &initialColor, QWidget *parent, const QString &title=QString(), const bool allowAlpha=false)
Return a color selection from a color dialog.
const QgsVectorLayer * vectorLayer() const
Returns the vector layer associated with the widget.
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object...
QgsExpressionContextScope & expressionContextScope()
Returns a reference to the expression context scope for the map canvas.
Definition: qgsmapcanvas.h:455
QPoint pos()
ScaleMethod
Scale method.
Definition: qgssymbolv2.h:90
QgsDataDefined dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
virtual void setDataDefined(QgsSymbolV2 *symbol, const QgsDataDefined &dd)=0
QColor color() const
Calculate scale by the area.
Definition: qgssymbolv2.h:92
static QgsExpressionContextScope * projectScope()
Creates a new scope which contains variables and functions relating to the current QGIS project...
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
QgsDataDefined symbolDataDefined() const
virtual void refreshSymbolView()
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Represents a vector layer which manages a vector based data sets.
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.
Definition: qgsfield.cpp:97
int compare(const QString &other) const
void setOutputUnit(QgsSymbolV2::OutputUnit u)
bool isActive() const
T & back()
void setAlpha(qreal alpha)
Set alpha transparency 1 for opaque, 0 for invisible.
Definition: qgssymbolv2.h:206
A generic dialog for building expression strings.
virtual void setMapCanvas(QgsMapCanvas *canvas)
Sets the map canvas associated with the widget.
static QgsExpressionContext _getExpressionContext(const void *context)
bool isValid() const
void rotationFieldChanged(const QString &fldName)