Skip to content

Commit 4f8c9e1

Browse files
PeterPetriknirvn
authored andcommittedJul 6, 2018
also use color ramp shader widget for pseudo color renderer (#7358)
1 parent a261a66 commit 4f8c9e1

8 files changed

+190
-1083
lines changed
 

‎python/gui/auto_generated/raster/qgscolorrampshaderwidget.sip.in

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,24 +32,44 @@ The other mode is used to style mesh layer contours (scalar datasets)
3232
Creates new color ramp shader widget
3333
%End
3434

35-
void initForUseWithRasterLayer();
35+
void initializeForUseWithRasterLayer();
3636
%Docstring
3737
Allows quantile classification mode for raster layers
3838
%End
3939

40-
void setRasterBand( QgsRasterDataProvider *dp, int band, const QgsRectangle &extent );
40+
void setRasterDataProvider( QgsRasterDataProvider *dp );
4141
%Docstring
42-
Associates raster with the widget
42+
Associates raster with the widget, only when used for raster layer
4343
%End
4444

45-
void setMinMaxAndClassify( double min, double max );
45+
void setRasterBand( int band );
46+
%Docstring
47+
Sets raster band, only when used for raster layer
48+
%End
49+
50+
void setExtent( const QgsRectangle &extent );
51+
%Docstring
52+
Sets extent, only when used for raster layer
53+
%End
54+
55+
void setMinimumMaximumAndClassify( double minimum, double maximum );
4656
%Docstring
4757
Sets min max and classify color tree
4858
%End
4959

50-
void setMinMax( double min, double max );
60+
void setMinimumMaximum( double minimum, double maximum );
5161
%Docstring
5262
Sets min max
63+
%End
64+
65+
double minimum() const;
66+
%Docstring
67+
Gets min value
68+
%End
69+
70+
double maximum() const;
71+
%Docstring
72+
Gets max value
5373
%End
5474

5575
QgsColorRampShader shader() const;
@@ -63,7 +83,7 @@ Sets widget state from the color ramp shader
6383
%End
6484

6585
signals:
66-
void minMaxChangedFromTree( double min, double max );
86+
void minimumMaximumChangedFromTree( double minimum, double maximum );
6787
%Docstring
6888
Color ramp tree has changed
6989
%End
@@ -85,7 +105,7 @@ Classification mode changed
85105
Executes the single band pseudo raster classification
86106
%End
87107

88-
void loadMinMaxFromTree();
108+
void loadMinimumMaximumFromTree();
89109
%Docstring
90110
Loads min and max values from color ramp tree
91111
%End

‎python/gui/auto_generated/raster/qgssinglebandpseudocolorrendererwidget.sip.in

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,53 +12,58 @@
1212

1313
class QgsSingleBandPseudoColorRendererWidget: QgsRasterRendererWidget
1414
{
15+
%Docstring
16+
17+
Single band pseudo color renderer widget consists of a color ramp shader widget,
18+
a raster min max widget and a band selector.
19+
%End
1520

1621
%TypeHeaderCode
1722
#include "qgssinglebandpseudocolorrendererwidget.h"
1823
%End
1924
public:
2025

2126
QgsSingleBandPseudoColorRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent = QgsRectangle() );
27+
%Docstring
28+
Creates new raster renderer widget
29+
%End
2230

2331
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) /Factory/;
24-
virtual QgsRasterRenderer *renderer();
25-
26-
27-
QgsColorRampShader *shaderFunction() const /Factory/;
2832
%Docstring
29-
Returns shader function used in the renderer. Caller takes ownership and deletes it.
33+
Creates new raster renderer widget
3034
%End
35+
36+
virtual QgsRasterRenderer *renderer();
37+
3138
virtual void setMapCanvas( QgsMapCanvas *canvas );
3239

3340
virtual void doComputations();
3441

3542
virtual QgsRasterMinMaxWidget *minMaxWidget();
3643

44+
3745
int currentBand() const;
3846
%Docstring
3947
Returns the current raster band number
4048
%End
4149

4250
void setFromRenderer( const QgsRasterRenderer *r );
43-
44-
public slots:
45-
46-
void classify();
4751
%Docstring
48-
Executes the single band pseudo raster classficiation
52+
Set state of the widget from renderer settings
4953
%End
54+
55+
public slots:
5056
void loadMinMax( int bandNo, double min, double max );
5157
%Docstring
5258
called when new min/max values are loaded
5359
%End
54-
void loadMinMaxFromTree();
60+
void loadMinMaxFromTree( double min, double max );
5561
%Docstring
5662
called when the color ramp tree has changed
5763
%End
5864

