mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
simplified getting socket colors
This commit is contained in:
parent
46ebf8dff2
commit
287fc1b0f2
@ -7,13 +7,13 @@ except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName)
|
||||
QgsProcessingOutputVectorLayer.__overridden_methods__ = ['type']
|
||||
QgsProcessingOutputVectorLayer.__overridden_methods__ = ['getColor', 'type']
|
||||
QgsProcessingOutputVectorLayer.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName)
|
||||
QgsProcessingOutputRasterLayer.__overridden_methods__ = ['type']
|
||||
QgsProcessingOutputRasterLayer.__overridden_methods__ = ['getColor', 'type']
|
||||
QgsProcessingOutputRasterLayer.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -25,49 +25,49 @@ except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName)
|
||||
QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString']
|
||||
QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'getColor', 'valueAsString']
|
||||
QgsProcessingOutputMultipleLayers.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName)
|
||||
QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
||||
QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString']
|
||||
QgsProcessingOutputHtml.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputVariant.typeName)
|
||||
QgsProcessingOutputVariant.__overridden_methods__ = ['type', 'valueAsString']
|
||||
QgsProcessingOutputVariant.__overridden_methods__ = ['getColor', 'type', 'valueAsString']
|
||||
QgsProcessingOutputVariant.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName)
|
||||
QgsProcessingOutputNumber.__overridden_methods__ = ['type', 'valueAsString']
|
||||
QgsProcessingOutputNumber.__overridden_methods__ = ['getColor', 'type', 'valueAsString']
|
||||
QgsProcessingOutputNumber.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName)
|
||||
QgsProcessingOutputString.__overridden_methods__ = ['type']
|
||||
QgsProcessingOutputString.__overridden_methods__ = ['getColor', 'type']
|
||||
QgsProcessingOutputString.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName)
|
||||
QgsProcessingOutputBoolean.__overridden_methods__ = ['type', 'valueAsString']
|
||||
QgsProcessingOutputBoolean.__overridden_methods__ = ['getColor', 'type', 'valueAsString']
|
||||
QgsProcessingOutputBoolean.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName)
|
||||
QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
||||
QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString']
|
||||
QgsProcessingOutputFolder.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName)
|
||||
QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
||||
QgsProcessingOutputFile.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString']
|
||||
QgsProcessingOutputFile.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -79,7 +79,7 @@ except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName)
|
||||
QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type']
|
||||
QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['getColor', 'type']
|
||||
QgsProcessingOutputVectorTileLayer.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
|
@ -220,6 +220,11 @@ A vector layer output for processing algorithms.
|
||||
Constructor for QgsProcessingOutputVectorLayer.
|
||||
%End
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a vector layer ouput
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
@ -263,8 +268,13 @@ Constructor for QgsProcessingOutputRasterLayer.
|
||||
%Docstring
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a raster layer output
|
||||
%End
|
||||
virtual QString type() const;
|
||||
};
|
||||
|
||||
class QgsProcessingOutputPointCloudLayer : QgsProcessingOutputDefinition
|
||||
@ -323,8 +333,13 @@ Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a multiple layer output
|
||||
%End
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
};
|
||||
|
||||
@ -349,8 +364,13 @@ Constructor for QgsProcessingOutputHtml.
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent an HTML output
|
||||
%End
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
};
|
||||
|
||||
@ -379,12 +399,14 @@ Constructor for QgsProcessingOutputVariant.
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
|
||||
|
||||
virtual QString type() const;
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a range parameter
|
||||
%End
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
|
||||
@ -406,6 +428,11 @@ A numeric output for processing algorithms.
|
||||
Constructor for QgsProcessingOutputNumber.
|
||||
%End
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a number output
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
@ -437,8 +464,13 @@ Constructor for QgsProcessingOutputString.
|
||||
%Docstring
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a string output
|
||||
%End
|
||||
virtual QString type() const;
|
||||
};
|
||||
|
||||
class QgsProcessingOutputBoolean : QgsProcessingOutputDefinition
|
||||
@ -459,7 +491,11 @@ A boolean output for processing algorithms.
|
||||
Constructor for :py:class:`QgsProcessingOutputNumber`.
|
||||
%End
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a boolean output
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
@ -492,8 +528,13 @@ Constructor for QgsProcessingOutputFolder.
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a folder output
|
||||
%End
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
};
|
||||
|
||||
@ -518,8 +559,13 @@ Constructor for QgsProcessingOutputFile.
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a file output
|
||||
%End
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
};
|
||||
|
||||
@ -571,8 +617,13 @@ Constructor for QgsProcessingOutputVectorTileLayer.
|
||||
%Docstring
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a vector tile layer output
|
||||
%End
|
||||
virtual QString type() const;
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
@ -7,13 +7,13 @@ except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName)
|
||||
QgsProcessingOutputVectorLayer.__overridden_methods__ = ['type']
|
||||
QgsProcessingOutputVectorLayer.__overridden_methods__ = ['getColor', 'type']
|
||||
QgsProcessingOutputVectorLayer.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName)
|
||||
QgsProcessingOutputRasterLayer.__overridden_methods__ = ['type']
|
||||
QgsProcessingOutputRasterLayer.__overridden_methods__ = ['getColor', 'type']
|
||||
QgsProcessingOutputRasterLayer.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -25,49 +25,49 @@ except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName)
|
||||
QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString']
|
||||
QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'getColor', 'valueAsString']
|
||||
QgsProcessingOutputMultipleLayers.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName)
|
||||
QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
||||
QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString']
|
||||
QgsProcessingOutputHtml.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputVariant.typeName)
|
||||
QgsProcessingOutputVariant.__overridden_methods__ = ['type', 'valueAsString']
|
||||
QgsProcessingOutputVariant.__overridden_methods__ = ['getColor', 'type', 'valueAsString']
|
||||
QgsProcessingOutputVariant.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName)
|
||||
QgsProcessingOutputNumber.__overridden_methods__ = ['type', 'valueAsString']
|
||||
QgsProcessingOutputNumber.__overridden_methods__ = ['getColor', 'type', 'valueAsString']
|
||||
QgsProcessingOutputNumber.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName)
|
||||
QgsProcessingOutputString.__overridden_methods__ = ['type']
|
||||
QgsProcessingOutputString.__overridden_methods__ = ['getColor', 'type']
|
||||
QgsProcessingOutputString.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName)
|
||||
QgsProcessingOutputBoolean.__overridden_methods__ = ['type', 'valueAsString']
|
||||
QgsProcessingOutputBoolean.__overridden_methods__ = ['getColor', 'type', 'valueAsString']
|
||||
QgsProcessingOutputBoolean.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName)
|
||||
QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
||||
QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString']
|
||||
QgsProcessingOutputFolder.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName)
|
||||
QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString']
|
||||
QgsProcessingOutputFile.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString']
|
||||
QgsProcessingOutputFile.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
@ -79,7 +79,7 @@ except (NameError, AttributeError):
|
||||
pass
|
||||
try:
|
||||
QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName)
|
||||
QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type']
|
||||
QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['getColor', 'type']
|
||||
QgsProcessingOutputVectorTileLayer.__group__ = ['processing']
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
|
@ -220,6 +220,11 @@ A vector layer output for processing algorithms.
|
||||
Constructor for QgsProcessingOutputVectorLayer.
|
||||
%End
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a vector layer ouput
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
@ -263,8 +268,13 @@ Constructor for QgsProcessingOutputRasterLayer.
|
||||
%Docstring
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a raster layer output
|
||||
%End
|
||||
virtual QString type() const;
|
||||
};
|
||||
|
||||
class QgsProcessingOutputPointCloudLayer : QgsProcessingOutputDefinition
|
||||
@ -323,8 +333,13 @@ Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a multiple layer output
|
||||
%End
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
};
|
||||
|
||||
@ -349,8 +364,13 @@ Constructor for QgsProcessingOutputHtml.
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent an HTML output
|
||||
%End
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
};
|
||||
|
||||
@ -379,12 +399,14 @@ Constructor for QgsProcessingOutputVariant.
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
|
||||
|
||||
virtual QString type() const;
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a range parameter
|
||||
%End
|
||||
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
|
||||
@ -406,6 +428,11 @@ A numeric output for processing algorithms.
|
||||
Constructor for QgsProcessingOutputNumber.
|
||||
%End
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a number output
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
@ -437,8 +464,13 @@ Constructor for QgsProcessingOutputString.
|
||||
%Docstring
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a string output
|
||||
%End
|
||||
virtual QString type() const;
|
||||
};
|
||||
|
||||
class QgsProcessingOutputBoolean : QgsProcessingOutputDefinition
|
||||
@ -459,7 +491,11 @@ A boolean output for processing algorithms.
|
||||
Constructor for :py:class:`QgsProcessingOutputNumber`.
|
||||
%End
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a boolean output
|
||||
%End
|
||||
|
||||
static QString typeName();
|
||||
%Docstring
|
||||
@ -492,8 +528,13 @@ Constructor for QgsProcessingOutputFolder.
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a folder output
|
||||
%End
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
};
|
||||
|
||||
@ -518,8 +559,13 @@ Constructor for QgsProcessingOutputFile.
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a file output
|
||||
%End
|
||||
virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const;
|
||||
|
||||
};
|
||||
|
||||
@ -571,8 +617,13 @@ Constructor for QgsProcessingOutputVectorTileLayer.
|
||||
%Docstring
|
||||
Returns the type name for the output class.
|
||||
%End
|
||||
virtual QString type() const;
|
||||
|
||||
virtual QColor getColor() const;
|
||||
|
||||
%Docstring
|
||||
A color to represent a vector tile layer output
|
||||
%End
|
||||
virtual QString type() const;
|
||||
};
|
||||
|
||||
/************************************************************************
|
||||
|
@ -51,7 +51,7 @@ QString QgsProcessingOutputDefinition::valueAsFormattedString( const QVariant &v
|
||||
QColor QgsProcessingOutputDefinition::getColor() const
|
||||
{
|
||||
return QColor( 128, 128, 128 ); /* mid gray */
|
||||
};
|
||||
}
|
||||
|
||||
QgsProcessingOutputVectorLayer::QgsProcessingOutputVectorLayer( const QString &name, const QString &description, Qgis::ProcessingSourceType type )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
@ -68,11 +68,20 @@ void QgsProcessingOutputVectorLayer::setDataType( Qgis::ProcessingSourceType typ
|
||||
mDataType = type;
|
||||
}
|
||||
|
||||
QColor QgsProcessingOutputVectorLayer::getColor() const
|
||||
{
|
||||
return QColor( 180, 180, 0 ); /* greenish yellow */
|
||||
}
|
||||
|
||||
QgsProcessingOutputRasterLayer::QgsProcessingOutputRasterLayer( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
|
||||
QColor QgsProcessingOutputRasterLayer::getColor() const
|
||||
{
|
||||
return QColor( 0, 180, 180 ); /* turquoise */
|
||||
}
|
||||
|
||||
QgsProcessingOutputPointCloudLayer::QgsProcessingOutputPointCloudLayer( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
@ -81,6 +90,11 @@ QgsProcessingOutputVectorTileLayer::QgsProcessingOutputVectorTileLayer( const QS
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
|
||||
QColor QgsProcessingOutputVectorTileLayer::getColor() const
|
||||
{
|
||||
return QColor( 180, 180, 0 ); /* greenish yellow */
|
||||
}
|
||||
|
||||
QgsProcessingOutputHtml::QgsProcessingOutputHtml( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
@ -96,6 +110,11 @@ QString QgsProcessingOutputHtml::valueAsFormattedString( const QVariant &value,
|
||||
return valueAsString( value, context, ok );
|
||||
}
|
||||
|
||||
QColor QgsProcessingOutputHtml::getColor() const
|
||||
{
|
||||
return QColor( 100, 100, 255 ); /* slate blueish */
|
||||
}
|
||||
|
||||
QgsProcessingOutputNumber::QgsProcessingOutputNumber( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
@ -118,10 +137,20 @@ QString QgsProcessingOutputNumber::valueAsString( const QVariant &value, QgsProc
|
||||
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
||||
}
|
||||
|
||||
QColor QgsProcessingOutputNumber::getColor() const
|
||||
{
|
||||
return QColor( 34, 157, 214 ); /* blue */
|
||||
}
|
||||
|
||||
QgsProcessingOutputString::QgsProcessingOutputString( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
|
||||
QColor QgsProcessingOutputString::getColor() const
|
||||
{
|
||||
return QColor( 100, 100, 255 ); /* slate blueish */
|
||||
}
|
||||
|
||||
QgsProcessingOutputBoolean::QgsProcessingOutputBoolean( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
@ -137,6 +166,11 @@ QString QgsProcessingOutputBoolean::valueAsString( const QVariant &value, QgsPro
|
||||
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
||||
}
|
||||
|
||||
QColor QgsProcessingOutputBoolean::getColor() const
|
||||
{
|
||||
return QColor( 51, 201, 28 ); /* green */
|
||||
}
|
||||
|
||||
QgsProcessingOutputFolder::QgsProcessingOutputFolder( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
@ -152,6 +186,11 @@ QString QgsProcessingOutputFolder::valueAsFormattedString( const QVariant &value
|
||||
return valueAsString( value, context, ok );
|
||||
}
|
||||
|
||||
QColor QgsProcessingOutputFolder::getColor() const
|
||||
{
|
||||
return QColor( 80, 80, 80 ); /* dark gray */
|
||||
}
|
||||
|
||||
QgsProcessingOutputFile::QgsProcessingOutputFile( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
@ -167,6 +206,11 @@ QString QgsProcessingOutputFile::valueAsFormattedString( const QVariant &value,
|
||||
return valueAsString( value, context, ok );
|
||||
}
|
||||
|
||||
QColor QgsProcessingOutputFile::getColor() const
|
||||
{
|
||||
return QColor( 80, 80, 80 ); /* dark gray */
|
||||
}
|
||||
|
||||
QgsProcessingOutputMapLayer::QgsProcessingOutputMapLayer( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
@ -216,6 +260,11 @@ QString QgsProcessingOutputMultipleLayers::valueAsString( const QVariant &value,
|
||||
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
||||
}
|
||||
|
||||
QColor QgsProcessingOutputMultipleLayers::getColor() const
|
||||
{
|
||||
return QColor( 237, 142, 0 ); /* orange */
|
||||
}
|
||||
|
||||
QgsProcessingOutputConditionalBranch::QgsProcessingOutputConditionalBranch( const QString &name, const QString &description )
|
||||
: QgsProcessingOutputDefinition( name, description )
|
||||
{}
|
||||
@ -272,3 +321,8 @@ QString QgsProcessingOutputVariant::valueAsString( const QVariant &value, QgsPro
|
||||
}
|
||||
return QgsProcessingOutputDefinition::valueAsString( value, context, ok );
|
||||
}
|
||||
|
||||
QColor QgsProcessingOutputVariant::getColor() const
|
||||
{
|
||||
return QColor( 34, 157, 214 ); /* blue */
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ class CORE_EXPORT QgsProcessingOutputVectorLayer : public QgsProcessingOutputDef
|
||||
/**
|
||||
* A color to represent a vector layer ouput
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 0, 255, 0 ); /* green */ };
|
||||
QColor getColor() const override;
|
||||
|
||||
/**
|
||||
* Returns the type name for the output class.
|
||||
@ -270,12 +270,12 @@ class CORE_EXPORT QgsProcessingOutputRasterLayer : public QgsProcessingOutputDef
|
||||
* Returns the type name for the output class.
|
||||
*/
|
||||
static QString typeName() { return QStringLiteral( "outputRaster" ); }
|
||||
QString type() const override { return typeName(); }
|
||||
|
||||
/**
|
||||
* A color to represent a raster layer output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ };
|
||||
QColor getColor() const override;
|
||||
QString type() const override { return typeName(); }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -326,12 +326,12 @@ class CORE_EXPORT QgsProcessingOutputMultipleLayers : public QgsProcessingOutput
|
||||
*/
|
||||
static QString typeName() { return QStringLiteral( "outputMultilayer" ); }
|
||||
QString type() const override;
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
|
||||
/**
|
||||
* A color to represent a multiple layer output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ };
|
||||
QColor getColor() const override;
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -353,12 +353,12 @@ class CORE_EXPORT QgsProcessingOutputHtml : public QgsProcessingOutputDefinition
|
||||
*/
|
||||
static QString typeName() { return QStringLiteral( "outputHtml" ); }
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
|
||||
/**
|
||||
* A color to represent an HTML output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ };
|
||||
QColor getColor() const override;
|
||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
};
|
||||
|
||||
|
||||
@ -385,7 +385,7 @@ class CORE_EXPORT QgsProcessingOutputVariant : public QgsProcessingOutputDefinit
|
||||
/**
|
||||
* A color to represent a range parameter
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||
QColor getColor() const override;
|
||||
|
||||
QString type() const override;
|
||||
QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
@ -409,7 +409,7 @@ class CORE_EXPORT QgsProcessingOutputNumber : public QgsProcessingOutputDefiniti
|
||||
/**
|
||||
* A color to represent a number output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ };
|
||||
QColor getColor() const override;
|
||||
|
||||
/**
|
||||
* Returns the type name for the output class.
|
||||
@ -438,12 +438,12 @@ class CORE_EXPORT QgsProcessingOutputString : public QgsProcessingOutputDefiniti
|
||||
* Returns the type name for the output class.
|
||||
*/
|
||||
static QString typeName() { return QStringLiteral( "outputString" ); }
|
||||
QString type() const override { return typeName(); }
|
||||
|
||||
/**
|
||||
* A color to represent a string output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ };
|
||||
QColor getColor() const override;
|
||||
QString type() const override { return typeName(); }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -464,8 +464,7 @@ class CORE_EXPORT QgsProcessingOutputBoolean : public QgsProcessingOutputDefinit
|
||||
/**
|
||||
* A color to represent a boolean output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 51, 201, 28 ); /* green */ };
|
||||
|
||||
QColor getColor() const override ;
|
||||
|
||||
/**
|
||||
* Returns the type name for the output class.
|
||||
@ -495,12 +494,12 @@ class CORE_EXPORT QgsProcessingOutputFolder : public QgsProcessingOutputDefiniti
|
||||
*/
|
||||
static QString typeName() { return QStringLiteral( "outputFolder" ); }
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
|
||||
/**
|
||||
* A color to represent a folder output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ };
|
||||
QColor getColor() const override;
|
||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -522,12 +521,12 @@ class CORE_EXPORT QgsProcessingOutputFile : public QgsProcessingOutputDefinition
|
||||
*/
|
||||
static QString typeName() { return QStringLiteral( "outputFile" ); }
|
||||
QString type() const override { return typeName(); }
|
||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
|
||||
/**
|
||||
* A color to represent a file output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ };
|
||||
QColor getColor() const override;
|
||||
QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override;
|
||||
};
|
||||
|
||||
/**
|
||||
@ -572,12 +571,12 @@ class CORE_EXPORT QgsProcessingOutputVectorTileLayer : public QgsProcessingOutpu
|
||||
* Returns the type name for the output class.
|
||||
*/
|
||||
static QString typeName() { return QStringLiteral( "outputVectorTile" ); }
|
||||
QString type() const override { return typeName(); }
|
||||
|
||||
/**
|
||||
* A color to represent a vector tile layer output
|
||||
*/
|
||||
QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ };
|
||||
QColor getColor() const override;
|
||||
QString type() const override { return typeName(); }
|
||||
};
|
||||
|
||||
#endif // QGSPROCESSINGOUTPUTS_H
|
||||
|
@ -212,13 +212,6 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp
|
||||
|
||||
QColor QgsModelDesignerSocketGraphicItem::getColor()
|
||||
{
|
||||
// Possibly, the mComponentItem is an instance of QgsModelParameterGraphicItem. In this case,
|
||||
// it needs to be explicitly casted so that the relevant getLinkedParamDataType method is being called
|
||||
if ( QgsModelParameterGraphicItem *paramItem = dynamic_cast<QgsModelParameterGraphicItem *>( componentItem() ) )
|
||||
{
|
||||
return paramItem->getLinkColor( mEdge, mIndex );
|
||||
}
|
||||
|
||||
return componentItem()->getLinkColor( mEdge, mIndex );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user