QGIS API Documentation  2.14.0-Essen
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 
23 #include <QMessageBox>
24 #include <QInputDialog>
25 #include <QMenu>
26 
28  : QWidget()
29  , mLayer( layer )
30  , mStyle( style )
31  , mMapCanvas( nullptr )
32 {
33  contextMenu = new QMenu( tr( "Renderer Options" ), this );
34 
35  mCopyAction = contextMenu->addAction( tr( "Copy" ), this, SLOT( copy() ) );
36  mCopyAction->setShortcut( QKeySequence( QKeySequence::Copy ) );
37  mPasteAction = contextMenu->addAction( tr( "Paste" ), this, SLOT( paste() ) );
38  mPasteAction->setShortcut( QKeySequence( QKeySequence::Paste ) );
39 
41  contextMenu->addAction( tr( "Change color" ), this, SLOT( changeSymbolColor() ) );
42  contextMenu->addAction( tr( "Change transparency" ), this, SLOT( changeSymbolTransparency() ) );
43  contextMenu->addAction( tr( "Change output unit" ), this, SLOT( changeSymbolUnit() ) );
44 
45  if ( mLayer && mLayer->geometryType() == QGis::Line )
46  {
47  contextMenu->addAction( tr( "Change width" ), this, SLOT( changeSymbolWidth() ) );
48  }
49  else if ( mLayer && mLayer->geometryType() == QGis::Point )
50  {
51  contextMenu->addAction( tr( "Change size" ), this, SLOT( changeSymbolSize() ) );
52  contextMenu->addAction( tr( "Change angle" ), this, SLOT( changeSymbolAngle() ) );
53  }
54 }
55 
57 {
59 }
60 
62 {
63  QList<QgsSymbolV2*> symbolList = selectedSymbols();
64  if ( symbolList.isEmpty() )
65  {
66  return;
67  }
68 
69  QgsSymbolV2* firstSymbol = nullptr;
70  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
71  {
72  if ( symbol )
73  {
74  firstSymbol = symbol;
75  break;
76  }
77  }
78  if ( !firstSymbol )
79  return;
80 
81  QColor color = QgsColorDialogV2::getColor( firstSymbol->color(), this, "Change Symbol Color", true );
82  if ( color.isValid() )
83  {
84  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
85  {
86  if ( symbol )
87  symbol->setColor( color );
88  }
90  }
91 }
92 
94 {
95  QList<QgsSymbolV2*> symbolList = selectedSymbols();
96  if ( symbolList.isEmpty() )
97  {
98  return;
99  }
100 
101  QgsSymbolV2* firstSymbol = nullptr;
102  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
103  {
104  if ( symbol )
105  {
106  firstSymbol = symbol;
107  break;
108  }
109  }
110  if ( !firstSymbol )
111  return;
112 
113  bool ok;
114  double oldTransparency = ( 1 - firstSymbol->alpha() ) * 100; // convert to percents
115  double transparency = QInputDialog::getDouble( this, tr( "Transparency" ), tr( "Change symbol transparency [%]" ), oldTransparency, 0.0, 100.0, 0, &ok );
116  if ( ok )
117  {
118  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
119  {
120  if ( symbol )
121  symbol->setAlpha( 1 - transparency / 100 );
122  }
124  }
125 }
126 
128 {
129  QList<QgsSymbolV2*> symbolList = selectedSymbols();
130  if ( symbolList.isEmpty() )
131  {
132  return;
133  }
134 
135  QgsSymbolV2* firstSymbol = nullptr;
136  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
137  {
138  if ( symbol )
139  {
140  firstSymbol = symbol;
141  break;
142  }
143  }
144  if ( !firstSymbol )
145  return;
146 
147  bool ok;
148  int currentUnit = ( firstSymbol->outputUnit() == QgsSymbolV2::MM ) ? 0 : 1;
149  QString item = QInputDialog::getItem( this, tr( "Symbol unit" ), tr( "Select symbol unit" ), QStringList() << tr( "Millimeter" ) << tr( "Map unit" ), currentUnit, false, &ok );
150  if ( ok )
151  {
152  QgsSymbolV2::OutputUnit unit = ( item.compare( tr( "Millimeter" ) ) == 0 ) ? QgsSymbolV2::MM : QgsSymbolV2::MapUnit;
153 
154  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
155  {
156  if ( symbol )
157  symbol->setOutputUnit( unit );
158  }
160  }
161 }
162 
164 {
165  QList<QgsSymbolV2*> symbolList = selectedSymbols();
166  if ( symbolList.isEmpty() )
167  {
168  return;
169  }
170 
171  QgsDataDefinedWidthDialog dlg( symbolList, mLayer );
172  dlg.setMapCanvas( mMapCanvas );
173 
174  if ( QDialog::Accepted == dlg.exec() )
175  {
176  if ( !dlg.mDDBtn->isActive() )
177  {
178  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
179  {
180  if ( !symbol )
181  continue;
182 
183  if ( symbol->type() == QgsSymbolV2::Line )
184  static_cast<QgsLineSymbolV2*>( symbol )->setWidth( dlg.mSpinBox->value() );
185  }
186  }
188  }
189 }
190 
192 {
193  QList<QgsSymbolV2*> symbolList = selectedSymbols();
194  if ( symbolList.isEmpty() )
195  {
196  return;
197  }
198 
199  QgsDataDefinedSizeDialog dlg( symbolList, mLayer );
200  dlg.setMapCanvas( mMapCanvas );
201 
202  if ( QDialog::Accepted == dlg.exec() )
203  {
204  if ( !dlg.mDDBtn->isActive() )
205  {
206  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
207  {
208  if ( !symbol )
209  continue;
210 
211  if ( symbol->type() == QgsSymbolV2::Marker )
212  static_cast<QgsMarkerSymbolV2*>( symbol )->setSize( dlg.mSpinBox->value() );
213  }
214  }
216  }
217 }
218 
220 {
221  QList<QgsSymbolV2*> symbolList = selectedSymbols();
222  if ( symbolList.isEmpty() )
223  {
224  return;
225  }
226 
227  QgsDataDefinedRotationDialog dlg( symbolList, mLayer );
228  dlg.setMapCanvas( mMapCanvas );
229 
230  if ( QDialog::Accepted == dlg.exec() )
231  {
232  if ( !dlg.mDDBtn->isActive() )
233  {
234  Q_FOREACH ( QgsSymbolV2* symbol, symbolList )
235  {
236  if ( !symbol )
237  continue;
238 
239  if ( symbol->type() == QgsSymbolV2::Marker )
240  static_cast<QgsMarkerSymbolV2*>( symbol )->setAngle( dlg.mSpinBox->value() );
241  }
242  }
244  }
245 }
246 
248 {
249  QgsLegendSymbolList symbols = r->legendSymbolItems();
250 
251  QgsSymbolLevelsV2Dialog dlg( symbols, r->usingSymbolLevels(), this );
252 
253  if ( dlg.exec() )
254  {
255  r->setUsingSymbolLevels( dlg.usingLevels() );
256  }
257 }
258 
260 {
261  mMapCanvas = canvas;
262 }
263 
265 {
266  return mMapCanvas;
267 }
268 
270 {
271  apply();
272 }
273 
274 
276 
277 #include "qgsfield.h"
278 
279 QgsRendererV2DataDefinedMenus::QgsRendererV2DataDefinedMenus( QMenu* menu, QgsVectorLayer* layer, const QString& rotationField, const QString& sizeScaleField, QgsSymbolV2::ScaleMethod scaleMethod )
280  : QObject( menu ), mLayer( layer )
281 {
282  mRotationMenu = new QMenu( tr( "Rotation field" ) );
283  mSizeScaleMenu = new QMenu( tr( "Size scale field" ) );
284 
288 
291 
293 
294  QAction* aScaleByArea = new QAction( tr( "Scale area" ), mSizeMethodActionGroup );
295  QAction* aScaleByDiameter = new QAction( tr( "Scale diameter" ), mSizeMethodActionGroup );
296 
297  aScaleByArea->setCheckable( true );
298  aScaleByDiameter->setCheckable( true );
299 
300  if ( scaleMethod == QgsSymbolV2::ScaleDiameter )
301  {
302  aScaleByDiameter->setChecked( true );
303  }
304  else
305  {
306  aScaleByArea->setChecked( true );
307  }
308 
310 
311  //@todo cleanup the class since Rotation and SizeScale are now
312  //defined using QgsDataDefinedButton
313  //
314  //menu->addMenu( mRotationMenu );
315  //menu->addMenu( mSizeScaleMenu );
316 
317  connect( mSizeMethodActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( scaleMethodSelected( QAction* ) ) );
318  connect( mRotationAttributeActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( rotationFieldSelected( QAction* ) ) );
319  connect( mSizeAttributeActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( sizeScaleFieldSelected( QAction* ) ) );
320 }
321 
323 {
324  delete mSizeMethodActionGroup;
327  delete mRotationMenu;
328  delete mSizeScaleMenu;
329 }
330 
331 void QgsRendererV2DataDefinedMenus::populateMenu( QMenu* menu, const QString& fieldName, QActionGroup *actionGroup )
332 {
333  QAction* aExpr = new QAction( tr( "- expression -" ), actionGroup );
334  aExpr->setCheckable( true );
335  menu->addAction( aExpr );
336  menu->addSeparator();
337  QAction* aNo = new QAction( tr( "- no field -" ), actionGroup );
338  aNo->setCheckable( true );
339  menu->addAction( aNo );
340  menu->addSeparator();
341 
342  bool hasField = false;
343  const QgsFields & flds = mLayer->fields();
344  for ( int idx = 0; idx < flds.count(); ++idx )
345  {
346  const QgsField& fld = flds[idx];
347  if ( fld.type() == QVariant::Int || fld.type() == QVariant::Double )
348  {
349  QAction* a = new QAction( fld.name(), actionGroup );
350  a->setCheckable( true );
351  if ( fieldName == fld.name() )
352  {
353  a->setChecked( true );
354  hasField = true;
355  }
356  menu->addAction( a );
357  }
358  }
359 
360  if ( !hasField )
361  {
362  if ( fieldName.isEmpty() )
363  {
364  aNo->setChecked( true );
365  }
366  else
367  {
368  aExpr->setChecked( true );
369  aExpr->setText( tr( "- expression -" ) + fieldName );
370  }
371  }
372 
373 }
374 
376 {
377  if ( !a )
378  return;
379 
380  QString fldName = a->text();
381 #if 0
382  updateMenu( mRotationAttributeActionGroup, fldName );
383 #endif
384  if ( fldName == tr( "- no field -" ) )
385  {
386  fldName = QString();
387  }
388  else if ( fldName.startsWith( tr( "- expression -" ) ) )
389  {
390  QString expr( fldName );
391  expr.replace( 0, tr( "- expression -" ).length(), "" );
392  QgsExpressionBuilderDialog dialog( mLayer, expr );
393  if ( !dialog.exec() ) return;
394  fldName = dialog.expressionText();
395  Q_ASSERT( !QgsExpression( fldName ).hasParserError() );
396  a->setText( tr( "- expression -" ) + fldName );
397  }
398 
399  emit rotationFieldChanged( fldName );
400 }
401 
403 {
404  if ( !a )
405  return;
406 
407  QString fldName = a->text();
408 #if 0
409  updateMenu( mSizeAttributeActionGroup, fldName );
410 #endif
411  if ( fldName == tr( "- no field -" ) )
412  {
413  fldName = QString();
414  }
415  else if ( fldName.startsWith( tr( "- expression -" ) ) )
416  {
417  QString expr( fldName );
418  expr.replace( 0, tr( "- expression -" ).length(), "" );
419  QgsExpressionBuilderDialog dialog( mLayer, expr );
420  if ( !dialog.exec() ) return;
421  fldName = dialog.expressionText();
422  Q_ASSERT( !QgsExpression( fldName ).hasParserError() );
423  a->setText( tr( "- expression -" ) + fldName );
424  }
425 
426  emit sizeScaleFieldChanged( fldName );
427 }
428 
430 {
431  if ( !a )
432  return;
433 
434  if ( a->text() == tr( "Scale area" ) )
435  {
437  }
438  else if ( a->text() == tr( "Scale diameter" ) )
439  {
441  }
442 }
443 #if 0 // MK: is there any reason for this?
444 void QgsRendererV2DataDefinedMenus::updateMenu( QActionGroup* actionGroup, QString fieldName )
445 {
446  Q_FOREACH ( QAction* a, actionGroup->actions() )
447  {
448  a->setChecked( a->text() == fieldName );
449  }
450 }
451 #endif
452 
454  : mSymbolList( symbolList )
455  , mLayer( layer )
456  , mMapCanvas( nullptr )
457 {
458  setupUi( this );
459  setWindowFlags( Qt::WindowStaysOnTopHint );
460  mLabel->setText( label );
461  connect( mDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( dataDefinedChanged() ) );
462  connect( mDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( dataDefinedChanged() ) );
463 
464 }
465 
467 {
468  mMapCanvas = canvas;
469  Q_FOREACH ( QgsDataDefinedButton* ddButton, findChildren<QgsDataDefinedButton*>() )
470  {
471  if ( ddButton->assistant() )
472  ddButton->assistant()->setMapCanvas( mMapCanvas );
473  }
474 }
475 
477 {
478  return mMapCanvas;
479 }
480 
481 static QgsExpressionContext _getExpressionContext( const void* context )
482 {
483  const QgsDataDefinedValueDialog* widget = ( const QgsDataDefinedValueDialog* ) context;
484 
485  QgsExpressionContext expContext;
489  if ( widget->mapCanvas() )
490  {
493  }
494  else
495  {
497  }
498 
499  if ( widget->vectorLayer() )
500  expContext << QgsExpressionContextUtils::layerScope( widget->vectorLayer() );
501 
502  return expContext;
503 }
504 
505 void QgsDataDefinedValueDialog::init( const QString & description )
506 {
508  mDDBtn->init( mLayer, &dd, QgsDataDefinedButton::Double, description );
509  mDDBtn->registerGetExpressionContextCallback( &_getExpressionContext, this );
510 
511  QgsSymbolV2* initialSymbol = nullptr;
512  Q_FOREACH ( QgsSymbolV2* symbol, mSymbolList )
513  {
514  if ( symbol )
515  {
516  initialSymbol = symbol;
517  }
518  }
519  mSpinBox->setValue( initialSymbol ? value( initialSymbol ) : 0 );
520  mSpinBox->setEnabled( !mDDBtn->isActive() );
521 }
522 
524 {
525  if ( mSymbolList.isEmpty() || !mSymbolList.back() )
526  return QgsDataDefined();
527 
528  // check that all symbols share the same size expression
530  Q_FOREACH ( QgsSymbolV2 * it, mSymbolList )
531  {
532  if ( !it || symbolDataDefined( it ) != dd )
533  return QgsDataDefined();
534  }
535  return dd;
536 }
537 
539 {
540  QgsDataDefined dd = mDDBtn->currentDataDefined();
541  mSpinBox->setEnabled( !dd.isActive() );
542 
543  if ( // shall we remove datadefined expressions for layers ?
544  ( symbolDataDefined().isActive() && !dd.isActive() )
545  // shall we set the "en masse" expression for properties ?
546  || dd.isActive() )
547  {
548  Q_FOREACH ( QgsSymbolV2 * it, mSymbolList )
549  setDataDefined( it, dd );
550  }
551 }
552 
554 {
555  const QgsMarkerSymbolV2* marker = static_cast<const QgsMarkerSymbolV2*>( symbol );
556  return marker->dataDefinedSize();
557 }
558 
560 {
561  static_cast<QgsMarkerSymbolV2*>( symbol )->setDataDefinedSize( dd );
562  static_cast<QgsMarkerSymbolV2*>( symbol )->setScaleMethod( QgsSymbolV2::ScaleDiameter );
563 }
564 
565 
567 {
568  const QgsMarkerSymbolV2* marker = static_cast<const QgsMarkerSymbolV2*>( symbol );
569  return marker->dataDefinedAngle();
570 }
571 
573 {
574  static_cast<QgsMarkerSymbolV2*>( symbol )->setDataDefinedAngle( dd );
575 }
576 
577 
579 {
580  const QgsLineSymbolV2* line = static_cast<const QgsLineSymbolV2*>( symbol );
581  return line->dataDefinedWidth();
582 }
583 
585 {
586  static_cast<QgsLineSymbolV2*>( symbol )->setDataDefinedWidth( dd );
587 }
588 
589 void QgsRendererV2Widget::apply()
590 {
591 
592 }
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)
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:62
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)
void init(const QString &description)
void changeSymbolSize()
Change marker sizes of selected symbols.
SymbolType type() const
Definition: qgssymbolv2.h:104
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
QgsFields fields() const
Returns the list of fields of this layer.
void setChecked(bool)
void setDataDefined(QgsSymbolV2 *symbol, const QgsDataDefined &dd) override
QgsDataDefined dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
Calculate scale by the diameter.
Definition: qgssymbolv2.h:90
void addAction(QAction *action)
QgsMapCanvas * mMapCanvas
Q_DECL_DEPRECATED QgsRendererV2DataDefinedMenus(QMenu *menu, QgsVectorLayer *layer, const QString &rotationField, const QString &sizeScaleField, QgsSymbolV2::ScaleMethod scaleMethod)
const QgsMapSettings & mapSettings() const
Get access to properties used for map rendering.
int exec()
Container of fields for a vector layer.
Definition: qgsfield.h:187
const QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
Line symbol.
Definition: qgssymbolv2.h:79
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:105
double value(const QgsSymbolV2 *symbol) const override
Marker symbol.
Definition: qgssymbolv2.h:78
QgsDataDefined dataDefinedWidth() const
Returns data defined size for whole symbol (including all symbol layers).
The QgsMapSettings class contains configuration for rendering of the map.
QgsDataDefined symbolDataDefined() const
void changeSymbolAngle()
Change marker angles of selected symbols.
void setColor(const QColor &color)
Utility classes for "en masse" size definition.
The output shall be in millimeters.
Definition: qgssymbolv2.h:64
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.
qreal alpha() const
Get alpha transparency 1 for opaque, 0 for invisible.
Definition: qgssymbolv2.h:200
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.
QString name() const
Gets the name of the field.
Definition: qgsfield.cpp:84
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
const QgsMapCanvas * mapCanvas() const
Returns the map canvas associated with the widget.
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
The output shall be in map unitx.
Definition: qgssymbolv2.h:65
void changeSymbolColor()
Change color of selected symbols.
int count() const
Return number of items.
Definition: qgsfield.cpp:365
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()
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()
void scaleMethodChanged(QgsSymbolV2::ScaleMethod scaleMethod)
virtual double value(const QgsSymbolV2 *) const =0
A button for defining data source field mappings or expressions.
QgsRendererV2Widget(QgsVectorLayer *layer, QgsStyleV2 *style)
void setShortcut(const QKeySequence &shortcut)
void setDataDefined(QgsSymbolV2 *symbol, const QgsDataDefined &dd) override
void setCheckable(bool)
void contextMenuViewCategories(QPoint p)
void setUsingSymbolLevels(bool usingSymbolLevels)
QString & replace(int position, int n, QChar after)
QList< QgsSymbolV2 * > mSymbolList
const QgsVectorLayer * vectorLayer() const
Returns the vector layer associated with the widget.
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.
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:443
QgsDataDefined dataDefinedAngle() const
Returns data defined angle for whole symbol (including all symbol layers).
QPoint pos()
ScaleMethod
Scale method.
Definition: qgssymbolv2.h:87
virtual void setDataDefined(QgsSymbolV2 *symbol, const QgsDataDefined &dd)=0
bool usingSymbolLevels() const
QgsSymbolV2::OutputUnit outputUnit() const
Calculate scale by the area.
Definition: qgssymbolv2.h:89
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.
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.
int compare(const QString &other) const
bool isActive() const
void setOutputUnit(QgsSymbolV2::OutputUnit u)
T & back()
void setAlpha(qreal alpha)
Set alpha transparency 1 for opaque, 0 for invisible.
Definition: qgssymbolv2.h:202
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)
QgsDataDefinedValueDialog(const QList< QgsSymbolV2 * > &symbolList, QgsVectorLayer *layer, const QString &label)
Constructor.
bool isValid() const
QVariant::Type type() const
Gets variant type of the field as it will be retrieved from data source.
Definition: qgsfield.cpp:89
QColor color() const
void rotationFieldChanged(const QString &fldName)