5965
};
6066

61-
6267
/************************************************************************
6368
* This file has been generated automatically from *
6469
* *

‎src/app/mesh/qgsmeshrendererscalarsettingswidget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ void QgsMeshRendererScalarSettingsWidget::minMaxChanged()
7979
{
8080
double min = lineEditValue( mScalarMinLineEdit );
8181
double max = lineEditValue( mScalarMaxLineEdit );
82-
mScalarColorRampShaderWidget->setMinMax( min, max );
82+
mScalarColorRampShaderWidget->setMinimumMaximum( min, max );
8383
}
8484

8585
void QgsMeshRendererScalarSettingsWidget::minMaxEdited()
8686
{
8787
double min = lineEditValue( mScalarMinLineEdit );
8888
double max = lineEditValue( mScalarMaxLineEdit );
89-
mScalarColorRampShaderWidget->setMinMaxAndClassify( min, max );
89+
mScalarColorRampShaderWidget->setMinimumMaximumAndClassify( min, max );
9090
}
9191

9292
void QgsMeshRendererScalarSettingsWidget::recalculateMinMaxButtonClicked()
@@ -95,7 +95,7 @@ void QgsMeshRendererScalarSettingsWidget::recalculateMinMaxButtonClicked()
9595
calcMinMax( mActiveDataset, min, max );
9696
whileBlocking( mScalarMinLineEdit )->setText( QString::number( min ) );
9797
whileBlocking( mScalarMaxLineEdit )->setText( QString::number( max ) );
98-
mScalarColorRampShaderWidget->setMinMaxAndClassify( min, max );
98+
mScalarColorRampShaderWidget->setMinimumMaximumAndClassify( min, max );
9999
}
100100

101101
void QgsMeshRendererScalarSettingsWidget::setActiveDataset( int activeDataset )

‎src/gui/raster/qgscolorrampshaderwidget.cpp

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,32 @@ QgsColorRampShaderWidget::QgsColorRampShaderWidget( QWidget *parent )
9090
connect( mClassifyButton, &QPushButton::clicked, this, &QgsColorRampShaderWidget::applyColorRamp );
9191
connect( btnColorRamp, &QgsColorRampButton::colorRampChanged, this, &QgsColorRampShaderWidget::applyColorRamp );
9292
connect( mNumberOfEntriesSpinBox, static_cast < void ( QSpinBox::* )( int ) > ( &QSpinBox::valueChanged ), this, &QgsColorRampShaderWidget::classify );
93+
connect( mClipCheckBox, &QAbstractButton::toggled, this, &QgsColorRampShaderWidget::widgetChanged );
9394
}
9495

95-
void QgsColorRampShaderWidget::initForUseWithRasterLayer()
96+
void QgsColorRampShaderWidget::initializeForUseWithRasterLayer()
9697
{
9798
Q_ASSERT( mClassificationModeComboBox->findData( QgsColorRampShader::Quantile < 0 ) );
9899
mClassificationModeComboBox->addItem( tr( "Quantile" ), QgsColorRampShader::Quantile );
99100
mLoadFromBandButton->setVisible( bool( mRasterDataProvider ) ); // only for raster version
100101
}
101102

102-
void QgsColorRampShaderWidget::setRasterBand( QgsRasterDataProvider *dp,
103-
int band,
104-
const QgsRectangle &extent )
103+
void QgsColorRampShaderWidget::setRasterDataProvider( QgsRasterDataProvider *dp )
105104
{
106105
mRasterDataProvider = dp;
106+
loadMinimumMaximumFromTree();
107+
}
108+
109+
void QgsColorRampShaderWidget::setRasterBand( int band )
110+
{
107111
mBand = band;
112+
loadMinimumMaximumFromTree();
113+
}
114+
115+
void QgsColorRampShaderWidget::setExtent( const QgsRectangle &extent )
116+
{
108117
mExtent = extent;
118+
loadMinimumMaximumFromTree();
109119
}
110120

111121
QgsColorRampShader QgsColorRampShaderWidget::shader() const
@@ -265,7 +275,7 @@ void QgsColorRampShaderWidget::mAddEntryButton_clicked()
265275
mColormapTreeWidget->sortItems( ValueColumn, Qt::AscendingOrder );
266276
autoLabel();
267277

268-
loadMinMaxFromTree();
278+
loadMinimumMaximumFromTree();
269279
emit widgetChanged();
270280
}
271281

@@ -283,7 +293,7 @@ void QgsColorRampShaderWidget::mDeleteEntryButton_clicked()
283293
delete item;
284294
}
285295

286-
loadMinMaxFromTree();
296+
loadMinimumMaximumFromTree();
287297
emit widgetChanged();
288298
}
289299

@@ -400,7 +410,7 @@ void QgsColorRampShaderWidget::mLoadFromBandButton_clicked()
400410
QMessageBox::warning( this, tr( "Load Color Map" ), tr( "The color map for band %1 has no entries." ).arg( mBand ) );
401411
}
402412

403-
loadMinMaxFromTree();
413+
loadMinimumMaximumFromTree();
404414
emit widgetChanged();
405415
}
406416

@@ -492,7 +502,7 @@ void QgsColorRampShaderWidget::mLoadFromFileButton_clicked()
492502
QMessageBox::warning( this, tr( "Load Color Map from File" ), tr( "Read access denied. Adjust the file permissions and try again.\n\n" ) );
493503
}
494504

495-
loadMinMaxFromTree();
505+
loadMinimumMaximumFromTree();
496506
emit widgetChanged();
497507
}
498508

@@ -577,7 +587,7 @@ void QgsColorRampShaderWidget::mColormapTreeWidget_itemDoubleClicked( QTreeWidge
577587
if ( newColor.isValid() )
578588
{
579589
item->setBackground( ColorColumn, QBrush( newColor ) );
580-
loadMinMaxFromTree();
590+
loadMinimumMaximumFromTree();
581591
emit widgetChanged();
582592
}
583593
}
@@ -601,7 +611,7 @@ void QgsColorRampShaderWidget::mColormapTreeWidget_itemEdited( QTreeWidgetItem *
601611
mColormapTreeWidget->sortItems( ValueColumn, Qt::AscendingOrder );
602612
autoLabel();
603613

604-
loadMinMaxFromTree();
614+
loadMinimumMaximumFromTree();
605615

606616
emit widgetChanged();
607617
}
@@ -678,25 +688,35 @@ void QgsColorRampShaderWidget::mColorInterpolationComboBox_currentIndexChanged(
678688
emit widgetChanged();
679689
}
680690

681-
void QgsColorRampShaderWidget::setMinMaxAndClassify( double min, double max )
691+
void QgsColorRampShaderWidget::setMinimumMaximumAndClassify( double min, double max )
682692
{
683693
if ( !qgsDoubleNear( mMin, min ) || !qgsDoubleNear( mMax, max ) )
684694
{
685-
mMin = min;
686-
mMax = max;
687-
695+
setMinimumMaximum( min, max );
688696
classify();
689697
}
690698
}
691699

692-
void QgsColorRampShaderWidget::setMinMax( double min, double max )
700+
void QgsColorRampShaderWidget::setMinimumMaximum( double min, double max )
693701
{
694702
mMin = min;
695703
mMax = max;
696704
resetClassifyButton();
697705
}
698706

699-
void QgsColorRampShaderWidget::loadMinMaxFromTree()
707+
double QgsColorRampShaderWidget::minimum() const
708+
{
709+
return mMin;
710+
}
711+
712+
double QgsColorRampShaderWidget::maximum() const
713+
{
714+
return mMax;
715+
}
716+
717+
718+
719+
void QgsColorRampShaderWidget::loadMinimumMaximumFromTree()
700720
{
701721
QTreeWidgetItem *item = mColormapTreeWidget->topLevelItem( 0 );
702722
if ( !item )
@@ -712,7 +732,7 @@ void QgsColorRampShaderWidget::loadMinMaxFromTree()
712732
{
713733
mMin = min;
714734
mMax = max;
715-
emit minMaxChangedFromTree( min, max );
735+
emit minimumMaximumChangedFromTree( min, max );
716736
}
717737
}
718738

@@ -744,7 +764,7 @@ void QgsColorRampShaderWidget::changeColor()
744764
item->setBackground( ColorColumn, QBrush( newColor ) );
745765
}
746766

747-
loadMinMaxFromTree();
767+
loadMinimumMaximumFromTree();
748768
emit widgetChanged();
749769
}
750770
}
@@ -772,7 +792,7 @@ void QgsColorRampShaderWidget::changeOpacity()
772792
item->setBackground( ColorColumn, QBrush( newColor ) );
773793
}
774794

775-
loadMinMaxFromTree();
795+
loadMinimumMaximumFromTree();
776796
emit widgetChanged();
777797
}
778798
}

‎src/gui/raster/qgscolorrampshaderwidget.h

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,28 @@ class GUI_EXPORT QgsColorRampShaderWidget: public QWidget, protected Ui::QgsColo
4949
QgsColorRampShaderWidget( QWidget *parent = nullptr );
5050

5151
//! Allows quantile classification mode for raster layers
52-
void initForUseWithRasterLayer();
52+
void initializeForUseWithRasterLayer();
5353

54-
//! Associates raster with the widget
55-
void setRasterBand( QgsRasterDataProvider *dp, int band, const QgsRectangle &extent );
54+
//! Associates raster with the widget, only when used for raster layer
55+
void setRasterDataProvider( QgsRasterDataProvider *dp );
56+
57+
//! Sets raster band, only when used for raster layer
58+
void setRasterBand( int band );
59+
60+
//! Sets extent, only when used for raster layer
61+
void setExtent( const QgsRectangle &extent );
5662

5763
//! Sets min max and classify color tree
58-
void setMinMaxAndClassify( double min, double max );
64+
void setMinimumMaximumAndClassify( double minimum, double maximum );
5965

6066
//! Sets min max
61-
void setMinMax( double min, double max );
67+
void setMinimumMaximum( double minimum, double maximum );
68+
69+
//! Gets min value
70+
double minimum() const;
71+
72+
//! Gets max value
73+
double maximum() const;
6274

6375
//! Returns shared function used in the renderer
6476
QgsColorRampShader shader() const;
@@ -68,7 +80,7 @@ class GUI_EXPORT QgsColorRampShaderWidget: public QWidget, protected Ui::QgsColo
6880

6981
signals:
7082
//! Color ramp tree has changed
71-
void minMaxChangedFromTree( double min, double max );
83+
void minimumMaximumChangedFromTree( double minimum, double maximum );
7284

7385
//! Widget changed
7486
void widgetChanged();
@@ -84,7 +96,7 @@ class GUI_EXPORT QgsColorRampShaderWidget: public QWidget, protected Ui::QgsColo
8496
void classify();
8597

8698
//! Loads min and max values from color ramp tree
87-
void loadMinMaxFromTree();
99+
void loadMinimumMaximumFromTree();
88100

89101
protected:
90102
//! Populates color ramp tree from ramp items
@@ -101,8 +113,8 @@ class GUI_EXPORT QgsColorRampShaderWidget: public QWidget, protected Ui::QgsColo
101113

102114
/**
103115
* Generate labels from the values in the color map.
104-
* Skip labels which were manually edited (black text).
105-
* Text of generated labels is made gray
116+
* Skip labels which were manually edited (black text).
117+
* Text of generated labels is made gray
106118
*/
107119
void autoLabel();
108120

