Skip to content
Permalink
Browse files
Split qgscolorramp.h/.cpp out into qgscolorrampimp.h/.cpp
Avoids a bunch of unwanted includes throughout QGIS
  • Loading branch information
nyalldawson committed Nov 10, 2021
1 parent 9016862 commit 5b8d164008dae0bcb92a22a1c9cf811c97b4ab94
Showing with 2,446 additions and 2,352 deletions.
  1. +0 −722 python/core/auto_generated/qgscolorramp.sip.in
  2. +739 −0 python/core/auto_generated/qgscolorrampimpl.sip.in
  3. +1 −0 python/core/core_auto.sip
  4. +1 −0 src/app/qgsidentifyresultsdialog.cpp
  5. +2 −0 src/core/CMakeLists.txt
  6. +1 −1 src/core/effects/qgsgloweffect.cpp
  7. +1 −1 src/core/expression/qgsexpression.cpp
  8. +1 −0 src/core/expression/qgsexpressionfunction.cpp
  9. +13 −0 src/core/expression/qgsexpressionutils.cpp
  10. +3 −12 src/core/expression/qgsexpressionutils.h
  11. +1 −0 src/core/layertree/qgscolorramplegendnode.cpp
  12. +1 −1 src/core/mesh/qgsmeshlayer.cpp
  13. +2 −935 src/core/qgscolorramp.cpp
  14. +1 −657 src/core/qgscolorramp.h
  15. +953 −0 src/core/qgscolorrampimpl.cpp
  16. +680 −0 src/core/qgscolorrampimpl.h
  17. +0 −1 src/core/qgsproperty.h
  18. +1 −1 src/core/raster/qgscolorrampshader.cpp
  19. +1 −0 src/core/raster/qgspalettedrasterrenderer.cpp
  20. +1 −1 src/core/raster/qgssinglebandgrayrenderer.cpp
  21. +1 −0 src/core/symbology/qgscategorizedsymbolrenderer.cpp
  22. +1 −1 src/core/symbology/qgscptcityarchive.h
  23. +1 −0 src/core/symbology/qgsfillsymbollayer.cpp
  24. +1 −0 src/core/symbology/qgsgraduatedsymbolrenderer.cpp
  25. +1 −0 src/core/symbology/qgsheatmaprenderer.cpp
  26. +6 −0 src/core/symbology/qgslinesymbollayer.cpp
  27. +2 −1 src/core/symbology/qgslinesymbollayer.h
  28. +1 −0 src/core/symbology/qgssymbollayerutils.cpp
  29. +1 −0 src/core/vectortile/qgsmapboxglstyleconverter.h
  30. +1 −1 src/gui/qgscolorbrewercolorrampdialog.h
  31. +1 −1 src/gui/qgsgradientstopeditor.h
  32. +1 −1 src/gui/qgslimitedrandomcolorrampdialog.h
  33. +1 −1 src/gui/qgspresetcolorrampdialog.h
  34. +13 −0 src/gui/raster/qgspalettedrendererwidget.cpp
  35. +1 −7 src/gui/raster/qgspalettedrendererwidget.h
  36. +1 −0 src/gui/raster/qgsrasterlayerproperties.cpp
  37. +1 −0 src/gui/raster/qgsrendererrasterpropertieswidget.cpp
  38. +1 −1 src/gui/symbology/qgscategorizedsymbolrendererwidget.cpp
  39. +1 −1 src/gui/symbology/qgsgraduatedsymbolrendererwidget.cpp
  40. +1 −0 tests/src/analysis/testqgsprocessingalgs.cpp
  41. +1 −1 tests/src/core/testqgsgradients.cpp
  42. +1 −1 tests/src/core/testqgsimageoperation.cpp
  43. +1 −1 tests/src/core/testqgspainteffect.cpp
  44. +1 −1 tests/src/core/testqgsproperty.cpp
  45. +1 −1 tests/src/core/testqgsshapeburst.cpp

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -22,6 +22,7 @@
%Include auto_generated/qgsclipper.sip
%Include auto_generated/qgscommandlineutils.sip
%Include auto_generated/qgscolorramp.sip
%Include auto_generated/qgscolorrampimpl.sip
%Include auto_generated/qgscolorscheme.sip
%Include auto_generated/qgscolorschemeregistry.sip
%Include auto_generated/qgsconditionalstyle.sip
@@ -89,6 +89,7 @@
#include "qgsjsonutils.h"
#include "qgsjsoneditwidget.h"
#include "qgspointcloudlayer.h"
#include "qgscolorrampimpl.h"

#include <nlohmann/json.hpp>

