QGIS API Documentation  3.24.2-Tisler (13c1a02865)
qgspointcloudattributecombobox.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgspointcloudattributecombobox.h
3  --------------------------------------
4  begin : November 2020
5  copyright : (C) 2020 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 ***************************************************************************/
15 
16 #ifndef QGSPOINTCLOUDATTRIBUTECOMBOBOX_H
17 #define QGSPOINTCLOUDATTRIBUTECOMBOBOX_H
18 
19 #include <QComboBox>
20 
22 #include "qgis_gui.h"
23 
24 #include "qgis_sip.h"
25 
26 class QgsMapLayer;
27 class QgsPointCloudLayer;
28 
35 class GUI_EXPORT QgsPointCloudAttributeComboBox : public QComboBox
36 {
37  Q_OBJECT
38  Q_PROPERTY( QgsPointCloudAttributeProxyModel::Filters filters READ filters WRITE setFilters )
39  Q_PROPERTY( bool allowEmptyAttributeName READ allowEmptyAttributeName WRITE setAllowEmptyAttributeName )
40 
41  public:
42 
47  explicit QgsPointCloudAttributeComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
48 
53  void setFilters( QgsPointCloudAttributeProxyModel::Filters filters );
54 
59  QgsPointCloudAttributeProxyModel::Filters filters() const { return mProxyModel->filters(); }
60 
65  void setAllowEmptyAttributeName( bool allowEmpty );
66 
71  bool allowEmptyAttributeName() const;
72 
74  QString currentAttribute() const;
75 
80  QgsPointCloudLayer *layer() const;
81 
91  void setAttributes( const QgsPointCloudAttributeCollection &attributes );
92 
99  QgsPointCloudAttributeCollection attributes() const;
100 
101  signals:
103  void attributeChanged( const QString &name );
104 
105  public slots:
106 
112  void setLayer( QgsMapLayer *layer );
113 
115  void setAttribute( const QString &name );
116 
117  private slots:
118  void indexChanged( int i );
119 
120  private:
121  QgsPointCloudAttributeModel *mAttributeModel = nullptr;
122  QgsPointCloudAttributeProxyModel *mProxyModel = nullptr;
123 };
124 
125 #endif // QGSPOINTCLOUDATTRIBUTECOMBOBOX_H
Base class for all map layer types.
Definition: qgsmaplayer.h:73
Collection of point cloud attributes.
The QgsPointCloudAttributeComboBox is a combo box which displays the list of attributes of a given po...
QgsPointCloudAttributeProxyModel::Filters filters() const
Returns the current filters used for filtering available attributes.
void attributeChanged(const QString &name)
Emitted when the currently selected attribute changes.
A model for display of available attributes from a point cloud.
A proxy model for filtering available attributes from a point cloud attribute model.
Represents a map layer supporting display of point clouds.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53