Skip to content

Commit 1c0b234

Browse files
author
wonder
committed
Resolved using signed/unsigned value for map layer transparency
git-svn-id: http://svn.osgeo.org/qgis/trunk@5145 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent aa688f1 commit 1c0b234

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

src/gui/qgsmaplayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ class QgsMapLayer : public QObject
304304

305305
public slots:
306306
/** \brief Mutator for transparency level. Should be between 0 and 255 */
307-
virtual void setTransparency(int)=0; //
307+
virtual void setTransparency(unsigned int)=0;
308308
//! event handler for when a coordinate transofrm fails due to bad vertex error
309309
virtual void invalidTransformInput();
310310

src/gui/qgsvectorlayer.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -3448,12 +3448,15 @@ inline void QgsVectorLayer::transformPoints(
34483448
// position on map canvas
34493449
mtp->transformInPlace(x, y);
34503450
}
3451+
34513452
unsigned int QgsVectorLayer::getTransparency()
34523453
{
34533454
return transparencyLevelInt;
34543455
}
3456+
34553457
//should be between 0 and 255
3456-
void QgsVectorLayer::setTransparency(int theInt)
3458+
void QgsVectorLayer::setTransparency(unsigned int theInt)
34573459
{
34583460
transparencyLevelInt=theInt;
3459-
} // QgsRasterLayer::setTransparency(int theInt)
3461+
} // QgsRasterLayer::setTransparency(unsigned int theInt)
3462+

src/gui/qgsvectorlayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ const QString displayField() const { return fieldIndex; }
172172
public slots:
173173

174174
/** \brief Mutator for transparency level. Should be between 0 and 255 */
175-
void setTransparency(int); //
175+
void setTransparency(unsigned int);
176176

177177
void inOverview( bool );
178178

src/raster/qgsrasterlayer.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -3822,7 +3822,7 @@ void QgsRasterLayer::popupTransparencySliderMoved(int theInt)
38223822

38233823

38243824
//should be between 0 and 255
3825-
void QgsRasterLayer::setTransparency(int theInt)
3825+
void QgsRasterLayer::setTransparency(unsigned int theInt)
38263826
{
38273827
#ifdef QGISDEBUG
38283828
std::cout << "Set transparency called with : " << theInt << std::endl;
@@ -3834,7 +3834,7 @@ void QgsRasterLayer::setTransparency(int theInt)
38343834
mTransparencySlider->setValue(255-theInt);
38353835
}
38363836
transparencyLevelInt=theInt;
3837-
} // QgsRasterLayer::setTransparency(int theInt)
3837+
} // QgsRasterLayer::setTransparency(unsigned int theInt)
38383838

38393839

38403840

src/raster/qgsrasterlayer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ class QgsRasterLayer : public QgsMapLayer
799799

800800
public slots:
801801
/** \brief Mutator for transparency level. Should be between 0 and 255 */
802-
void setTransparency(int); //
802+
void setTransparency(unsigned int);
803803
/**
804804
* Convert this raster to another format
805805
*/

0 commit comments

Comments
 (0)