QGIS API Documentation  3.18.1-Zürich (202f1bf7e5)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
qgsquickfeaturehighlight.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsqguickfeaturehighlight.h
3  ---------------------------
4  Date : May 2018
5  Copyright : (C) 2018 by Peter Petrik
6  Email : zilolv 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 
16 #ifndef QGSQUICKFEATUREHIGHLIGHT_H
17 #define QGSQUICKFEATUREHIGHLIGHT_H
18 
19 #include <QQuickItem>
20 
22 #include "qgis_quick.h"
23 #include "qgsquickmaptransform.h"
24 
26 
39 class QUICK_EXPORT QgsQuickFeatureHighlight : public QQuickItem
40 {
41  Q_OBJECT
42 
46  Q_PROPERTY( QgsQuickMapSettings *mapSettings MEMBER mMapSettings NOTIFY mapSettingsChanged )
47 
48 
51  Q_PROPERTY( QgsQuickFeatureLayerPair featureLayerPair MEMBER mFeatureLayerPair NOTIFY featureLayerPairChanged )
52 
53 
58  Q_PROPERTY( QColor color MEMBER mColor NOTIFY colorChanged )
59 
60 
65  Q_PROPERTY( float width MEMBER mWidth NOTIFY widthChanged )
66 
67  public:
69  explicit QgsQuickFeatureHighlight( QQuickItem *parent = nullptr );
70 
71  signals:
74 
76  void colorChanged();
77 
79  void widthChanged();
80 
83 
84  private slots:
85  void markDirty();
86  void onMapSettingsChanged();
87 
88  private:
89  QSGNode *updatePaintNode( QSGNode *n, UpdatePaintNodeData * ) override;
90 
91  QColor mColor = Qt::yellow;
92  bool mDirty = false;
93  float mWidth = 20;
94  QgsQuickFeatureLayerPair mFeatureLayerPair;
95  QgsQuickMapSettings *mMapSettings = nullptr; // not owned
96  QgsQuickMapTransform mTransform;
97 };
98 
99 #endif // QGSQUICKFEATUREHIGHLIGHT_H
Creates map highlights for a geometry provided by a AttributeModel.
void widthChanged()
Pen width of the highlighted geometry (feature).
void mapSettingsChanged()
Associated map settings.
void colorChanged()
Color of the highlighted geometry (feature).
void featureLayerPairChanged()
Feature to highlight.
Pair of QgsFeature and QgsVectorLayer.
The QgsQuickMapSettings class encapsulates QgsMapSettings class to offer settings of configuration of...
The QgsQuickMapTransform is transformation that can be attached to any QQuickItem.