QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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 "qgssymbol.h"
19 #include <QLayout>
20 #include <QLabel>
21 
23 {
24  return new QgsNullSymbolRendererWidget( layer, style, renderer );
25 }
26 
28  : QgsRendererWidget( layer, style )
29 {
30  if ( renderer )
31  {
33  }
34  if ( !mRenderer )
35  {
36  mRenderer = std::make_unique< QgsNullSymbolRenderer >();
37  if ( renderer )
39  }
40 
41  QGridLayout *layout = new QGridLayout( this );
42  QLabel *label = new QLabel( tr( "No symbols will be rendered for features in this layer." ) );
43  layout->addWidget( label );
44 }
45 
47 
49 {
50  return mRenderer.get();
51 }
QgsFeatureRenderer::copyRendererData
void copyRendererData(QgsFeatureRenderer *destRenderer) const
Clones generic renderer data to another renderer.
Definition: qgsrenderer.cpp:52
qgsnullsymbolrenderer.h
QgsNullSymbolRendererWidget::renderer
QgsFeatureRenderer * renderer() override
Returns a pointer to the configured renderer.
Definition: qgsnullsymbolrendererwidget.cpp:48
QgsNullSymbolRenderer::convertFromRenderer
static QgsNullSymbolRenderer * convertFromRenderer(const QgsFeatureRenderer *renderer)
Creates a QgsNullSymbolRenderer from an existing renderer.
Definition: qgsnullsymbolrenderer.cpp:122
QgsRendererWidget
Base class for renderer settings widgets.
Definition: qgsrendererwidget.h:45
QgsFeatureRenderer
Definition: qgsrenderer.h:101
QgsStyle
Definition: qgsstyle.h:159
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
qgsnullsymbolrendererwidget.h
QgsNullSymbolRendererWidget::QgsNullSymbolRendererWidget
QgsNullSymbolRendererWidget(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Constructor for QgsNullSymbolRendererWidget.
Definition: qgsnullsymbolrendererwidget.cpp:27
qgssymbol.h
QgsNullSymbolRendererWidget::~QgsNullSymbolRendererWidget
~QgsNullSymbolRendererWidget() override
QgsNullSymbolRendererWidget::create
static QgsRendererWidget * create(QgsVectorLayer *layer, QgsStyle *style, QgsFeatureRenderer *renderer)
Creates a new QgsNullSymbolRendererWidget object.
Definition: qgsnullsymbolrendererwidget.cpp:22
QgsNullSymbolRendererWidget::mRenderer
std::unique_ptr< QgsNullSymbolRenderer > mRenderer
Renderer being configured by the widget.
Definition: qgsnullsymbolrendererwidget.h:52