QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 
58  Q_PROPERTY( QColor color MEMBER mColor NOTIFY colorChanged )
59 
65  Q_PROPERTY( float width MEMBER mWidth NOTIFY widthChanged )
66 
67  public:
69  explicit QgsQuickFeatureHighlight( QQuickItem *parent = nullptr );
70 
71  signals:
73  void featureLayerPairChanged();
74 
76  void colorChanged();
77 
79  void widthChanged();
80 
82  void mapSettingsChanged();
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
The QgsQuickMapSettings class encapsulates QgsMapSettings class to offer settings of configuration of...
The QgsQuickMapTransform is transformation that can be attached to any QQuickItem.
Creates map highlights for a geometry provided by a AttributeModel.
Pair of QgsFeature and QgsVectorLayer.