QGIS API Documentation  2.15.0-Master (af20121)
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 )
281  , mLayer( layer )
282 {
283  mRotationMenu = new QMenu( tr( "Rotation field" ) );
284  mSizeScaleMenu = new QMenu( tr( "Size scale field" ) );
285 
289 
292 
294 
295  QAction* aScaleByArea = new QAction( tr( "Scale area" ), mSizeMethodActionGroup );
296  QAction* aScaleByDiameter = new QAction( tr( "Scale diameter" ), mSizeMethodActionGroup );
297 
298  aScaleByArea->setCheckable( true );
299  aScaleByDiameter->setCheckable( true );
300 
301  if ( scaleMethod == QgsSymbolV2::ScaleDiameter )
302  {
303  aScaleByDiameter->setChecked( true );
304  }
305  else
306  {
307  aScaleByArea->setChecked( true );
308  }
309 
311 
312  [email protected] cleanup the class since Rotation and SizeScale are now
313  //defined using QgsDataDefinedButton
314  //
315  //menu->addMenu( mRotationMenu );
316  //menu->addMenu( mSizeScaleMenu );
317 
318  connect( mSizeMethodActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( scaleMethodSelected( QAction* ) ) );
319  connect( mRotationAttributeActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( rotationFieldSelected( QAction* ) ) );
320  connect( mSizeAttributeActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( sizeScaleFieldSelected( QAction* ) ) );
321 }
322 
324 {
325  delete mSizeMethodActionGroup;
328  delete mRotationMenu;
329  delete mSizeScaleMenu;
330 }
331 
332 void QgsRendererV2DataDefinedMenus::populateMenu( QMenu* menu, const QString& fieldName, QActionGroup *actionGroup )
333 {
334  QAction* aExpr = new QAction( tr( "- expression -" ), actionGroup );
335  aExpr->setCheckable( true );
336  menu->addAction( aExpr );
337  menu->addSeparator();
338  QAction* aNo = new QAction( tr( "- no field -" ), actionGroup );
339  aNo->setCheckable( true );
340  menu->addAction( aNo );
341  menu->addSeparator();
342 
343  bool hasField = false;
344  Q_FOREACH ( const QgsField& fld, mLayer->fields() )
345  {
346  if ( fld.type() == QVariant::Int || fld.type() == QVariant::Double )
347  {
348  QAction* a = new QAction( fld.name(), actionGroup );
349  a->setCheckable( true );
350  if ( fieldName == fld.name() )
351  {
352  a->setChecked( true );
353  hasField = true;
354  }
355  menu->addAction( a );
356  }
357  }
358 
359  if ( !hasField )
360  {
361  if ( fieldName.isEmpty() )
362  {
363  aNo->setChecked( true );
364  }
365  else
366  {
367  aExpr->setChecked( true );
368  aExpr->setText( tr( "- expression -" ) + fieldName );
369  }
370  }
371 
372 }
373 
375 {
376  if ( !a )
377  return;
378 
379  QString fldName = a->text();
380 #if 0
381  updateMenu( mRotationAttributeActionGroup, fldName );
382 #endif
383  if ( fldName == tr( "- no field -" ) )
384  {
385  fldName = QString();
386  }
387  else if ( fldName.startsWith( tr( "- expression -" ) ) )
388  {
389  QString expr( fldName );
390  expr.replace( 0, tr( "- expression -" ).length(), "" );
391  QgsExpressionBuilderDialog dialog( mLayer, expr );
392  if ( !dialog.exec() ) return;
393  fldName = dialog.expressionText();
394  Q_ASSERT( !QgsExpression( fldName ).hasParserError() );
395  a->setText( tr( "- expression -" ) + fldName );
396  }
397 
398  emit rotationFieldChanged( fldName );
399 }
400 
402 {
403  if ( !a )
404  return;
405 
406  QString fldName = a->text();
407 #if 0
408  updateMenu( mSizeAttributeActionGroup, fldName );
409 #endif
410  if ( fldName == tr( "- no field -" ) )
411  {
412  fldName = QString();
413  }
414  else if ( fldName.startsWith( tr( "- expression -" ) ) )
415  {
416  QString expr( fldName );
417  expr.replace( 0, tr( "- expression -" ).length(), "" );
418  QgsExpressionBuilderDialog dialog( mLayer, expr );
419  if ( !dialog.exec() ) return;
420  fldName = dialog.expressionText();
421  Q_ASSERT( !QgsExpression( fldName ).hasParserError() );
422  a->setText( tr( "- expression -" ) + fldName );
423  }
424 
425  emit sizeScaleFieldChanged( fldName );
426 }
427 
429 {
430  if ( !a )
431  return;
432 
433  if ( a->text() == tr( "Scale area" ) )
434  {
436  }
437  else if ( a->text() == tr( "Scale diameter" ) )
438  {
440  }
441 }
442 #if 0 // MK: is there any reason for this?
443 void QgsRendererV2DataDefinedMenus::updateMenu( QActionGroup* actionGroup, QString fieldName )
444 {
445  Q_FOREACH ( QAction* a, actionGroup->actions() )
446  {
447  a->setChecked( a->text() == fieldName );
448  }
449 }
450 #endif
451 
453  : mSymbolList( symbolList )
454  , mLayer( layer )
455  , mMapCanvas( nullptr )
456 {
457  setupUi( this );
458  setWindowFlags( Qt::WindowStaysOnTopHint );
459  mLabel->setText( label );
460  connect( mDDBtn, SIGNAL( dataDefinedChanged( const QString& ) ), this, SLOT( dataDefinedChanged() ) );
461  connect( mDDBtn, SIGNAL( dataDefinedActivated( bool ) ), this, SLOT( dataDefinedChanged() ) );
462 
463 }
464 
466 {
467  mMapCanvas = canvas;
468  Q_FOREACH ( QgsDataDefinedButton* ddButton, findChildren<QgsDataDefinedButton*>() )
469  {
470  if ( ddButton->assistant() )
471  ddButton->assistant()->setMapCanvas( mMapCanvas );
472  }
473 }
474 
476 {
477  return mMapCanvas;
478 }
479 
480 static QgsExpressionContext _getExpressionContext( const void* context )
481 {
482  const QgsDataDefinedValueDialog* widget = ( const QgsDataDefinedValueDialog* ) context;
483 
484  QgsExpressionContext expContext;
488  if ( widget->mapCanvas() )
489  {
492  }
493  else
494  {
496  }
497 
498  if ( widget->vectorLayer() )
499  expContext << QgsExpressionContextUtils::layerScope( widget->vectorLayer() );
500 
501  return expContext;
502 }
503 
504 void QgsDataDefinedValueDialog::init( const QString & description )
505 {
507  mDDBtn->init( mLayer, &dd, QgsDataDefinedButton::Double, description );
508  mDDBtn->registerGetExpressionContextCallback( &_getExpressionContext, this );
509 
510  QgsSymbolV2* initialSymbol = nullptr;
511  Q_FOREACH ( QgsSymbolV2* symbol, mSymbolList )
512  {
513  if ( symbol )
514  {
515  initialSymbol = symbol;
516  }
517  }
518  mSpinBox->setValue( initialSymbol ? value( initialSymbol ) : 0 );
519  mSpinBox->setEnabled( !mDDBtn->isActive() );
520 }
521 
523 {
524  if ( mSymbolList.isEmpty() || !mSymbolList.back() )
525  return QgsDataDefined();
526 
527  // check that all symbols share the same size expression
529  Q_FOREACH ( QgsSymbolV2 * it, mSymbolList )
530  {
531  if ( !it || symbolDataDefined( it ) != dd )
532  return QgsDataDefined();
533  }
534  return dd;
535 }
536 
538 {
539  QgsDataDefined dd = mDDBtn->currentDataDefined();
540  mSpinBox->setEnabled( !dd.isActive() );
541 
542  if ( // shall we remove datadefined expressions for layers ?
543  ( symbolDataDefined().isActive() && !dd.isActive() )
544  // shall we set the "en masse" expression for properties ?
545  || dd.isActive() )
546  {
547  Q_FOREACH ( QgsSymbolV2 * it, mSymbolList )
548  setDataDefined( it, dd );
549  }
550 }
551 
553 {
554  const QgsMarkerSymbolV2* marker = static_cast<const QgsMarkerSymbolV2*>( symbol );
555  return marker->dataDefinedSize();
556 }
557 
559 {
560  static_cast<QgsMarkerSymbolV2*>( symbol )->setDataDefinedSize( dd );
561  static_cast<QgsMarkerSymbolV2*>( symbol )->setScaleMethod( QgsSymbolV2::ScaleDiameter );
562 }
563 
564 
566 {
567  const QgsMarkerSymbolV2* marker = static_cast<const QgsMarkerSymbolV2*>( symbol );
568  return marker->dataDefinedAngle();
569 }
570 
572 {
573  static_cast<QgsMarkerSymbolV2*>( symbol )->setDataDefinedAngle( dd );
574 }
575 
576 
578 {
579  const QgsLineSymbolV2* line = static_cast<const QgsLineSymbolV2*>( symbol );
580  return line->dataDefinedWidth();
581 }
582 
584 {
585  static_cast<QgsLineSymbolV2*>( symbol )->setDataDefinedWidth( dd );
586 }
587 
588 void QgsRendererV2Widget::apply()
589 {
590 
591 }
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:108
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:456
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)