QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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 "qgis_gui.h"
20#include "qgis_sip.h"
22
23#include <QComboBox>
24
25class QgsMapLayer;
27
35class GUI_EXPORT QgsPointCloudAttributeComboBox : public QComboBox
36{
37 Q_OBJECT
40
41 public:
46 explicit QgsPointCloudAttributeComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );
47
53
58 QgsPointCloudAttributeProxyModel::Filters filters() const { return mProxyModel->filters(); }
59
64 void setAllowEmptyAttributeName( bool allowEmpty );
65
70 bool allowEmptyAttributeName() const;
71
73 QString currentAttribute() const;
74
79 QgsPointCloudLayer *layer() const;
80
90 void setAttributes( const QgsPointCloudAttributeCollection &attributes );
91
98 QgsPointCloudAttributeCollection attributes() const;
99
100 signals:
102 void attributeChanged( const QString &name );
103
104 public slots:
105
111 void setLayer( QgsMapLayer *layer );
112
114 void setAttribute( const QString &name );
115
116 private slots:
117 void indexChanged( int i );
118
119 private:
120 QgsPointCloudAttributeModel *mAttributeModel = nullptr;
121 QgsPointCloudAttributeProxyModel *mProxyModel = nullptr;
122};
123
124#endif // QGSPOINTCLOUDATTRIBUTECOMBOBOX_H
Base class for all map layer types.
Definition qgsmaplayer.h:80
A collection of point cloud attributes.
void setLayer(QgsMapLayer *layer)
Sets the layer for which fields are listed in the combobox.
QgsPointCloudAttributeProxyModel::Filters filters
void setAllowEmptyAttributeName(bool allowEmpty)
Sets whether an optional empty attribute ("not set") option is shown in the combo box.
void attributeChanged(const QString &name)
Emitted when the currently selected attribute changes.
QgsPointCloudAttributeComboBox(QWidget *parent=nullptr)
QgsPointCloudAttributeComboBox creates a combo box to display the fields of a layer.
QgsPointCloudLayer * layer() const
Returns the layer currently associated with the combobox.
void setAttribute(const QString &name)
Sets the currently selected attribute by name.
void setFilters(QgsPointCloudAttributeProxyModel::Filters filters)
Sets filters to allow filtering available attributes according to the attribute properties.
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