Skip to content
Permalink
Browse files

Small adjustments for meshes

  • Loading branch information
elpaso committed Nov 5, 2020
1 parent 885c970 commit b3a0ff8a1747f7cda2bea0eab151b6f9646758e7
@@ -20,7 +20,6 @@
#include "qgsmapcanvas.h"
#include "qgsmeshlayer.h"
#include "qgsrasterlayer.h"
#include "raster/qgscolorrampshaderwidget.h"
#include "raster/qgsrasterminmaxwidget.h"
#include "qgsrasterminmaxorigin.h"
#include "qgsmessagelog.h"
@@ -127,13 +127,13 @@ void QgsColorRampShaderWidget::setRasterDataProvider( QgsRasterDataProvider *dp
void QgsColorRampShaderWidget::setRasterBand( int band )
{
mBand = band;
// Assume double by default
Qgis::DataType dataType { ( mRasterDataProvider &&mBand > 0 ) ? mRasterDataProvider->dataType( mBand ) : Qgis::DataType::Float64 };

// Set the maximum number of digits in the precision spin box
if ( mRasterDataProvider )
{
const int maxDigits { QgsGuiUtils::significantDigits( mRasterDataProvider->dataType( mBand ) ) };
mLabelPrecisionSpinBox->setMaximum( maxDigits );
mValueDelegate->setDataType( mRasterDataProvider->dataType( mBand ) );
}
const int maxDigits { QgsGuiUtils::significantDigits( dataType ) };
mLabelPrecisionSpinBox->setMaximum( maxDigits );
mValueDelegate->setDataType( dataType );
}

void QgsColorRampShaderWidget::setExtent( const QgsRectangle &extent )
@@ -265,7 +265,7 @@
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label">
<widget class="QLabel" name="mLabelPrecisionLabel">
<property name="text">
<string>Label precision</string>
</property>

0 comments on commit b3a0ff8

Please sign in to comment.
You can’t perform that action at this time.