‎src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp

Lines changed: 36 additions & 671 deletions
Large diffs are not rendered by default.

‎src/gui/raster/qgssinglebandpseudocolorrendererwidget.h

Lines changed: 13 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class QgsRasterMinMaxWidget;
3030
/**
3131
* \ingroup gui
3232
* \class QgsSingleBandPseudoColorRendererWidget
33+
*
34+
* Single band pseudo color renderer widget consists of a color ramp shader widget,
35+
* a raster min max widget and a band selector.
36+
*
3337
*/
3438
class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendererWidget, private Ui::QgsSingleBandPseudoColorRendererWidgetBase
3539
{
@@ -38,87 +42,45 @@ class GUI_EXPORT QgsSingleBandPseudoColorRendererWidget: public QgsRasterRendere
3842

3943
public:
4044

45+
//! Creates new raster renderer widget
4146
QgsSingleBandPseudoColorRendererWidget( QgsRasterLayer *layer, const QgsRectangle &extent = QgsRectangle() );
4247

48+
//! Creates new raster renderer widget
4349
static QgsRasterRendererWidget *create( QgsRasterLayer *layer, const QgsRectangle &extent ) SIP_FACTORY { return new QgsSingleBandPseudoColorRendererWidget( layer, extent ); }
44-
QgsRasterRenderer *renderer() override;
4550

46-
//! Returns shader function used in the renderer. Caller takes ownership and deletes it.
47-
QgsColorRampShader *shaderFunction() const SIP_FACTORY;
51+
QgsRasterRenderer *renderer() override;
4852
void setMapCanvas( QgsMapCanvas *canvas ) override;
4953
void doComputations() override;
50-
QgsRasterMinMaxWidget *minMaxWidget() override { return mMinMaxWidget; }
54+
QgsRasterMinMaxWidget *minMaxWidget() override;
5155

5256
//! Returns the current raster band number
5357
int currentBand() const;
5458

59+
//! Set state of the widget from renderer settings
5560
void setFromRenderer( const QgsRasterRenderer *r );
5661

5762
public slots:
58-
59-
/**
60-
* Executes the single band pseudo raster classficiation
61-
*/
62-
void classify();
6363
//! called when new min/max values are loaded
6464
void loadMinMax( int bandNo, double min, double max );
6565
//! called when the color ramp tree has changed
66-
void loadMinMaxFromTree();
67-
68-
private:
69-
70-
enum Column
71-
{
72-
ValueColumn = 0,
73-
ColorColumn = 1,
74-
LabelColumn = 2,
75-
};
76-
77-
void populateColormapTreeWidget( const QList<QgsColorRampShader::ColorRampItem> &colorRampItems );
78-
79-
/**
80-
* Generate labels from the values in the color map.
81-
* Skip labels which were manually edited (black text).
82-
* Text of generated labels is made gray
83-
*/
84-
void autoLabel();
85-
86-
//! Extract the unit out of the current labels and set the unit field.
87-
void setUnitFromLabels();
88-
89-
QMenu *contextMenu = nullptr;
66+
void loadMinMaxFromTree( double min, double max );
9067

9168
private slots:
92-
93-
void applyColorRamp();
94-
void mAddEntryButton_clicked();
95-
void mDeleteEntryButton_clicked();
9669
void mLoadFromBandButton_clicked();
97-
void mLoadFromFileButton_clicked();
98-
void mExportToFileButton_clicked();
99-
void mUnitLineEdit_textEdited( const QString &text ) { Q_UNUSED( text ); autoLabel(); }
100-
void mColormapTreeWidget_itemDoubleClicked( QTreeWidgetItem *item, int column );
101-
void mColormapTreeWidget_itemEdited( QTreeWidgetItem *item, int column );
10270
void bandChanged();
103-
void mColorInterpolationComboBox_currentIndexChanged( int index );
104-
void mMinLineEdit_textChanged( const QString & ) { resetClassifyButton(); }
105-
void mMaxLineEdit_textChanged( const QString & ) { resetClassifyButton(); }
71+
void mMinLineEdit_textChanged( const QString & );
72+
void mMaxLineEdit_textChanged( const QString & );
10673
void mMinLineEdit_textEdited( const QString &text );
10774
void mMaxLineEdit_textEdited( const QString &text );
108-
void mClassificationModeComboBox_currentIndexChanged( int index );
109-
void changeColor();
110-
void changeOpacity();
11175

11276
private:
113-
11477
void setLineEditValue( QLineEdit *lineEdit, double value );
11578
double lineEditValue( const QLineEdit *lineEdit ) const;
116-
void resetClassifyButton();
79+
11780
QgsRasterMinMaxWidget *mMinMaxWidget = nullptr;
11881
int mMinMaxOrigin;
11982

12083
void minMaxModified();
12184
};
12285

