QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
qgsmeshstaticdatasetwidget.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmeshstaticdatasetwidget.h
3 -------------------------------------
4 begin : March 2020
5 copyright : (C) 2020 by Vincent Cloarec
6 email : vcloarec 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#ifndef QGSMESHSTATICDATASETWIDGET_H
16#define QGSMESHSTATICDATASETWIDGET_H
17
18#include <QAbstractListModel>
19
20#include "qgis_gui.h"
21#include "ui_qgsmeshstaticdatasetwidgetbase.h"
22#include "qgsmeshdataset.h"
23
25
26class QgsMeshLayer;
28
36class QgsMeshDatasetListModel : public QAbstractListModel
37{
38 Q_OBJECT
39 public:
41 QgsMeshDatasetListModel( QObject *parent );
42
44 void setMeshLayer( QgsMeshLayer *layer );
46 void setDatasetGroup( int group );
47
48 int rowCount( const QModelIndex &parent ) const override;
49 QVariant data( const QModelIndex &index, int role ) const override;
50
51 private:
52 QgsMeshLayer *mLayer = nullptr;
53 int mDatasetGroup = -1;
54};
55
62class GUI_EXPORT QgsMeshStaticDatasetWidget : public QWidget, private Ui::QgsMeshStaticDatasetWidget
63{
64 Q_OBJECT
65 public:
67 QgsMeshStaticDatasetWidget( QWidget *parent = nullptr );
68
70 void setLayer( QgsMeshLayer *layer );
71
73 void syncToLayer();
74
76 void apply();
77
78 public slots:
80 void setScalarDatasetGroup( int index );
82 void setVectorDatasetGroup( int index );
83
84 private:
85 void setScalarDatasetIndex( int index );
86 void setVectorDatasetIndex( int index );
87
88 int mScalarDatasetGroup = -1;
89 int mVectorDatasetGroup = -1;
90
91 QgsMeshDatasetListModel *mDatasetScalarModel = nullptr;
92 QgsMeshDatasetListModel *mDatasetVectorModel = nullptr;
93
94 QgsMeshLayer *mLayer;
95};
96
97#endif // QGSMESHSTATICDATASETWIDGET_H
Base class for providing data for QgsMeshLayer.
List model for dataset contained in dataset group, used to display by time dataset in widget.
void setDatasetGroup(int group)
Sets the dataset group.
void setMeshLayer(QgsMeshLayer *layer)
Sets the layer.
int rowCount(const QModelIndex &parent) const override
QVariant data(const QModelIndex &index, int role) const override
Represents a mesh layer supporting display of data on structured or unstructured meshes.
A widget for setup of the static dataset of a mesh layer.
#define SIP_NO_FILE