QGIS API Documentation
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  [email protected] 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  Q_FOREACH ( const QgsField& fld, mLayer->fields() )
344  {
345  if ( fld.type() == QVariant::Int || fld.type() == QVariant::Double )
346  {
347  QAction* a = new QAction( fld.name(), actionGroup );
348  a->setCheckable( true );
349  if ( fieldName == fld.name() )
350  {
351  a->setChecked( true );
352  hasField = true;
353  }
354  menu->addAction( a );
355  }
356  }
357 
358  if ( !hasField )
359  {
360  if ( fieldName.isEmpty() )
361  {
362  aNo->setChecked( true );
363  }
364  else
365  {
366  aExpr->setChecked( true );
367  aExpr->setText( tr( "- expression -" ) + fieldName );
368  }
369  }
370 
371 }
372 
374 {
375  if ( !a )
376  return;
377 
378  QString fldName = a->text();
379 #if 0
380  updateMenu( mRotationAttributeActionGroup, fldName );
381 #endif
382  if ( fldName == tr( "- no field -" ) )
383  {
384  fldName = QString();
385  }
386  else if ( fldName.startsWith( tr( "- expression -" ) ) )
387  {
388  QString expr( fldName );
389  expr.replace( 0, tr( "- expression -" ).length(), "" );
390  QgsExpressionBuilderDialog dialog( mLayer, expr );
391  if ( !dialog.exec() ) return;
392  fldName = dialog.expressionText();
393  Q_ASSERT( !QgsExpression( fldName ).hasParserError() );
394  a->setText( tr( "- expression -" ) + fldName );
395  }
396 
397  emit rotationFieldChanged( fldName );
398 }
399 
401 {
402  if ( !a )
403  return;
404 
405  QString fldName = a->text();
406 #if 0
407  updateMenu( mSizeAttributeActionGroup, fldName );
408 #endif
409  if ( fldName == tr( "- no field -" ) )
410  {
411  fldName = QString();
412  }
413  else if ( fldName.startsWith( tr( "- expression -" ) ) )
414  {
415  QString expr( fldName );
416  expr.replace( 0, tr( "- expression -" ).length(), "" );
417  QgsExpressionBuilderDialog dialog( mLayer, expr );
418  if ( !dialog.exec() ) return;
419  fldName = dialog.expressionText();
420  Q_ASSERT( !QgsExpression( fldName ).hasParserError() );
421  a->setText( tr( "- expression -" ) + fldName );
422  }
423 
424  emit sizeScaleFieldChanged( fldName );
425 }
426 
428 {
429  if ( !a )
430  return;
431 
432  if ( a->text() == tr( "Scale area" ) )
433  {
435  }
436  else if ( a->text() == tr( "Scale diameter" ) )
437  {
439  }
440 }
441 #if 0 // MK: is there any reason for this?
442 void QgsRendererV2DataDefinedMenus::updateMenu( QActionGroup* actionGroup, QString fieldName )
443 {
444  Q_FOREACH ( QAction* a, actionGroup->actions() )
445  {
446  a->setChecked( a->text() == fieldName );
447  }
448 }
449 #endif
450 
452  : mSymbolList( symbolList )
453  , mLayer( layer )
454  , mMapCanvas( nullptr )
455 {
456  setupUi( this );
457  setWindowFlags( Qt::WindowStaysOnTopHint );
458  mLabel->setText( label );
459  connect( mDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( dataDefinedChanged() ) );
460  connect( mDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( dataDefinedChanged() ) );
461 
462 }
463 
465 {
466  mMapCanvas = canvas;
467  Q_FOREACH ( QgsDataDefinedButton* ddButton, findChildren<QgsDataDefinedButton*>() )
468  {
469  if ( ddButton->assistant() )
470  ddButton->assistant()->setMapCanvas( mMapCanvas );
471  }
472 }
473 
475 {
476  return mMapCanvas;
477 }
478 
479 static QgsExpressionContext _getExpressionContext( const void* context )
480 {
481  const QgsDataDefinedValueDialog* widget = ( const QgsDataDefinedValueDialog* ) context;
482 
483  QgsExpressionContext expContext;
487  if ( widget->mapCanvas() )
488  {
491  }
492  else
493  {
495  }
496 
497  if ( widget->vectorLayer() )
498  expContext << QgsExpressionContextUtils::layerScope( widget->vectorLayer() );
499 
500  return expContext;
501 }
502 
503 void QgsDataDefinedValueDialog::init( const QString & description )
504 {
506  mDDBtn->init( mLayer, &dd, QgsDataDefinedButton::Double, description );
507  mDDBtn->registerGetExpressionContextCallback( &_getExpressionContext, this );
508 
509  QgsSymbolV2* initialSymbol = nullptr;
510  Q_FOREACH ( QgsSymbolV2* symbol, mSymbolList )
511  {
512  if ( symbol )
513  {
514  initialSymbol = symbol;
515  }
516  }
517  mSpinBox->setValue( initialSymbol ? value( initialSymbol ) : 0 );
518  mSpinBox->setEnabled( !mDDBtn->isActive() );
519 }
520 
522 {
523  if ( mSymbolList.isEmpty() || !mSymbolList.back() )
524  return QgsDataDefined();
525 
526  // check that all symbols share the same size expression
528  Q_FOREACH ( QgsSymbolV2 * it, mSymbolList )
529  {
530  if ( !it || symbolDataDefined( it ) != dd )
531  return QgsDataDefined();
532  }
533  return dd;
534 }
535 
537 {
538  QgsDataDefined dd = mDDBtn->currentDataDefined();
539  mSpinBox->setEnabled( !dd.isActive() );
540 
541  if ( // shall we remove datadefined expressions for layers ?
542  ( symbolDataDefined().isActive() && !dd.isActive() )
543  // shall we set the "en masse" expression for properties ?
544  || dd.isActive() )
545  {
546  Q_FOREACH ( QgsSymbolV2 * it, mSymbolList )
547  setDataDefined( it, dd );
548  }
549 }
550 
552 {
553  const QgsMarkerSymbolV2* marker = static_cast<const QgsMarkerSymbolV2*>( symbol );
554  return marker->dataDefinedSize();
555 }
556 
558 {
559  static_cast<QgsMarkerSymbolV2*>( symbol )->setDataDefinedSize( dd );
560  static_cast<QgsMarkerSymbolV2*>( symbol )->setScaleMethod( QgsSymbolV2::ScaleDiameter );
561 }
562 
563 
565 {
566  const QgsMarkerSymbolV2* marker = static_cast<const QgsMarkerSymbolV2*>( symbol );
567  return marker->dataDefinedAngle();
568 }
569 
571 {
572  static_cast<QgsMarkerSymbolV2*>( symbol )->setDataDefinedAngle( dd );
573 }
574 
575 
577 {
578  const QgsLineSymbolV2* line = static_cast<const QgsLineSymbolV2*>( symbol );
579  return line->dataDefinedWidth();
580 }
581 
583 {
584  static_cast<QgsLineSymbolV2*>( symbol )->setDataDefinedWidth( dd );
585 }
586 
587 void QgsRendererV2Widget::apply()
588 {
589 
590 }
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()
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.
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)