123-
12486
#endif // QGSSINGLEBANDCOLORRENDERERWIDGET_H

‎src/ui/qgssinglebandpseudocolorrendererwidgetbase.ui

Lines changed: 34 additions & 311 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<property name="windowTitle">
1414
<string>Form</string>
1515
</property>
16-
<layout class="QGridLayout" name="gridLayout">
16+
<layout class="QVBoxLayout" name="verticalLayout">
1717
<property name="leftMargin">
1818
<number>3</number>
1919
</property>
@@ -26,286 +26,57 @@
2626
<property name="bottomMargin">
2727
<number>3</number>
2828
</property>
29-
<item row="6" column="0" colspan="5">
30-
<widget class="QTreeWidget" name="mColormapTreeWidget">
31-
<property name="sizePolicy">
32-
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
33-
<horstretch>0</horstretch>
34-
<verstretch>0</verstretch>
35-
</sizepolicy>
36-
</property>
37-
<property name="minimumSize">
38-
<size>
39-
<width>0</width>
40-
<height>250</height>
41-
</size>
42-
</property>
43-
<attribute name="headerDefaultSectionSize">
44-
<number>70</number>
45-
</attribute>
46-
<attribute name="headerMinimumSectionSize">
47-
<number>10</number>
48-
</attribute>
49-
<attribute name="headerStretchLastSection">
50-
<bool>true</bool>
51-
</attribute>
52-
<column>
53-
<property name="text">
54-
<string>Value</string>
55-
</property>
56-
</column>
57-
<column>
58-
<property name="text">
59-
<string>Color</string>
60-
</property>
61-
</column>
62-
<column>
63-
<property name="text">
64-
<string>Label</string>
65-
</property>
66-
</column>
67-
</widget>
68-
</item>
69-
<item row="4" column="1" colspan="4">
70-
<widget class="QgsColorRampButton" name="btnColorRamp">
71-
<property name="sizePolicy">
72-
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
73-
<horstretch>0</horstretch>
74-
<verstretch>0</verstretch>
75-
</sizepolicy>
76-
</property>
77-
<property name="minimumSize">
78-
<size>
79-
<width>120</width>
80-
<height>0</height>
81-
</size>
82-
</property>
83-
<property name="maximumSize">
84-
<size>
85-
<width>16777215</width>
86-
<height>16777215</height>
87-
</size>
88-
</property>
89-
</widget>
90-
</item>
91-
<item row="4" column="0">
92-
<widget class="QLabel" name="mColorInterpolationLabel_2">
93-
<property name="text">
94-
<string>Color ramp</string>
95-
</property>
96-
</widget>
97-
</item>
98-
<item row="1" column="4">
99-
<widget class="QLineEdit" name="mMaxLineEdit"/>
100-
</item>
101-
<item row="1" column="1">
102-
<widget class="QLabel" name="mMinLabel">
103-
<property name="sizePolicy">
104-
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
105-
<horstretch>0</horstretch>
106-
<verstretch>0</verstretch>
107-
</sizepolicy>
108-
</property>
109-
<property name="text">
110-
<string>Min</string>
111-
</property>
112-
</widget>
113-
</item>
114-
<item row="3" column="1" colspan="4">
115-
<widget class="QComboBox" name="mColorInterpolationComboBox"/>
116-
</item>
117-
<item row="0" column="1" colspan="4">
118-
<widget class="QgsRasterBandComboBox" name="mBandComboBox"/>
119-
</item>
120-
<item row="0" column="0">
121-
<widget class="QLabel" name="mBandLabel">
122-
<property name="text">
123-
<string>Band</string>
124-
</property>
125-
</widget>
126-
</item>
127-
<item row="1" column="3">
128-
<widget class="QLabel" name="mMaxLabel">
129-
<property name="sizePolicy">
130-
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
131-
<horstretch>0</horstretch>
132-
<verstretch>0</verstretch>
133-
</sizepolicy>
134-
</property>
135-
<property name="text">
136-
<string>Max</string>
137-
</property>
138-
</widget>
139-
</item>
140-
<item row="3" column="0">
141-
<widget class="QLabel" name="mColorInterpolationLabel">
142-
<property name="text">
143-
<string>Interpolation</string>
144-
</property>
145-
</widget>
146-
</item>
147-
<item row="8" column="0" colspan="5">
148-
<layout class="QHBoxLayout" name="horizontalLayout_3">
149-
<item>
150-
<widget class="QPushButton" name="mClassifyButton">
151-
<property name="text">
152-
<string>Classify</string>
153-
</property>
154-
</widget>
29+
<item>
30+
<layout class="QGridLayout" name="gridLayout_2">
31+
<item row="1" column="1">
32+
<widget class="QLineEdit" name="mMinLineEdit"/>
15533
</item>
156-
<item>
157-
<widget class="QPushButton" name="mAddEntryButton">
158-
<property name="toolTip">
159-
<string>Add values manually</string>
160-
</property>
161-
<property name="icon">
162-
<iconset resource="../../images/images.qrc">
163-
<normaloff>:/images/themes/default/symbologyAdd.svg</normaloff>:/images/themes/default/symbologyAdd.svg</iconset>
164-
</property>
165-
</widget>
166-
</item>
167-
<item>
168-
<widget class="QPushButton" name="mDeleteEntryButton">
169-
<property name="toolTip">
170-
<string>Remove selected row(s)</string>
171-
</property>
172-
<property name="icon">
173-
<iconset resource="../../images/images.qrc">
174-
<normaloff>:/images/themes/default/symbologyRemove.svg</normaloff>:/images/themes/default/symbologyRemove.svg</iconset>
175-
</property>
176-
</widget>
177-
</item>
178-
<item>
179-
<widget class="QPushButton" name="mLoadFromBandButton">
180-
<property name="toolTip">
181-
<string>Load color map from band</string>
182-
</property>
183-
<property name="icon">
184-
<iconset resource="../../images/images.qrc">
185-
<normaloff>:/images/themes/default/mActionReload.svg</normaloff>:/images/themes/default/mActionReload.svg</iconset>
186-
</property>
187-
</widget>
188-
</item>
189-
<item>
190-
<widget class="QPushButton" name="mLoadFromFileButton">
191-
<property name="toolTip">
192-
<string>Load color map from file</string>
193-
</property>
194-
<property name="icon">
195-
<iconset resource="../../images/images.qrc">
196-
<normaloff>:/images/themes/default/mActionFileOpen.svg</normaloff>:/images/themes/default/mActionFileOpen.svg</iconset>
197-
</property>
198-
</widget>
199-
</item>
200-
<item>
201-
<widget class="QPushButton" name="mExportToFileButton">
202-
<property name="toolTip">
203-
<string>Export color map to file</string>
204-
</property>
205-
<property name="icon">
206-
<iconset resource="../../images/images.qrc">
207-
<normaloff>:/images/themes/default/mActionFileSaveAs.svg</normaloff>:/images/themes/default/mActionFileSaveAs.svg</iconset>
208-
</property>
209-
</widget>
210-
</item>
211-
<item>
212-
<spacer name="horizontalSpacer">
213-
<property name="orientation">
214-
<enum>Qt::Horizontal</enum>
215-
</property>
216-
<property name="sizeHint" stdset="0">
217-
<size>
218-
<width>48</width>
219-
<height>28</height>
220-
</size>
34+
<item row="1" column="0">
35+
<widget class="QLabel" name="mMinLabel">
36+
<property name="sizePolicy">
37+
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
38+
<horstretch>0</horstretch>
39+
<verstretch>0</verstretch>
40+
</sizepolicy>
22141
</property>
222-
</spacer>
223-
</item>
224-
</layout>
225-
</item>
226-
<item row="1" column="2">
227-
<widget class="QLineEdit" name="mMinLineEdit"/>
228-
</item>
229-
<item row="9" column="0" colspan="5">
230-
<widget class="QCheckBox" name="mClipCheckBox">
231-
<property name="toolTip">
232-
<string>If checked, any pixels with a value out of range will not be rendered</string>
233-
</property>
234-
<property name="text">
235-
<string>Clip out of range values</string>
236-
</property>
237-
</widget>
238-
</item>
239-
<item row="7" column="0" colspan="5">
240-
<layout class="QHBoxLayout" name="horizontalLayout_5">
241-
<item>
242-
<widget class="QLabel" name="mClassificationModeLabel">
24342
<property name="text">
244-
<string>Mode</string>
43+
<string>Min</string>
24544
</property>
24645
</widget>
24746
</item>
248-
<item>
249-
<widget class="QComboBox" name="mClassificationModeComboBox"/>
250-
</item>
251-
<item>
252-
<spacer name="horizontalSpacer_4">
253-
<property name="orientation">
254-
<enum>Qt::Horizontal</enum>
255-
</property>
256-
<property name="sizeHint" stdset="0">
257-
<size>
258-
<width>40</width>
259-
<height>20</height>
260-
</size>
261-
</property>
262-
</spacer>
263-
</item>
264-
<item>
265-
<widget class="QLabel" name="mNumberOfEntriesLabel">
47+
<item row="0" column="0">
48+
<widget class="QLabel" name="mBandLabel">
26649
<property name="text">
267-
<string>Classes</string>
50+
<string>Band</string>
26851
</property>
26952
</widget>
27053
</item>
271-
<item>
272-
<widget class="QSpinBox" name="mNumberOfEntriesSpinBox">
54+
<item row="1" column="2">
55+
<widget class="QLabel" name="mMaxLabel">
27356
<property name="sizePolicy">
274-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
57+
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
27558
<horstretch>0</horstretch>
27659
<verstretch>0</verstretch>
27760
</sizepolicy>
27861
</property>
279-
<property name="minimum">
280-
<number>2</number>
281-
</property>
282-
<property name="maximum">
283-
<number>255</number>
284-
</property>
285-
<property name="value">
286-
<number>5</number>
62+
<property name="text">
63+
<string>Max</string>
28764
</property>
28865
</widget>
28966
</item>
67+
<item row="1" column="3">
68+
<widget class="QLineEdit" name="mMaxLineEdit"/>
69+
</item>
70+
<item row="0" column="1" colspan="3">
71+
<widget class="QgsRasterBandComboBox" name="mBandComboBox"/>
72+
</item>
29073
</layout>
29174
</item>
292-
<item row="5" column="1" colspan="4">
293-
<widget class="QLineEdit" name="mUnitLineEdit">
294-
<property name="toolTip">
295-
<string>Unit suffix</string>
296-
</property>
297-
</widget>
298-
</item>
299-
<item row="2" column="0" colspan="5">
75+
<item>
30076
<widget class="QWidget" name="mMinMaxContainerWidget" native="true"/>
30177
</item>
302-
<item row="5" column="0">
303-
<widget class="QLabel" name="mUnitLabel">
304-
<property name="text">
305-
<string>Label unit
306-
suffix</string>
307-
</property>
308-
</widget>
78+
<item>
79+
<widget class="QgsColorRampShaderWidget" name="mColorRampShaderWidget" native="true"/>
30980
</item>
31081
</layout>
31182
</widget>
@@ -316,60 +87,12 @@ suffix</string>
31687
<header>raster/qgsrasterbandcombobox.h</header>
31788
</customwidget>
31889
<customwidget>
319-
<class>QgsColorRampButton</class>
320-
<extends>QToolButton</extends>
321-
<header>qgscolorrampbutton.h</header>
90+
<class>QgsColorRampShaderWidget</class>
91+
<extends>QWidget</extends>
92+
<header>raster/qgscolorrampshaderwidget.h</header>
32293
<container>1</container>
32394
</customwidget>
32495
</customwidgets>
325-
<tabstops>
326-
<tabstop>mBandComboBox</tabstop>
327-
<tabstop>mMinLineEdit</tabstop>
328-
<tabstop>mMaxLineEdit</tabstop>
329-
<tabstop>mColorInterpolationComboBox</tabstop>
330-
<tabstop>btnColorRamp</tabstop>
331-
<tabstop>mUnitLineEdit</tabstop>
332-
<tabstop>mColormapTreeWidget</tabstop>
333-
<tabstop>mClassificationModeComboBox</tabstop>
334-
<tabstop>mNumberOfEntriesSpinBox</tabstop>
335-
<tabstop>mClassifyButton</tabstop>
336-
<tabstop>mAddEntryButton</tabstop>
337-
<tabstop>mDeleteEntryButton</tabstop>
338-
<tabstop>mLoadFromBandButton</tabstop>
339-
<tabstop>mLoadFromFileButton</tabstop>
340-
<tabstop>mExportToFileButton</tabstop>
341-
<tabstop>mClipCheckBox</tabstop>
342-
</tabstops>
343-
<resources>
344-
<include location="../../images/images.qrc"/>
345-
<include location="../../images/images.qrc"/>
346-
<include location="../../images/images.qrc"/>
347-
<include location="../../images/images.qrc"/>
348-
<include location="../../images/images.qrc"/>
349-
<include location="../../images/images.qrc"/>
350-
<include location="../../images/images.qrc"/>
351-
<include location="../../images/images.qrc"/>
352-
<include location="../../images/images.qrc"/>
353-
<include location="../../images/images.qrc"/>
354-
<include location="../../images/images.qrc"/>
355-
<include location="../../images/images.qrc"/>
356-
<include location="../../images/images.qrc"/>
357-
<include location="../../images/images.qrc"/>
358-
<include location="../../images/images.qrc"/>
359-
<include location="../../images/images.qrc"/>
360-
<include location="../../images/images.qrc"/>
361-
<include location="../../images/images.qrc"/>
362-
<include location="../../images/images.qrc"/>
363-
<include location="../../images/images.qrc"/>
364-
<include location="../../images/images.qrc"/>
365-
<include location="../../images/images.qrc"/>
366-
<include location="../../images/images.qrc"/>
367-
<include location="../../images/images.qrc"/>
368-
<include location="../../images/images.qrc"/>
369-
<include location="../../images/images.qrc"/>
370-
<include location="../../images/images.qrc"/>
371-
<include location="../../images/images.qrc"/>
372-
<include location="../../images/images.qrc"/>
373-
</resources>
96+
<resources/>
37497
<connections/>
37598
</ui>

0 commit comments

Comments
 (0)
Please sign in to comment.