Skip to content
Permalink
Browse files

Merge pull request #4641 from nyalldawson/alpha

Unify opacity UI/API, pt 1
  • Loading branch information
nyalldawson committed May 30, 2017
2 parents 9e11082 + e8b11a3 commit efe6109cf27b63cd853d859b17cfc089da6f870c
Showing with 2,419 additions and 2,493 deletions.
  1. +61 −0 doc/api_break.dox
  2. +2 −11 python/core/composer/qgscomposeritem.sip
  3. +1 −1 python/core/composer/qgscomposeritemcommand.sip
  4. +1 −0 python/core/composer/qgscomposerobject.sip
  5. +10 −10 python/core/effects/qgsblureffect.sip
  6. +10 −10 python/core/effects/qgscoloreffect.sip
  7. +10 −10 python/core/effects/qgsgloweffect.sip
  8. +10 −10 python/core/effects/qgspainteffect.sip
  9. +10 −10 python/core/effects/qgsshadoweffect.sip
  10. +2 −2 python/core/qgscolorramp.sip
  11. +6 −1 python/core/qgsdiagramrenderer.sip
  12. +2 −2 python/core/qgsmaplayerstylemanager.sip
  13. +1 −1 python/core/qgsmultirenderchecker.sip
  14. +4 −0 python/core/qgspallabeling.sip
  15. +1 −1 python/core/qgsproperty.sip
  16. +1 −1 python/core/qgsrenderchecker.sip
  17. +20 −7 python/core/qgsvectorlayer.sip
  18. +2 −10 python/core/symbology-ng/qgsfillsymbollayer.sip
  19. +5 −19 python/core/symbology-ng/qgssymbol.sip
  20. +1 −1 python/core/symbology-ng/qgssymbollayer.sip
  21. +1 −0 python/gui/gui.sip
  22. +11 −9 python/gui/qgscolorbutton.sip
  23. +8 −7 python/gui/qgscolordialog.sip
  24. +4 −3 python/gui/qgscompoundcolorwidget.sip
  25. +66 −0 python/gui/qgsopacitywidget.sip
  26. +1 −1 python/gui/symbology-ng/qgsrendererwidget.sip
  27. +0 −1 python/gui/symbology-ng/qgssymbolslistwidget.sip
  28. +2 −2 src/app/composer/qgscomposerarrowwidget.cpp
  29. +4 −4 src/app/composer/qgscomposerattributetablewidget.cpp
  30. +10 −17 src/app/composer/qgscomposeritemwidget.cpp
  31. +1 −1 src/app/composer/qgscomposeritemwidget.h
  32. +1 −1 src/app/composer/qgscomposerlegendwidget.cpp
  33. +4 −4 src/app/composer/qgscomposermapgridwidget.cpp
  34. +4 −4 src/app/composer/qgscomposerpicturewidget.cpp
  35. +4 −4 src/app/composer/qgscomposerscalebarwidget.cpp
  36. +2 −2 src/app/composer/qgscomposertablebackgroundcolorsdialog.cpp
  37. +1 −1 src/app/qgsdecorationcopyrightdialog.cpp
  38. +2 −2 src/app/qgsdecorationnortharrowdialog.cpp
  39. +2 −2 src/app/qgsdecorationscalebardialog.cpp
  40. +5 −9 src/app/qgsdiagramproperties.cpp
  41. +4 −4 src/app/qgslabelinggui.cpp
  42. +1 −1 src/app/qgsmaptooloffsetpointsymbol.cpp
  43. +5 −5 src/app/qgsoptions.cpp
  44. +5 −5 src/app/qgspointmarkeritem.cpp
  45. +10 −10 src/app/qgspointmarkeritem.h
  46. +12 −18 src/app/qgsprojectproperties.cpp
  47. +0 −2 src/app/qgsprojectproperties.h
  48. +2 −14 src/app/qgsrasterlayerproperties.cpp
  49. +0 −2 src/app/qgsrasterlayerproperties.h
  50. +1 −1 src/app/qgstextannotationdialog.cpp
  51. +20 −15 src/core/composer/qgscomposeritem.cpp
  52. +24 −20 src/core/composer/qgscomposeritem.h
  53. +1 −1 src/core/composer/qgscomposeritemcommand.h
  54. +1 −1 src/core/composer/qgscomposermapoverview.cpp
  55. +1 −1 src/core/composer/qgscomposermultiframe.cpp
  56. +10 −1 src/core/composer/qgscomposerobject.cpp
  57. +2 −1 src/core/composer/qgscomposerobject.h
  58. +1 −1 src/core/dxf/qgsdxfexport.cpp
  59. +18 −7 src/core/effects/qgsblureffect.cpp
  60. +11 −11 src/core/effects/qgsblureffect.h
  61. +16 −6 src/core/effects/qgscoloreffect.cpp
  62. +11 −11 src/core/effects/qgscoloreffect.h
  63. +19 −9 src/core/effects/qgsgloweffect.cpp
  64. +11 −11 src/core/effects/qgsgloweffect.h
  65. +17 −7 src/core/effects/qgspainteffect.cpp
  66. +11 −11 src/core/effects/qgspainteffect.h
  67. +16 −6 src/core/effects/qgsshadoweffect.cpp
  68. +11 −11 src/core/effects/qgsshadoweffect.h
  69. +1 −1 src/core/layertree/qgslayertreemodellegendnode.cpp
  70. +6 −6 src/core/qgscolorramp.cpp
  71. +2 −2 src/core/qgscolorramp.h
  72. +12 −4 src/core/qgsdiagramrenderer.cpp
  73. +5 −2 src/core/qgsdiagramrenderer.h
  74. +1 −1 src/core/qgslegendsettings.h
  75. +0 −40 src/core/qgsmaplayer.cpp
  76. +2 −2 src/core/qgsmaplayerstylemanager.h
  77. +1 −1 src/core/qgsmaprenderercustompainterjob.cpp
  78. +1 −1 src/core/qgsmaprendererjob.cpp
  79. +1 −1 src/core/qgsmapsettings.h
  80. +1 −1 src/core/qgsmapsettingsutils.cpp
  81. +1 −1 src/core/qgsmultirenderchecker.h
  82. +79 −35 src/core/qgspallabeling.cpp
  83. +9 −5 src/core/qgspallabeling.h
  84. +1 −1 src/core/qgsproperty.cpp
  85. +1 −1 src/core/qgsproperty.h
  86. +1 −1 src/core/qgsrenderchecker.h
  87. +1 −1 src/core/qgsrendercontext.h
  88. +18 −13 src/core/qgsvectorlayer.cpp
  89. +28 −8 src/core/qgsvectorlayer.h
  90. +2 −1 src/core/raster/qgsrasterrenderer.cpp
  91. +12 −1 src/core/raster/qgsrasterrenderer.h
  92. +32 −31 src/core/symbology-ng/qgsfillsymbollayer.cpp
  93. +11 −9 src/core/symbology-ng/qgsfillsymbollayer.h
  94. +3 −3 src/core/symbology-ng/qgslinesymbollayer.cpp
  95. +12 −12 src/core/symbology-ng/qgsmarkersymbollayer.cpp
  96. +24 −16 src/core/symbology-ng/qgssymbol.cpp
  97. +30 −12 src/core/symbology-ng/qgssymbol.h
  98. +2 −2 src/core/symbology-ng/qgssymbollayer.cpp
  99. +1 −1 src/core/symbology-ng/qgssymbollayer.h
  100. +5 −5 src/core/symbology-ng/qgssymbollayerutils.cpp
  101. +4 −2 src/core/symbology-ng/qgssymbollayerutils.h
  102. +3 −0 src/customwidgets/CMakeLists.txt
  103. +2 −0 src/customwidgets/qgiscustomwidgets.cpp
  104. +97 −0 src/customwidgets/qgsopacitywidgetplugin.cpp
  105. +51 −0 src/customwidgets/qgsopacitywidgetplugin.h
  106. +2 −0 src/gui/CMakeLists.txt
  107. +2 −2 src/gui/attributetable/qgsfieldconditionalformatwidget.cpp
  108. +31 −78 src/gui/effects/qgspainteffectwidget.cpp
  109. +5 −10 src/gui/effects/qgspainteffectwidget.h
  110. +1 −1 src/gui/layertree/qgslayertreeembeddedwidgetregistry.cpp
  111. +21 −21 src/gui/layertree/qgslayertreeembeddedwidgetsimpl.cpp
  112. +4 −4 src/gui/layertree/qgslayertreeembeddedwidgetsimpl.h
  113. +12 −12 src/gui/qgscolorbutton.cpp
  114. +15 −11 src/gui/qgscolorbutton.h
  115. +13 −13 src/gui/qgscolordialog.cpp
  116. +9 −8 src/gui/qgscolordialog.h
  117. +1 −1 src/gui/qgscolorschemelist.cpp
  118. +6 −6 src/gui/qgscompoundcolorwidget.cpp
  119. +4 −3 src/gui/qgscompoundcolorwidget.h
  120. +3 −3 src/gui/qgsgradientcolorrampdialog.cpp
  121. +69 −0 src/gui/qgsopacitywidget.cpp
  122. +83 −0 src/gui/qgsopacitywidget.h
  123. +1 −1 src/gui/qgspresetcolorrampdialog.cpp
  124. +1 −1 src/gui/qgspropertyassistantwidget.cpp
  125. +22 −26 src/gui/qgstextformatwidget.cpp
  126. +1 −1 src/gui/raster/qgspalettedrendererwidget.cpp
  127. +3 −13 src/gui/raster/qgsrastertransparencywidget.cpp
  128. +0 −3 src/gui/raster/qgsrastertransparencywidget.h
  129. +3 −3 src/gui/symbology-ng/qgs25drendererwidget.cpp
  130. +2 −2 src/gui/symbology-ng/qgsellipsesymbollayerwidget.cpp
  131. +2 −2 src/gui/symbology-ng/qgspointdisplacementrendererwidget.cpp
  132. +10 −10 src/gui/symbology-ng/qgsrendererpropertiesdialog.cpp
  133. +5 −5 src/gui/symbology-ng/qgsrendererwidget.cpp
  134. +1 −1 src/gui/symbology-ng/qgsrendererwidget.h
  135. +27 −28 src/gui/symbology-ng/qgssymbollayerwidget.cpp
  136. +1 −1 src/gui/symbology-ng/qgssymbollayerwidget.h
  137. +7 −18 src/gui/symbology-ng/qgssymbolslistwidget.cpp
  138. +1 −5 src/gui/symbology-ng/qgssymbolslistwidget.h
  139. +1 −1 src/server/services/wms/qgswmsrenderer.cpp
  140. +35 −47 src/ui/composer/qgscomposeritemwidgetbase.ui
  141. +15 −62 src/ui/effects/widget_blur.ui
  142. +15 −58 src/ui/effects/widget_coloreffects.ui
  143. +16 −63 src/ui/effects/widget_drawsource.ui
  144. +16 −58 src/ui/effects/widget_glow.ui
  145. +15 −57 src/ui/effects/widget_shadoweffect.ui
  146. +43 −79 src/ui/qgsdiagrampropertiesbase.ui
  147. +8 −8 src/ui/qgsgradientcolorrampdialogbase.ui
  148. +34 −73 src/ui/qgsprojectpropertiesbase.ui
  149. +75 −149 src/ui/qgsrasterlayerpropertiesbase.ui
  150. +49 −54 src/ui/qgsrendererv2propsdialogbase.ui
  151. +482 −630 src/ui/qgstextformatwidgetbase.ui
  152. +41 −91 src/ui/raster/qgsrastertransparencywidget.ui
  153. +21 −80 src/ui/symbollayer/widget_rasterfill.ui
  154. +72 −36 src/ui/symbollayer/widget_symbolslist.ui
  155. +2 −2 tests/src/core/testqgsblendmodes.cpp
  156. +1 −1 tests/src/core/testqgscomposereffects.cpp
  157. +4 −4 tests/src/core/testqgscomposermultiframe.cpp
  158. +3 −3 tests/src/core/testqgscomposerutils.cpp
  159. +20 −20 tests/src/core/testqgspainteffect.cpp
  160. +2 −2 tests/src/core/testqgsrasterfill.cpp
  161. +10 −10 tests/src/core/testqgsvectorlayer.cpp
  162. +1 −0 tests/src/python/CMakeLists.txt
  163. +3 −3 tests/src/python/test_qgsblendmodes.py
  164. +1 −1 tests/src/python/test_qgscolorbutton.py
  165. +2 −2 tests/src/python/test_qgscomposereffects.py
  166. +58 −0 tests/src/python/test_qgsopacitywidget.py
  167. +9 −9 tests/src/python/test_qgsvectorlayer.py