@@ -322,6 +322,7 @@ set(QGIS_CORE_SRCS
qgscadutils.cpp
qgsclipper.cpp
qgscolorramp.cpp
qgscolorrampimpl.cpp
qgscolorscheme.cpp
qgscolorschemeregistry.cpp
qgscommandlineutils.cpp
@@ -947,6 +948,7 @@ set(QGIS_CORE_HDRS
qgsclipper.h
qgscommandlineutils.h
qgscolorramp.h
qgscolorrampimpl.h
qgscolorscheme.h
qgscolorschemeregistry.h
qgsconditionalstyle.h
@@ -18,7 +18,7 @@
#include "qgsgloweffect.h"
#include "qgssymbollayerutils.h"
#include "qgsimageoperation.h"
#include "qgscolorramp.h"
#include "qgscolorrampimpl.h"
#include "qgsunittypes.h"

QgsGlowEffect::QgsGlowEffect()
@@ -17,7 +17,7 @@
#include "qgsexpressionfunction.h"
#include "qgsexpressionnodeimpl.h"
#include "qgsfeaturerequest.h"
#include "qgscolorramp.h"
#include "qgscolorrampimpl.h"
#include "qgslogger.h"
#include "qgsexpressioncontext.h"
#include "qgsgeometry.h"
@@ -61,6 +61,7 @@
#include "qgsexpressioncontextutils.h"
#include "qgsunittypes.h"
#include "qgsspatialindex.h"
#include "qgscolorrampimpl.h"

#include <QMimeDatabase>
#include <QProcessEnvironment>
@@ -16,6 +16,7 @@
#include "qgsexpressionutils.h"
#include "qgsexpressionnode.h"
#include "qgsvectorlayer.h"
#include "qgscolorrampimpl.h"

///@cond PRIVATE

@@ -37,6 +38,18 @@ QgsExpressionUtils::TVL QgsExpressionUtils::NOT[3] = { True, False, Unknown };

///@endcond

QgsGradientColorRamp QgsExpressionUtils::getRamp( const QVariant &value, QgsExpression *parent, bool report_error )
{
if ( value.canConvert<QgsGradientColorRamp>() )
return value.value<QgsGradientColorRamp>();

// If we get here then we can't convert so we just error and return invalid.
if ( report_error )
parent->setEvalErrorString( QObject::tr( "Cannot convert '%1' to gradient ramp" ).arg( value.toString() ) );

return QgsGradientColorRamp();
}

std::tuple<QVariant::Type, int> QgsExpressionUtils::determineResultType( const QString &expression, const QgsVectorLayer *layer, QgsFeatureRequest request, QgsExpressionContext context, bool *foundFeatures )
{
QgsExpression exp( expression );
@@ -21,7 +21,6 @@

#include "qgsfeature.h"
#include "qgsexpression.h"
#include "qgscolorramp.h"
#include "qgsvectorlayerfeatureiterator.h"
#include "qgsrasterlayer.h"
#include "qgsproject.h"
@@ -32,6 +31,8 @@
#include <QThread>
#include <QLocale>

class QgsGradientColorRamp;

#define ENSURE_NO_EVAL_ERROR { if ( parent->hasEvalError() ) return QVariant(); }
#define SET_EVAL_ERROR(x) { parent->setEvalErrorString( x ); return QVariant(); }

@@ -322,17 +323,7 @@ class CORE_EXPORT QgsExpressionUtils
return QgsInterval();
}

static QgsGradientColorRamp getRamp( const QVariant &value, QgsExpression *parent, bool report_error = false )
{
if ( value.canConvert<QgsGradientColorRamp>() )
return value.value<QgsGradientColorRamp>();

// If we get here then we can't convert so we just error and return invalid.
if ( report_error )
parent->setEvalErrorString( QObject::tr( "Cannot convert '%1' to gradient ramp" ).arg( value.toString() ) );

return QgsGradientColorRamp();
}
static QgsGradientColorRamp getRamp( const QVariant &value, QgsExpression *parent, bool report_error = false );

static QgsGeometry getGeometry( const QVariant &value, QgsExpression *parent )
{
@@ -14,6 +14,7 @@
***************************************************************************/

#include "qgscolorramplegendnode.h"
#include "qgscolorrampimpl.h"
#include "qgslegendsettings.h"
#include "qgslayertreemodel.h"
#include "qgslayertreelayer.h"
@@ -21,7 +21,7 @@
#include <QUuid>
#include <QUrl>

#include "qgscolorramp.h"
#include "qgscolorrampimpl.h"
#include "qgslogger.h"
#include "qgsmaplayerlegend.h"
#include "qgsmaplayerfactory.h"
Loading

0 comments on commit 5b8d164

Please sign in to comment.