QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
qgsmaptip.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsmaptips.cpp - Query a layer and show a maptip on the canvas
3 ---------------------
4 begin : October 2007
5 copyright : (C) 2007 by Gary Sherman
6 email : sherman @ mrcc 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// QGIS includes
16#include "qgsfeatureiterator.h"
17#include "qgsmapcanvas.h"
18#include "qgsmaptool.h"
19#include "qgsvectorlayer.h"
20#include "qgsrasterlayer.h"
21#include "qgsexpression.h"
22#include "qgslogger.h"
23#include "qgssettings.h"
24#include "qgswebview.h"
25#include "qgswebframe.h"
26#include "qgsapplication.h"
27#include "qgsrenderer.h"
30#include "qgsrendercontext.h"
31#include "qgsmapcanvasutils.h"
32
33// Qt includes
34#include <QPoint>
35#include <QToolTip>
36#include <QSettings>
37#include <QLabel>
38#include <QDesktopServices>
39#if WITH_QTWEBKIT
40#include <QWebElement>
41#endif
42#include <QHBoxLayout>
43
44#include "qgsmaptip.h"
45#include "moc_qgsmaptip.cpp"
46
47
48const QString QgsMapTip::sMapTipTemplate = "<html>\n"
49 " <head>\n"
50 " <style>\n"
51 " body {\n"
52 " margin: 0;\n"
53 " font: %1pt \"%2\";\n"
54 " color: %3;\n"
55 " width: %4px;\n"
56 " }\n"
57 " #QgsWebViewContainer {\n"
58 " background-color: %5;\n"
59 " border: 1px solid %6;\n"
60 " display: inline-block;\n"
61 " margin: 0\n"
62 " }\n"
63 " #QgsWebViewContainerInner {\n"
64 " margin: 5px\n"
65 " }\n"
66 " </style>\n"
67 " </head>\n"
68 " <body>\n"
69 " <div id='QgsWebViewContainer'>\n"
70 " <div id='QgsWebViewContainerInner'>\n"
71 " %7\n"
72 " </div>\n"
73 " </div>\n"
74 " </body>\n"
75 "</html>\n";
76
77
79{
80 // Init the visible flag
81 mMapTipVisible = false;
82
83 mDelayedClearTimer.setSingleShot( true );
84 connect( &mDelayedClearTimer, &QTimer::timeout, this, [ = ]() {this->clear();} );
85}
86
88 QgsPointXY &mapPosition,
89 const QPoint &pixelPosition,
90 QgsMapCanvas *pMapCanvas )
91{
92 // Do the search using the active layer and the preferred label field for the
93 // layer. The label field must be defined in the layer configuration
94 // file/database. The code required to do this is similar to identify, except
95 // we only want the first qualifying feature and we will only display the
96 // field defined as the label field in the layer configuration file/database
97
98 // Do not render map tips if the layer is not visible
99 if ( !pMapCanvas->layers( true ).contains( pLayer ) )
100 {
101 return;
102 }
103
104 // Do not render a new map tip when the mouse hovers an existing one
105 if ( mWebView && mWebView->underMouse() )
106 {
107 return;
108 }
109
110 // Show the maptip on the canvas
111 QString tipText, lastTipText, tipHtml;
112
113 if ( ! mWebView )
114 {
115 mWebView = new QgsWebView( pMapCanvas );
116 // Make the webwiew transparent
117
118 // Setting the background color to 'transparent' does not play nice
119 // with webkit scrollbars, that are rendered as black rectangles (#54683)
120 QColor transparentColor = mWebView->palette().color( QPalette::Window );
121 transparentColor.setAlpha( 0 );
122 mWebView->setStyleSheet( QString( "background:%1;" ).arg( transparentColor.name( QColor::HexArgb ) ) );
123
124
125#if WITH_QTWEBKIT
126 mWebView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );//Handle link clicks by yourself
127 mWebView->setContextMenuPolicy( Qt::NoContextMenu ); //No context menu is allowed if you don't need it
128 connect( mWebView, &QWebView::linkClicked, this, &QgsMapTip::onLinkClicked );
129 connect( mWebView, &QWebView::loadFinished, this, [ = ]( bool ) { resizeAndMoveToolTip(); } );
130#endif
131
132 mWebView->page()->settings()->setAttribute( QWebSettings::DeveloperExtrasEnabled, true );
133 mWebView->page()->settings()->setAttribute( QWebSettings::JavascriptEnabled, true );
134 mWebView->page()->settings()->setAttribute( QWebSettings::LocalStorageEnabled, true );
135
136 // Disable scrollbars, avoid random resizing issues
137 mWebView->page()->mainFrame()->setScrollBarPolicy( Qt::Horizontal, Qt::ScrollBarAlwaysOff );
138 mWebView->page()->mainFrame()->setScrollBarPolicy( Qt::Vertical, Qt::ScrollBarAlwaysOff );
139
140 }
141
142 // Only supported layer types here:
143 switch ( pLayer->type() )
144 {
146 tipText = fetchFeature( pLayer, mapPosition, pMapCanvas );
147 break;
149 tipText = fetchRaster( pLayer, mapPosition, pMapCanvas );
150 break;
151 default:
152 break;
153 }
154
155 mMapTipVisible = !tipText.isEmpty();
156 if ( !mMapTipVisible )
157 {
158 clear();
159 return;
160 }
161
162 if ( tipText == lastTipText )
163 {
164 return;
165 }
166
167 // Compute offset from the cursor position
168 int cursorOffset = 0;
170 {
171 // The following calculations are taken
172 // from QgsApplication::getThemeCursor, and are used to calculate the correct cursor size
173 // for both hi-dpi and non-hi-dpi screens.
174 double scale = Qgis::UI_SCALE_FACTOR * QgsApplication::instance()->fontMetrics().height() / 32.0;
175 cursorOffset = static_cast< int >( std::ceil( scale * 32 ) );
176 }
177
178 // Ensures the map tip is never larger than the available space
179 const int MAX_WIDTH = std::max( pixelPosition.x(), pMapCanvas->width() - pixelPosition.x() ) - cursorOffset - 5;
180 const int MAX_HEIGHT = std::max( pixelPosition.y(), pMapCanvas->height() - pixelPosition.y() ) - 5;
181
182 mWebView->setMaximumSize( MAX_WIDTH, MAX_HEIGHT );
183
184 tipHtml = QgsMapTip::htmlText( tipText, MAX_WIDTH );
185
186 QgsDebugMsgLevel( tipHtml, 2 );
187
188 mPosition = pixelPosition;
189 mMapCanvas = pMapCanvas;
190 mWebView->setHtml( tipHtml );
191 lastTipText = tipText;
192
193#if !WITH_QTWEBKIT
194 resizeAndMoveToolTip();
195#endif
196
197}
198
199void QgsMapTip::resizeAndMoveToolTip()
200{
201#if WITH_QTWEBKIT
202 // Get the content size
203 const QWebElement container = mWebView->page()->mainFrame()->findFirstElement(
204 QStringLiteral( "#QgsWebViewContainer" ) );
205 const int width = container.geometry().width();
206 const int height = container.geometry().height();
207 mWebView->resize( width, height );
208#else
209 mWebView->adjustSize();
210#endif
211
212 int cursorOffset = 0;
213 // attempt to shift the tip away from the cursor.
215 {
216 // The following calculations are taken
217 // from QgsApplication::getThemeCursor, and are used to calculate the correct cursor size
218 // for both hi-dpi and non-hi-dpi screens.
219 double scale = Qgis::UI_SCALE_FACTOR * QgsApplication::instance()->fontMetrics().height() / 32.0;
220 cursorOffset = static_cast< int >( std::ceil( scale * 32 ) );
221 }
222
223 if ( !mMapCanvas )
224 {
225 mWebView->move( mPosition );
226 mWebView->show();
227 return;
228 }
229
230 // Check if there is enough space to the right of the cursor
231 int availableWidthRight = mMapCanvas->width() - mPosition.x() - cursorOffset;
232 int availableWidthLeft = mPosition.x() - cursorOffset;
233 int availableHeightBottom = mMapCanvas->height() - mPosition.y();
234 int availableHeightTop = mPosition.y();
235 int x, y;
236 // If there is enough space on the right, or more space on the right than on the left, move the map tip to the right of the cursor
237 if ( mWebView->width() < availableWidthRight || availableWidthRight > availableWidthLeft )
238 {
239 x = mPosition.x() + cursorOffset;
240 }
241 // Otherwise, move the map tip to the left of the cursor
242 else
243 {
244 x = mPosition.x() - mWebView->width() - cursorOffset;
245 }
246
247 // If there is enough space on the bottom, or more space on the bottom than on the top, move the map tip to the bottom of the cursor
248 if ( mWebView->height() < availableHeightBottom || availableHeightBottom > availableHeightTop )
249 {
250 y = mPosition.y();
251 }
252 // Otherwise, move the map tip to the top of the cursor
253 else
254 {
255 y = mPosition.y() - mWebView->height();
256 }
257 mWebView->move( x, y );
258 mWebView->show();
259}
260
261void QgsMapTip::clear( QgsMapCanvas *, int msDelay )
262{
263 if ( !mMapTipVisible )
264 {
265 return;
266 }
267
268 // Skip clearing the map tip if the user interacts with it or the timer still runs
269 if ( mDelayedClearTimer.isActive() || mWebView->underMouse() )
270 {
271 return;
272 }
273
274 if ( msDelay > 0 )
275 {
276 mDelayedClearTimer.start( msDelay );
277 return;
278 }
279 mWebView->setHtml( QString() );
280 mWebView->hide();
281
282 // Reset the visible flag
283 mMapTipVisible = false;
284}
285
286QString QgsMapTip::fetchFeature( QgsMapLayer *layer, QgsPointXY &mapPosition, QgsMapCanvas *mapCanvas )
287{
288 QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
289 if ( !vlayer || !vlayer->isSpatial() || !vlayer->mapTipsEnabled() )
290 {
291 return QString();
292 }
293
294 if ( !layer->isInScaleRange( mapCanvas->mapSettings().scale() ) ||
295 ( mapCanvas->mapSettings().isTemporal() && layer->temporalProperties() && !layer->temporalProperties()->isVisibleInTemporalRange( mapCanvas->temporalRange() ) ) )
296 {
297 return QString();
298 }
299
300 const double searchRadius = QgsMapTool::searchRadiusMU( mapCanvas );
301
302 QgsRectangle r;
303 r.setXMinimum( mapPosition.x() - searchRadius );
304 r.setYMinimum( mapPosition.y() - searchRadius );
305 r.setXMaximum( mapPosition.x() + searchRadius );
306 r.setYMaximum( mapPosition.y() + searchRadius );
307
308 r = mapCanvas->mapSettings().mapToLayerCoordinates( layer, r );
309
311 context.appendScope( QgsExpressionContextUtils::mapSettingsScope( mapCanvas->mapSettings() ) );
312 context.appendScope( QgsExpressionContextUtils::mapLayerPositionScope( r.center() ) );
313
314 const QString canvasFilter = QgsMapCanvasUtils::filterForLayer( mapCanvas, vlayer );
315 if ( canvasFilter == QLatin1String( "FALSE" ) )
316 {
317 return QString();
318 }
319
320 const QString mapTip = vlayer->mapTipTemplate();
321 QString tipString;
322 QgsExpression exp( vlayer->displayExpression() );
323 QgsFeature feature;
324
325 QgsFeatureRequest request;
326 request.setFilterRect( r );
328 if ( !canvasFilter.isEmpty() )
329 {
330 request.setFilterExpression( canvasFilter );
331 }
332
333 if ( mapTip.isEmpty() )
334 {
335 exp.prepare( &context );
336 request.setSubsetOfAttributes( exp.referencedColumns(), vlayer->fields() );
337 }
338
340 renderCtx.setExpressionContext( mapCanvas->createExpressionContext() );
342
343 bool filter = false;
344 std::unique_ptr< QgsFeatureRenderer > renderer;
345 if ( vlayer->renderer() )
346 {
347 renderer.reset( vlayer->renderer()->clone() );
348 renderer->startRender( renderCtx, vlayer->fields() );
349 filter = renderer->capabilities() & QgsFeatureRenderer::Filter;
350
351 const QString filterExpression = renderer->filter( vlayer->fields() );
352 if ( ! filterExpression.isEmpty() )
353 {
354 request.combineFilterExpression( filterExpression );
355 }
356 }
357 request.setExpressionContext( renderCtx.expressionContext() );
358
359 QgsFeatureIterator it = vlayer->getFeatures( request );
360 QElapsedTimer timer;
361 timer.start();
362 while ( it.nextFeature( feature ) )
363 {
364 context.setFeature( feature );
365
366 renderCtx.expressionContext().setFeature( feature );
367 if ( filter && renderer && !renderer->willRenderFeature( feature, renderCtx ) )
368 {
369 continue;
370 }
371
372 if ( !mapTip.isEmpty() )
373 {
374 tipString = QgsExpression::replaceExpressionText( mapTip, &context );
375 }
376 else
377 {
378 tipString = exp.evaluate( &context ).toString();
379 }
380
381 if ( !tipString.isEmpty() || timer.elapsed() >= 1000 )
382 {
383 break;
384 }
385 }
386
387 if ( renderer )
388 {
389 renderer->stopRender( renderCtx );
390 }
391
392 return tipString;
393}
394
395QString QgsMapTip::fetchRaster( QgsMapLayer *layer, QgsPointXY &mapPosition, QgsMapCanvas *mapCanvas )
396{
397 QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( layer );
398 if ( !rlayer || !rlayer->mapTipsEnabled() )
399 {
400 return QString();
401 }
402
403 if ( !layer->isInScaleRange( mapCanvas->mapSettings().scale() ) ||
404 ( mapCanvas->mapSettings().isTemporal() && !layer->temporalProperties()->isVisibleInTemporalRange( mapCanvas->temporalRange() ) ) )
405 {
406 return QString();
407 }
408
409 if ( rlayer->mapTipTemplate().isEmpty() )
410 {
411 return QString();
412 }
413
414 const QgsPointXY mappedPosition { mapCanvas->mapSettings().mapToLayerCoordinates( layer, mapPosition ) };
415
416 if ( ! layer->extent().contains( mappedPosition ) )
417 {
418 return QString();
419 }
420
422 context.appendScope( QgsExpressionContextUtils::mapSettingsScope( mapCanvas->mapSettings() ) );
423 context.appendScope( QgsExpressionContextUtils::mapLayerPositionScope( mappedPosition ) );
424 return QgsExpression::replaceExpressionText( rlayer->mapTipTemplate(), &context );
425}
426
427QString QgsMapTip::htmlText( const QString &text, int maxWidth )
428{
429
430 const QgsSettings settings;
431 const QFont defaultFont = qApp->font();
432 const int fontSize = defaultFont.pointSize();
433 const QString fontFamily = defaultFont.family();
434 const QString backgroundColor = QgsApplication::palette().base().color().name();
435 const QString strokeColor = QgsApplication::palette().shadow().color().name();
436 const QString textColor = QgsApplication::palette().toolTipText().color().name();
437 return sMapTipTemplate.arg( fontSize ).arg( fontFamily ).arg( textColor ).arg( maxWidth == -1 ? "" : QString::number( maxWidth ) ).arg( backgroundColor ).arg( strokeColor ).arg( text );
438}
439
440// This slot handles all clicks
441void QgsMapTip::onLinkClicked( const QUrl &url )
442{
443 QDesktopServices::openUrl( url );
444}
445
446
447QString QgsMapTip::vectorMapTipPreviewText( QgsMapLayer *layer, QgsMapCanvas *mapCanvas, const QString &mapTemplate, const QString &displayExpression )
448{
449 // Only spatial layers can have map tips
450 QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( layer );
451 if ( !mapCanvas || !vlayer || !vlayer->isSpatial() )
452 return QString();
453
454 // If no map tip template or display expression is set, return an empty string
455 if ( mapTemplate.isEmpty() && displayExpression.isEmpty() )
456 return QString();
457
458 // Create an expression context
461
462 // Get the first feature if any, and add it to the expression context
463 QgsFeature previewFeature;
464 if ( vlayer->featureCount() > 0 )
465 {
466 QgsFeatureIterator it = vlayer->getFeatures( QgsFeatureRequest().setLimit( 1 ) );
467 it.nextFeature( previewFeature );
468 }
469 else
470 {
471 previewFeature = QgsFeature( vlayer->fields() );
472 }
473 context.setFeature( previewFeature );
474
475 // Generate the map tip text from the context and the mapTipTemplate/displayExpression
476 QString tipText;
477 if ( mapTemplate.isEmpty() )
478 {
479 QgsExpression exp( displayExpression );
480 exp.prepare( &context );
481 tipText = exp.evaluate( &context ).toString();
482 }
483 else
484 {
485 tipText = QgsExpression::replaceExpressionText( mapTemplate, &context );
486 }
487
488 // Insert the map tip text into the html template
489 return QgsMapTip::htmlText( tipText, mapCanvas->width() / 2 );
490
491}
492
493QString QgsMapTip::rasterMapTipPreviewText( QgsMapLayer *layer, QgsMapCanvas *mapCanvas, const QString &mapTemplate )
494{
495 QgsRasterLayer *rlayer = qobject_cast<QgsRasterLayer *>( layer );
496 if ( !mapCanvas || !rlayer || mapTemplate.isEmpty() )
497 {
498 return QString();
499 }
500
501 // Create an expression context
504
505 // Get the position of the center of the layer, and add it to the expression context
506 const QgsPointXY mappedPosition { layer->extent().center() };
508
509 // Generate the map tip text from the context and the mapTipTemplate
510 const QString tipText = QgsExpression::replaceExpressionText( mapTemplate, &context );
511
512 // Insert the map tip text into the html template
513 return QgsMapTip::htmlText( tipText, mapCanvas->width() / 2 );
514}
@ ExactIntersect
Use exact geometry intersection (slower) instead of bounding boxes.
@ Vector
Vector layer.
@ Raster
Raster layer.
static const double UI_SCALE_FACTOR
UI scaling factor.
Definition qgis.h:5667
static QgsApplication * instance()
Returns the singleton instance of the QgsApplication.
static QgsExpressionContextScope * mapLayerPositionScope(const QgsPointXY &position)
Sets the expression context variables which are available for expressions triggered by moving the mou...
static QgsExpressionContextScope * mapSettingsScope(const QgsMapSettings &mapSettings)
Creates a new scope which contains variables and functions relating to a QgsMapSettings object.
static QList< QgsExpressionContextScope * > globalProjectLayerScopes(const QgsMapLayer *layer)
Creates a list of three scopes: global, layer's project and layer.
static QgsExpressionContextScope * layerScope(const QgsMapLayer *layer)
Creates a new scope which contains variables and functions relating to a QgsMapLayer.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
void setFeature(const QgsFeature &feature)
Convenience function for setting a feature for the context.
Class for parsing and evaluation of expressions (formerly called "search strings").
bool prepare(const QgsExpressionContext *context)
Gets the expression ready for evaluation - find out column indexes.
static QString replaceExpressionText(const QString &action, const QgsExpressionContext *context, const QgsDistanceArea *distanceArea=nullptr)
This function replaces each expression between [% and %] in the string with the result of its evaluat...
QVariant evaluate()
Evaluate the feature and return the result.
Wrapper for iterator of features from vector data provider or vector layer.
bool nextFeature(QgsFeature &f)
Fetch next feature and stores in f, returns true on success.
@ Filter
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ....
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
This class wraps a request for features to a vector layer (or directly its vector data provider).
QgsFeatureRequest & setFlags(Qgis::FeatureRequestFlags flags)
Sets flags that affect how features will be fetched.
QgsFeatureRequest & combineFilterExpression(const QString &expression)
Modifies the existing filter expression to add an additional expression filter.
QgsFeatureRequest & setSubsetOfAttributes(const QgsAttributeList &attrs)
Set a subset of attributes that will be fetched.
QgsFeatureRequest & setFilterExpression(const QString &expression)
Set the filter expression.
QgsFeatureRequest & setExpressionContext(const QgsExpressionContext &context)
Sets the expression context used to evaluate filter expressions.
QgsFeatureRequest & setFilterRect(const QgsRectangle &rectangle)
Sets the rectangle from which features will be taken.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition qgsfeature.h:58
static QString filterForLayer(QgsMapCanvas *canvas, QgsVectorLayer *layer)
Constructs a filter to use for selecting features from the given layer, in order to apply filters whi...
Map canvas is a class for displaying all GIS data types on a canvas.
QgsExpressionContext createExpressionContext() const override
This method needs to be reimplemented in all classes which implement this interface and return an exp...
const QgsDateTimeRange & temporalRange() const
Returns map canvas datetime range.
QList< QgsMapLayer * > layers(bool expandGroupLayers=false) const
Returns the list of layers shown within the map canvas.
const QgsMapSettings & mapSettings() const
Gets access to properties used for map rendering.
virtual bool isVisibleInTemporalRange(const QgsDateTimeRange &range) const
Returns true if the layer should be visible and rendered for the specified time range.
Base class for all map layer types.
Definition qgsmaplayer.h:76
bool isInScaleRange(double scale) const
Tests whether the layer should be visible at the specified scale.
virtual QgsRectangle extent() const
Returns the extent of the layer.
Qgis::LayerType type
Definition qgsmaplayer.h:86
virtual QgsMapLayerTemporalProperties * temporalProperties()
Returns the layer's temporal properties.
bool mapTipsEnabled
Definition qgsmaplayer.h:90
QString mapTipTemplate
Definition qgsmaplayer.h:89
double scale() const
Returns the calculated map scale.
QgsPointXY mapToLayerCoordinates(const QgsMapLayer *layer, QgsPointXY point) const
transform point coordinates from output CRS to layer's CRS
void showMapTip(QgsMapLayer *thepLayer, QgsPointXY &mapPosition, const QPoint &pixelPosition, QgsMapCanvas *mpMapCanvas)
Show a maptip at a given point on the map canvas.
Definition qgsmaptip.cpp:87
static QString rasterMapTipPreviewText(QgsMapLayer *layer, QgsMapCanvas *mapCanvas, const QString &mapTemplate)
Returns the html that would be displayed in a maptip for a given layer.
static QString vectorMapTipPreviewText(QgsMapLayer *layer, QgsMapCanvas *mapCanvas, const QString &mapTemplate, const QString &displayExpression)
Returns the html that would be displayed in a maptip for a given layer.
QgsMapTip()
Default constructor.
Definition qgsmaptip.cpp:78
void clear(QgsMapCanvas *mpMapCanvas=nullptr, int msDelay=0)
Clear the current maptip if it exists.
static double searchRadiusMU(const QgsRenderContext &context)
Gets search radius in map units for given context.
A class to represent a 2D point.
Definition qgspointxy.h:60
double y
Definition qgspointxy.h:64
double x
Definition qgspointxy.h:63
Represents a raster layer.
A rectangle specified with double values.
bool contains(const QgsRectangle &rect) const
Returns true when rectangle contains other rectangle.
void setYMinimum(double y)
Set the minimum y value.
void setXMinimum(double x)
Set the minimum x value.
void setYMaximum(double y)
Set the maximum y value.
QgsPointXY center() const
Returns the center point of the rectangle.
void setXMaximum(double x)
Set the maximum x value.
Contains information about the context of a rendering operation.
QgsExpressionContext & expressionContext()
Gets the expression context.
static QgsRenderContext fromMapSettings(const QgsMapSettings &mapSettings)
create initialized QgsRenderContext instance from given QgsMapSettings
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
This class is a composition of two QSettings instances:
Definition qgssettings.h:64
bool isTemporal() const
Returns true if the object's temporal range is enabled, and the object will be filtered when renderin...
Represents a vector layer which manages a vector based data sets.
long long featureCount(const QString &legendKey) const
Number of features rendered with specified legend key.
bool isSpatial() const FINAL
Returns true if this is a geometry layer and false in case of NoGeometry (table only) or UnknownGeome...
QgsFeatureIterator getFeatures(const QgsFeatureRequest &request=QgsFeatureRequest()) const FINAL
Queries the layer for features specified in request.
QgsFeatureRenderer * renderer()
Returns the feature renderer used for rendering the features in the layer in 2D map views.
QString displayExpression
The QgsWebView class is a collection of stubs to mimic the API of QWebView on systems where the real ...
Definition qgswebview.h:66
#define QgsDebugMsgLevel(str, level)
Definition qgslogger.h:39