Skip to content

Commit b86498a

Browse files
committedJun 20, 2012
Add checkbox for invert color to raster symbol dialog
1 parent 480c860 commit b86498a

File tree

2 files changed

+80
-63
lines changed

2 files changed

+80
-63
lines changed
 

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer* lyr, QgsMapCanv
204204
//set combo boxes to current resampling types
205205
if ( renderer )
206206
{
207+
//invert color map
208+
if ( renderer->invertColor() )
209+
{
210+
mInvertColorMapCheckBox->setCheckState( Qt::Checked );
211+
}
212+
207213
const QgsRasterResampler* zoomedInResampler = renderer->zoomedInResampler();
208214
if ( zoomedInResampler )
209215
{
@@ -781,6 +787,9 @@ void QgsRasterLayerProperties::apply()
781787
//set global transparency
782788
rasterRenderer->setOpacity(( 255 - sliderTransparency->value() ) / 255.0 );
783789

790+
//invert color map
791+
rasterRenderer->setInvertColor( mInvertColorMapCheckBox->isChecked() );
792+
784793
QgsDebugMsg( "processing general tab" );
785794
/*
786795
* General Tab

‎src/ui/qgsrasterlayerpropertiesbase.ui

Lines changed: 71 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<item row="0" column="0" colspan="4">
2929
<widget class="QTabWidget" name="tabBar">
3030
<property name="currentIndex">
31-
<number>1</number>
31+
<number>0</number>
3232
</property>
3333
<property name="iconSize">
3434
<size>
@@ -45,46 +45,7 @@
4545
<string comment="mRendererTab">Style</string>
4646
</attribute>
4747
<layout class="QGridLayout" name="gridLayout_10">
48-
<item row="0" column="0">
49-
<widget class="QGroupBox" name="mResamplingGroupBox_2">
50-
<property name="title">
51-
<string>Resampling</string>
52-
</property>
53-
<layout class="QGridLayout" name="gridLayout_9">
54-
<item row="0" column="0">
55-
<widget class="QLabel" name="mZoomedInResamplingLabel">
56-
<property name="text">
57-
<string>Zoomed in</string>
58-
</property>
59-
</widget>
60-
</item>
61-
<item row="0" column="1">
62-
<widget class="QLabel" name="mZoomedOutResamplingLabel">
63-
<property name="text">
64-
<string>Zoomed out</string>
65-
</property>
66-
</widget>
67-
</item>
68-
<item row="0" column="2">
69-
<widget class="QLabel" name="mMaximumOversamplingLabel">
70-
<property name="text">
71-
<string>Maximum oversampling</string>
72-
</property>
73-
</widget>
74-
</item>
75-
<item row="1" column="0">
76-
<widget class="QComboBox" name="mZoomedInResamplingComboBox"/>
77-
</item>
78-
<item row="1" column="1">
79-
<widget class="QComboBox" name="mZoomedOutResamplingComboBox"/>
80-
</item>
81-
<item row="1" column="2">
82-
<widget class="QDoubleSpinBox" name="mMaximumOversamplingSpinBox"/>
83-
</item>
84-
</layout>
85-
</widget>
86-
</item>
87-
<item row="1" column="0">
48+
<item row="3" column="0">
8849
<layout class="QHBoxLayout" name="horizontalLayout_2">
8950
<item>
9051
<widget class="QLabel" name="mRenderTypeLabel">
@@ -142,9 +103,55 @@
142103
</item>
143104
</layout>
144105
</item>
145-
<item row="2" column="0">
106+
<item row="4" column="0">
146107
<widget class="QStackedWidget" name="mRendererStackedWidget"/>
147108
</item>
109+
<item row="0" column="0">
110+
<widget class="QGroupBox" name="mResamplingGroupBox_2">
111+
<property name="title">
112+
<string>Resampling</string>
113+
</property>
114+
<layout class="QGridLayout" name="gridLayout_9">
115+
<item row="0" column="0">
116+
<widget class="QLabel" name="mZoomedInResamplingLabel">
117+
<property name="text">
118+
<string>Zoomed in</string>
119+
</property>
120+
</widget>
121+
</item>
122+
<item row="0" column="1">
123+
<widget class="QLabel" name="mZoomedOutResamplingLabel">
124+
<property name="text">
125+
<string>Zoomed out</string>
126+
</property>
127+
</widget>
128+
</item>
129+
<item row="0" column="2">
130+
<widget class="QLabel" name="mMaximumOversamplingLabel">
131+
<property name="text">
132+
<string>Maximum oversampling</string>
133+
</property>
134+
</widget>
135+
</item>
136+
<item row="1" column="0">
137+
<widget class="QComboBox" name="mZoomedInResamplingComboBox"/>
138+
</item>
139+
<item row="1" column="1">
140+
<widget class="QComboBox" name="mZoomedOutResamplingComboBox"/>
141+
</item>
142+
<item row="1" column="2">
143+
<widget class="QDoubleSpinBox" name="mMaximumOversamplingSpinBox"/>
144+
</item>
145+
</layout>
146+
</widget>
147+
</item>
148+
<item row="2" column="0">
149+
<widget class="QCheckBox" name="mInvertColorMapCheckBox">
150+
<property name="text">
151+
<string>Invert color map</string>
152+
</property>
153+
</widget>
154+
</item>
148155
</layout>
149156
</widget>
150157
<widget class="QWidget" name="tabBarPage2">
@@ -822,27 +829,28 @@ p, li { white-space: pre-wrap; }
822829
&lt;table border=&quot;0&quot; style=&quot;-qt-table-type: root; margin-top:4px; margin-bottom:4px; margin-left:4px; margin-right:4px;&quot;&gt;
823830
&lt;tr&gt;
824831
&lt;td style=&quot;border: none;&quot;&gt;
825-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
826-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
827-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
828-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
829-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
830-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
831-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
832-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;/p&gt;
833-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;/p&gt;
834-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
835-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;/p&gt;
836-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
837-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
838-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
839-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
840-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
841-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
842-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
843-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
844-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;/p&gt;
845-
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';&quot;&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
832+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
833+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
834+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
835+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
836+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
837+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
838+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
839+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
840+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
841+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
842+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
843+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
844+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
845+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
846+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
847+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
848+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
849+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
850+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
851+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
852+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
853+
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;</string>
846854
</property>
847855
</widget>
848856
</item>

0 commit comments

Comments
 (0)
Please sign in to comment.