24 this->layout()->setContentsMargins( 0, 0, 0, 0 );
26 mScalarDatasetComboBox->setModel( mDatasetScalarModel );
28 mVectorDatasetComboBox->setModel( mDatasetVectorModel );
55 if ( mScalarDatasetComboBox->count() == 1 )
58 scalarIndex = mScalarDatasetComboBox->currentIndex() - 1;
61 if ( mVectorDatasetComboBox->count() == 1 )
64 vectorIndex = mVectorDatasetComboBox->currentIndex() - 1;
72 mScalarDatasetGroup = index;
74 mScalarDatasetComboBox->setEnabled( mScalarDatasetGroup >= 0 );
84 mVectorDatasetGroup = index;
86 mVectorDatasetComboBox->setEnabled( mVectorDatasetGroup >= 0 );
94void QgsMeshStaticDatasetWidget::setScalarDatasetIndex(
int index )
96 if ( index < mLayer->datasetCount( mScalarDatasetGroup ) )
97 mScalarDatasetComboBox->setCurrentIndex( index + 1 );
99 mScalarDatasetComboBox->setCurrentIndex( 0 );
102void QgsMeshStaticDatasetWidget::setVectorDatasetIndex(
int index )
104 if ( index < mLayer->datasetCount( mVectorDatasetGroup ) )
105 mVectorDatasetComboBox->setCurrentIndex( index + 1 );
107 mVectorDatasetComboBox->setCurrentIndex( 0 );
123 mDatasetGroup = group;
139 if ( !index.isValid() )
142 if ( role == Qt::DisplayRole )
144 if ( !mLayer || mDatasetGroup < 0 || index.row() == 0 )
147 else if ( index.row() == 1 && mLayer->
datasetCount( mDatasetGroup ) == 1 )
149 return tr(
"Display dataset" );
A representation of the interval between two datetime values.
double hours() const
Returns the interval duration in hours.
QgsMeshDatasetIndex is index that identifies the dataset group (e.g.
int dataset() const
Returns a dataset index within group()
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
QgsMeshDatasetListModel(QObject *parent)
Constructor.
Represents a mesh layer supporting display of data on structured or unstructured meshes.
int datasetCount(const QgsMeshDatasetIndex &index) const
Returns the dataset count in the dataset groups.
void setStaticVectorDatasetIndex(const QgsMeshDatasetIndex &staticVectorDatasetIndex)
Sets the static vector dataset index that is rendered if the temporal properties is not active.
void setStaticScalarDatasetIndex(const QgsMeshDatasetIndex &staticScalarDatasetIndex)
Sets the static scalar dataset index that is rendered if the temporal properties is not active.
QgsMeshRendererSettings rendererSettings() const
Returns renderer settings.
QgsMeshDatasetIndex staticVectorDatasetIndex() const
Returns the static vector dataset index that is rendered if the temporal properties is not active.
QgsMeshDatasetIndex staticScalarDatasetIndex() const
Returns the static scalar dataset index that is rendered if the temporal properties is not active.
QgsInterval datasetRelativeTime(const QgsMeshDatasetIndex &index)
Returns the relative time of the dataset from the reference time of its group.
QString formatTime(double hours)
Returns (date) time in hours formatted to human readable form.
QgsMeshDatasetGroupMetadata datasetGroupMetadata(const QgsMeshDatasetIndex &index) const
Returns the dataset groups metadata.
int activeVectorDatasetGroup() const
Returns the active vector dataset group.
int activeScalarDatasetGroup() const
Returns the active scalar dataset group.