QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
qgsnullsymbolrendererwidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsnullsymbolrendererwidget.cpp
3  ---------------------
4  begin : November 2014
5  copyright : (C) 2014 by Nyall Dawson
6  email : nyall dot dawson 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  ***************************************************************************/
16 
17 #include "qgsnullsymbolrenderer.h"
18 #include "qgssymbolv2.h"
19 #include <QLayout>
20 #include <QLabel>
21 
23 {
24  return new QgsNullSymbolRendererWidget( layer, style, renderer );
25 }
26 
28  : QgsRendererV2Widget( layer, style )
29  , mRenderer( nullptr )
30 {
31  if ( renderer )
32  {
34  }
35  if ( !mRenderer )
36  {
38  }
39 
40  QGridLayout* layout = new QGridLayout( this );
41  QLabel* label = new QLabel( tr( "No symbols will be rendered for features in this layer." ) );
42  layout->addWidget( label );
43 }
44 
46 {
47  delete mRenderer;
48 }
49 
51 {
52  return mRenderer;
53 }
QLayout * layout() const
static QgsNullSymbolRenderer * convertFromRenderer(const QgsFeatureRendererV2 *renderer)
Creates a QgsNullSymbolRenderer from an existing renderer.
void addWidget(QWidget *widget, int row, int column, QFlags< Qt::AlignmentFlag > alignment)
QgsNullSymbolRendererWidget(QgsVectorLayer *layer, QgsStyleV2 *style, QgsFeatureRendererV2 *renderer)
Constructor for QgsNullSymbolRendererWidget.
virtual QgsFeatureRendererV2 * renderer()
Returns a pointer to the configured renderer.
QStyle * style() const
QString tr(const char *sourceText, const char *disambiguation, int n)
Null symbol renderer.
static QgsRendererV2Widget * create(QgsVectorLayer *layer, QgsStyleV2 *style, QgsFeatureRendererV2 *renderer)
Creates a new QgsNullSymbolRendererWidget object.
Base class for renderer settings widgets.
Represents a vector layer which manages a vector based data sets.
QgsNullSymbolRenderer * mRenderer
Renderer being configured by the widget.