@@ -528,6 +528,12 @@ QgsAuthMethod {#qgis_api_break_3_0_QgsAuthMethod}
- DataSourceURI has been renamed to DataSourceUri
- GenericDataSourceURI has been renamed to GenericDataSourceUri

QgsBlurEffect {#qgis_api_break_3_0_QgsBlurEffect}
-------------

- setTransparency and transparency were removed. Use setOpacity and opacity instead.


QgsBrowserModel {#qgis_api_break_3_0_QgsBrowserModel}
---------------

@@ -573,6 +579,19 @@ QgsColorButton {#qgis_api_break_3_0_QgsColorButton}
--------------

- Behaviour enum and its corresponding setter/getter have been renamed to Behavior <!--#spellok-->
- setAllowAlpha() and allowAlpha() were removed. Use setAllowOpacity() and allowOpacity() instead.


QgsColorDialog {#qgis_api_break_3_0_QgsColorDialog}
--------------

- setAllowAlpha() was removed. Use setAllowOpacity() instead.


QgsColorEffect {#qgis_api_break_3_0_QgsColorEffect}
-------------

- setTransparency and transparency were removed. Use setOpacity and opacity instead.


QgsColorRampShader {#qgis_api_break_3_0_QgsColorRampShader}
@@ -615,6 +634,12 @@ Use the corresponding methods in QgsComposerUtils instead.
instead.
- lockSymbolSize(), imageSizeConsideringRotation(), cornerPointOnRotatedAndScaledRect(),
sizeChangedByRotation() were removed. No replacement is offered for these methods.
- transparency() and setTransparency() were removed. Use itemOpacity() and setItemOpacity() instead.

QgsComposerItemCommand {#qgis_api_break_3_0_QgsComposerItemCommand}
----------------------

- ItemTransparency was removed. Use ItemOpacity instead.


QgsComposerLabel {#qgis_api_break_3_0_QgsComposerLabel}
@@ -783,6 +808,12 @@ all these item added events.
- addComposerMap no longer takes a setDefaultPreviewStyle argument.
- the mapsToRestore parameter has been removed from addItemsFromXml

QgsCompoundColorWidget {#qgis_api_break_3_0_QgsCompoundColorWidget}
----------------------

- setAllowAlpha() was removed. Use setAllowOpacity() instead.


QgsConditionalLayerStyle {#qgis_api_break_3_0_QgsConditionalLayerStyle}
------------------------

@@ -992,6 +1023,8 @@ QgsDiagramSettings {#qgis_api_break_3_0_QgsDiagramSettings}

- The SizeType enum was removed. Use QgsUnitTypes.RenderUnit instead.
- readXml() and writeXml() do not take QgsVectorLayer as an argument anymore.
- transparency was removed. Use opacity instead.


QgsDial {#qgis_api_break_3_0_QgsDial}
-------
@@ -1015,6 +1048,12 @@ willUseEllipsoid() to determine whether ellipsoidal calculations will be perform
- convertMeasurement was removed. Use QgsUnitTypes for conversion instead.


QgsDrawSourceEffect {#qgis_api_break_3_0_QgsDrawSourceEffect}
-------------------

- setTransparency and transparency were removed. Use setOpacity and opacity instead.


QgsDxfExport {#qgis_api_break_3_0_QgsDxfExport}
------------

@@ -1206,6 +1245,12 @@ QgsGeometrySimplifier {#qgis_api_break_3_0_QgsGeometrySimplifier}
- simplifyGeometry() has been removed and simplify() must be used instead .


QgsGlowEffect {#qgis_api_break_3_0_QgsGlowEffect}
-------------

- setTransparency and transparency were removed. Use setOpacity and opacity instead.


QgsGradientColorRampDialog {#qgis_api_break_3_0_QgsGradientColorRampDialog}
---------

@@ -1806,6 +1851,12 @@ QProgressDialog argument will need to be updated using manually created connecti
signals and the updates to the progress dialog.


QgsRasterFillSymbolLayer {#qgis_api_break_3_0_QgsRasterFillSymbolLayer}
-----------------

- alpha() and setAlpha() were removed. Use opacity() and setOpacity() instead.


QgsRasterInterface {#qgis_api_break_3_0_QgsRasterInterface}
------------------

@@ -1956,6 +2007,13 @@ QgsServer {#qgis_api_break_3_0_QgsServer}
- QgsServer::handleRequest( const QString &urlstr ) has been removed in favour of the new
- QgsServer::handleRequest( QgsServerRequest &request, QgsServerResponse &response ) has been added


QgsShadowEffect {#qgis_api_break_3_0_QgsShadowEffect}
---------------

- setTransparency and transparency were removed. Use setOpacity and opacity instead.


QgsShortcutsManager {#qgis_api_break_3_0_QgsShortcutsManager}
-------------------

@@ -2070,6 +2128,7 @@ than an integer value
- usedAttributes() now requires a QgsRenderContext argument.
- setDataDefinedAngle(), dataDefinedAngle(), setDataDefinedSize(), dataDefinedSize(), setDataDefinedWidth() and dataDefinedWidth()
now work with QgsProperty objects instead of QgsDataDefined.
- alpha() and setAlpha() were removed. Use opacity() and setOpacity() instead.


QgsSymbolLayer (renamed from QgsSymbolLayerV2) {#qgis_api_break_3_0_QgsSymbolLayer}
@@ -2108,6 +2167,7 @@ QgsSymbolRenderContext (renamed from QgsSymbolV2RenderContext) {#qgis_api
- The constructor, setRenderHints() and renderHints() now accept and return a QgsSymbol::RenderHints flag rather
than an integer value
- fields() now returns a QgsFields value, not a pointer.
- alpha() and setAlpha() were removed. Use opacity() and setOpacity() instead.


QgsSymbolLayerUtils (renamed from QgsSymbolLayerUtilsV2) {#qgis_api_break_3_0_QgsSymbolLayerUtils}
@@ -2265,6 +2325,7 @@ displayExpression instead. For the map tip use mapTipTemplate() instead.
- addFeature() no longer accepts an alsoUpdateExtent boolean - this extra argument has been ignored for some time
- addFeatures() no longer accepts a makeSelected boolean, and will not automatically select newly added features. If desired, features must be manually selected by calling selectByIds() after addFeatures()
- annotationForm() and setAnnotationForm() have been removed. Form path is stored in individual QgsFormAnnotation objects.
- setLayerTransparency, layerTransparency, and layerTransparencyChanged were removed. Use opacity, setOpacity and opacityChanged instead.


QgsVectorLayerEditBuffer {#qgis_api_break_3_0_QgsVectorLayerEditBuffer}
@@ -404,17 +404,8 @@ class QgsComposerItem : QgsComposerObject, QGraphicsRectItem
*/
void setBlendMode( const QPainter::CompositionMode blendMode );

/** Returns the item's transparency
* @returns transparency as integer between 0 (transparent) and 255 (opaque)
* @see setTransparency
*/
int transparency() const;

/** Sets the item's transparency
* @param transparency integer between 0 (transparent) and 255 (opaque)
* @see transparency
*/
void setTransparency( const int transparency );
double itemOpacity() const;
void setItemOpacity( const double opacity );

/** Returns whether effects (e.g., blend modes) are enabled for the item
* @returns true if effects are enabled
@@ -112,7 +112,7 @@ class QgsComposerMergeCommand : QgsComposerItemCommand
ItemBackgroundColor,
ItemMove,
ItemRotation,
ItemTransparency,
ItemOpacity,
ItemZoomContent
};

@@ -30,6 +30,7 @@ class QgsComposerObject : QObject, QgsExpressionContextGenerator
ItemHeight, /*!< height of item */
ItemRotation, /*!< rotation of item */
Transparency, /*!< item transparency */
Opacity,
BlendMode, /*!< item blend mode */
ExcludeFromExports, /*!< exclude item from exports */
FrameColor, //!< Item frame color
@@ -78,20 +78,20 @@ class QgsBlurEffect : QgsPaintEffect
:rtype: BlurMethod
%End

void setTransparency( const double transparency );
void setOpacity( const double opacity );
%Docstring
Sets the transparency for the effect
\param transparency double between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: transparency
Sets the ``opacity`` for the effect.
\param opacity double between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: opacity()
%End

double transparency() const;
double opacity() const;
%Docstring
Returns the transparency for the effect
:return: transparency value between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: setTransparency
Returns the opacity for the effect.
:return: opacity value between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: setOpacity()
:rtype: float
%End

@@ -171,20 +171,20 @@ class QgsColorEffect : QgsPaintEffect
:rtype: int
%End

void setTransparency( const double transparency );
void setOpacity( const double opacity );
%Docstring
Sets the transparency for the effect
\param transparency double between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: transparency
Sets the ``opacity`` for the effect.
\param opacity double between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: opacity()
%End

double transparency() const;
double opacity() const;
%Docstring
Returns the transparency for the effect
:return: transparency value between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: setTransparency
Returns the opacity for the effect.
:return: opacity value between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque.
.. seealso:: setOpacity()
:rtype: float
%End

@@ -113,20 +113,20 @@ class QgsGlowEffect : QgsPaintEffect
:rtype: int
%End

void setTransparency( const double transparency );
void setOpacity( const double opacity );
%Docstring
Sets the transparency for the effect
\param transparency double between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: transparency
Sets the ``opacity`` for the effect.
\param opacity double between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: opacity()
%End

double transparency() const;
double opacity() const;
%Docstring
Returns the transparency for the effect
:return: transparency value between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: setTransparency
Returns the opacity for the effect.
:return: opacity value between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: setOpacity().
:rtype: float
%End

@@ -311,20 +311,20 @@ class QgsDrawSourceEffect : QgsPaintEffect
virtual QgsStringMap properties() const;
virtual void readProperties( const QgsStringMap &props );

void setTransparency( const double transparency );
void setOpacity( const double opacity );
%Docstring
Sets the transparency for the effect
\param transparency double between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: transparency
Sets the ``opacity`` for the effect.
\param opacity double between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: opacity()
%End

double transparency() const;
double opacity() const;
%Docstring
Returns the transparency for the effect
:return: transparency value between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: setTransparency
Returns the opacity for the effect
:return: opacity value between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: setOpacity()
:rtype: float
%End

@@ -133,20 +133,20 @@ class QgsShadowEffect : QgsPaintEffect
:rtype: QColor
%End

void setTransparency( const double transparency );
void setOpacity( const double opacity );
%Docstring
Sets the transparency for the effect
\param transparency double between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: transparency
Sets the ``opacity`` for the effect.
\param opacity double between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: opacity()
%End

double transparency() const;
double opacity() const;
%Docstring
Returns the transparency for the effect
:return: transparency value between 0 and 1 inclusive, where 0 is fully opaque
and 1 is fully transparent
.. seealso:: setTransparency
Returns the opacity for the effect.
:return: opacity value between 0 and 1 inclusive, where 0 is fully transparent
and 1 is fully opaque
.. seealso:: setOpacity()
:rtype: float
%End

@@ -246,11 +246,11 @@ Creates a new QgsColorRamp from a map of properties
.. seealso:: info()
%End

void addStopsToGradient( QGradient *gradient, double alpha = 1 );
void addStopsToGradient( QGradient *gradient, double opacity = 1 );
%Docstring
Copy color ramp stops to a QGradient
\param gradient gradient to copy stops into
\param alpha alpha multiplier. Opacity of colors will be multiplied
\param opacity opacity multiplier. Opacity of colors will be multiplied
by this factor before adding to the gradient.
.. versionadded:: 2.1
%End
@@ -358,7 +358,12 @@ class QgsDiagramSettings
LabelPlacementMethod labelPlacementMethod;
DiagramOrientation diagramOrientation;
double barWidth;
int transparency; // 0 - 100

double opacity;
%Docstring
Opacity, from 0 (transparent) to 1.0 (opaque)
%End

bool scaleByArea;
int angleOffset;

@@ -15,7 +15,7 @@
class QgsMapLayerStyle
{
%Docstring
Stores style information (renderer, transparency, labeling, diagrams etc.) applicable to a map layer.
Stores style information (renderer, opacity, labeling, diagrams etc.) applicable to a map layer.

Stored data are considered as opaque - it is not possible to access them directly or modify them - it is
only possible to read or write layer's current style.
@@ -83,7 +83,7 @@ class QgsMapLayerStyleManager : QObject
the new style is applied to the associated layer.

The class takes care of updating itself when the layer's current style configuration changes.
When some of layer style's properties change (e.g. transparency / colors), the style manager will
When some of layer style's properties change (e.g. opacity / colors), the style manager will
record them in the currently active style without any extra effort required.

When an instance is created, it creates "default" style (with empty name) recorded from the associated map layer
@@ -117,7 +117,7 @@ class QgsMultiRenderChecker

static void drawBackground( QImage *image );
%Docstring
Draws a checkboard pattern for image backgrounds, so that transparency is visible
Draws a checkboard pattern for image backgrounds, so that opacity is visible
without requiring a transparent background for the image
%End

0 comments on commit efe6109

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