From 99613254d1ca38c0e9403a9b6ab28991d8b45c73 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Wed, 7 May 2025 18:39:13 +0200 Subject: [PATCH 01/42] adding model designer style customization --- ...qgsprocessingmodelchildparametersource.cpp | 15 +- .../qgsprocessingmodelchildparametersource.h | 5 + .../processing/models/qgsmodelarrowitem.cpp | 18 +- .../models/qgsmodelcomponentgraphicitem.cpp | 218 +++++++++++++---- .../models/qgsmodelcomponentgraphicitem.h | 6 +- .../processing/models/qgsmodelgraphicitem.cpp | 219 +++++++++++++++++- .../processing/models/qgsmodelgraphicitem.h | 13 +- 7 files changed, 445 insertions(+), 49 deletions(-) diff --git a/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp b/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp index fdbb0910503..6b24b5c32ff 100644 --- a/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp +++ b/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp @@ -224,8 +224,21 @@ QString QgsProcessingModelChildParameterSource::friendlyIdentifier( QgsProcessin switch ( mSource ) { case Qgis::ProcessingModelChildParameterSource::ModelParameter: - return model ? model->parameterDefinition( mParameterName )->description() : mParameterName; + { + if (model) { + const QgsProcessingParameterDefinition* paramDefinition = model->parameterDefinition( mParameterName ); + // A model can be valid (non null) but we could be looking for a null parameter (if input if not set yet) + if (paramDefinition == nullptr) { + return mParameterName; + } else { + return model->parameterDefinition( mParameterName )->description(); + } + + } else { + return mParameterName; + } + } case Qgis::ProcessingModelChildParameterSource::ChildOutput: { if ( model ) diff --git a/src/core/processing/models/qgsprocessingmodelchildparametersource.h b/src/core/processing/models/qgsprocessingmodelchildparametersource.h index f4cbb128f5c..24a050a8408 100644 --- a/src/core/processing/models/qgsprocessingmodelchildparametersource.h +++ b/src/core/processing/models/qgsprocessingmodelchildparametersource.h @@ -230,6 +230,11 @@ class CORE_EXPORT QgsProcessingModelChildParameterSource */ QString friendlyIdentifier( QgsProcessingModelAlgorithm *model ) const; + /** + * Returns the type of source + */ + Qgis::ProcessingModelChildParameterSource getSourceType() { return mSource; } + private: Qgis::ProcessingModelChildParameterSource mSource = Qgis::ProcessingModelChildParameterSource::StaticValue; diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index 47d0356bdbc..9caa42d5867 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -20,6 +20,7 @@ #include "qgsapplication.h" #include "qgsmodelgraphicsscene.h" #include "qgsmodelcomponentgraphicitem.h" +#include "qgsmodelgraphicitem.h" #include #include #include @@ -72,7 +73,19 @@ QgsModelArrowItem::QgsModelArrowItem( QgsModelComponentGraphicItem *startItem, M void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * ) { - QColor color = mColor; + QString dataType; + + // Possibly, the mComponentItem is an instance of QgsModelParameterGraphicItem. In this case, + // it needs to be explicitely casted so that the relevant getLinkedParamDataType method is being called + if (QgsModelParameterGraphicItem *paramItem = dynamic_cast(mStartItem)){ + dataType = paramItem->getLinkedParamDataType(mStartEdge, mStartIndex); + } + else + { + dataType = mStartItem->getLinkedParamDataType(mStartEdge, mStartIndex); + } + + QColor color = QgsModelDesignerSocketGraphicItem::typeToColorLookup(dataType); if ( mStartItem->state() == QgsModelComponentGraphicItem::Selected || mEndItem->state() == QgsModelComponentGraphicItem::Selected ) color.setAlpha( 220 ); @@ -83,12 +96,11 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem QPen p = pen(); p.setColor( color ); - p.setWidth( 1 ); + p.setWidth( 2 ); painter->setPen( p ); painter->setBrush( color ); painter->setRenderHint( QPainter::Antialiasing ); - switch ( mStartMarker ) { case Marker::Circle: diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index ae627fab074..16a9d7f1045 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -29,6 +29,7 @@ #include "qgsmodelviewmouseevent.h" #include "qgsmodelgroupboxdefinitionwidget.h" #include "qgsmessagelog.h" +#include "qgsprocessingparameters.h" #include #include @@ -498,35 +499,51 @@ QPixmap QgsModelComponentGraphicItem::iconPixmap() const void QgsModelComponentGraphicItem::updateButtonPositions() { + bool isParameter = dynamic_cast(mComponent.get()) != nullptr; mEditButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, itemSize().height() / 2.0 - mButtonSize.height() / 2.0 - BUTTON_MARGIN ) ); mDeleteButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, mButtonSize.height() / 2.0 - itemSize().height() / 2.0 + BUTTON_MARGIN ) ); - if ( mExpandTopButton ) - { - const QPointF pt = linkPoint( Qt::TopEdge, -1, true ); - mExpandTopButton->setPosition( QPointF( 0, pt.y() ) ); - } - if ( mExpandBottomButton ) - { - const QPointF pt = linkPoint( Qt::BottomEdge, -1, false ); - mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) ); - } + if (isParameter) { + if ( mExpandBottomButton ) + { + const QPointF pt = linkPoint( Qt::BottomEdge, -1, false ); + mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) ); + } + bool collapsed = mComponent->linksCollapsed( Qt::BottomEdge ); + for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mOutSockets ) ) + { + const QPointF pt = linkPoint( Qt::BottomEdge, socket->index(), false ); + socket->setPosition( pt ); + socket->setVisible( !collapsed ); + } + } else { + if ( mExpandTopButton ) + { + const QPointF pt = linkPoint( Qt::TopEdge, -1, true ); + mExpandTopButton->setPosition( QPointF( 0, pt.y() ) ); + } + if ( mExpandBottomButton ) + { + const QPointF pt = linkPoint( Qt::BottomEdge, -1, false ); + mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) ); + } - bool collapsed = mComponent->linksCollapsed( Qt::TopEdge ); - for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mInSockets ) ) - { - const QPointF pt = linkPoint( Qt::TopEdge, socket->index(), true ); - socket->setPosition( pt ); - socket->setVisible( !collapsed ); - } + bool collapsed = mComponent->linksCollapsed( Qt::TopEdge ); + for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mInSockets ) ) + { + const QPointF pt = linkPoint( Qt::TopEdge, socket->index(), true ); + socket->setPosition( pt ); + socket->setVisible( !collapsed ); + } - collapsed = mComponent->linksCollapsed( Qt::BottomEdge ); - for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mOutSockets ) ) - { - const QPointF pt = linkPoint( Qt::BottomEdge, socket->index(), false ); - socket->setPosition( pt ); - socket->setVisible( !collapsed ); + collapsed = mComponent->linksCollapsed( Qt::BottomEdge ); + for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mOutSockets ) ) + { + const QPointF pt = linkPoint( Qt::BottomEdge, socket->index(), false ); + socket->setPosition( pt ); + socket->setVisible( !collapsed ); + } } } @@ -562,16 +579,17 @@ void QgsModelComponentGraphicItem::fold( Qt::Edge edge, bool folded ) // also need to update the model's stored component // TODO - this is not so nice, consider moving this to model class - if ( QgsProcessingModelChildAlgorithm *child = dynamic_cast( mComponent.get() ) ) + if ( QgsProcessingModelChildAlgorithm *child = dynamic_cast( mComponent.get() ) ){ mModel->childAlgorithm( child->childId() ).setLinksCollapsed( edge, folded ); - else if ( QgsProcessingModelParameter *param = dynamic_cast( mComponent.get() ) ) - mModel->parameterComponent( param->parameterName() ).setLinksCollapsed( edge, folded ); - else if ( QgsProcessingModelOutput *output = dynamic_cast( mComponent.get() ) ) + } else if ( QgsProcessingModelParameter *param = dynamic_cast( mComponent.get() ) ) { + QString paramName = param->parameterName(); + QgsProcessingModelParameter paramComp = mModel->parameterComponent( paramName ); + paramComp.setLinksCollapsed( edge, folded ); + } else if ( QgsProcessingModelOutput *output = dynamic_cast( mComponent.get() ) ){ mModel->childAlgorithm( output->childId() ).modelOutput( output->name() ).setLinksCollapsed( edge, folded ); - + } updateButtonPositions(); - prepareGeometryChange(); emit updateArrowPaths(); emit changed(); @@ -627,8 +645,8 @@ QPointF QgsModelComponentGraphicItem::linkPoint( Qt::Edge edge, int index, bool const QFontMetricsF fm( mFont ); const double w = fm.boundingRect( text ).width(); const double h = fm.height() * 1.2 * ( pointIndex + 1 ) + fm.height() / 2.0; - const double y = h + itemSize().height() / 2.0 + 5; - const double x = !mComponent->linksCollapsed( Qt::BottomEdge ) ? ( -itemSize().width() / 2 + 33 + w + 5 ) : 10; + const double y = h + itemSize().height() / 2.0 + 6; + const double x = !mComponent->linksCollapsed( Qt::BottomEdge ) ? ( -itemSize().width() / 2 + 33 + w + 10 ) : 10; return QPointF( incoming ? -itemSize().width() / 2 + offsetX : x, y ); } break; @@ -842,6 +860,18 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) ) { QString text = this->model()->parameterDefinition( parameter->parameterName() )->type(); + + // Getting the default value to append to the box name + if (const QgsProcessingParameterDefinition *paramDef = this->model()->parameterDefinition(parameter->parameterName())) + { + QVariant paramValue = paramDef->defaultValue(); + + if (paramValue.isValid() && !paramValue.toString().isEmpty()) + { + text += ": " + paramValue.toString(); + } + } + return truncatedTextForItem( text ); } @@ -849,6 +879,26 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const return QString(); } + + +QString QgsModelParameterGraphicItem::getLinkedParamDataType(Qt::Edge edge, int index) +{ + QString unknownType = QString("unknown"); + + if ( index < 0 ) + { + return unknownType; + } + + if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) ) + { + return this->model()->parameterDefinition( parameter->parameterName() )->type(); + } + + return unknownType; +} + + void QgsModelParameterGraphicItem::updateStoredComponentPosition( const QPointF &pos, const QSizeF &size ) { if ( QgsProcessingModelParameter *param = dynamic_cast( component() ) ) @@ -1087,6 +1137,48 @@ int QgsModelChildAlgorithmGraphicItem::linkPointCount( Qt::Edge edge ) const return 0; } + +QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int index) +{ + QString unknownType = QString("unknown"); + + if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast( component() ) ) + { + if ( !child->algorithm() ) { + return unknownType; + } + + switch ( edge ) + { + case Qt::BottomEdge: + { + if (index <= child->algorithm()->outputDefinitions().size() - 1) { + return child->algorithm()->outputDefinitions().at(index)->type(); + } + return unknownType; + } + case Qt::TopEdge: + { + QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions(); + + if (index <= params.size() - 1) { + return params.at(index)->type(); + } + + return unknownType; + } + + case Qt::LeftEdge: + case Qt::RightEdge: + break; + } + } + + return unknownType; +} + + + QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int index ) const { if ( index < 0 ) @@ -1099,6 +1191,7 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind const QVariantMap inputs = mResults.inputs(); const QVariantMap outputs = mResults.outputs(); + switch ( edge ) { case Qt::BottomEdge: @@ -1115,10 +1208,6 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind const QgsProcessingOutputDefinition *output = child->algorithm()->outputDefinitions().at( index ); QString title = output->description(); - if ( outputs.contains( output->name() ) ) - { - title += QStringLiteral( ": %1" ).arg( outputs.value( output->name() ).toString() ); - } return truncatedTextForItem( title ); } @@ -1140,9 +1229,60 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind return QString(); } - QString title = params.at( index )->description(); - if ( !inputs.value( params.at( index )->name() ).toString().isEmpty() ) - title += QStringLiteral( ": %1" ).arg( inputs.value( params.at( index )->name() ).toString() ); + const QgsProcessingParameterDefinition* param = params.at( index ); + QString name = param->name(); + QString title = param->description(); + + + QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value(name); + QString paramValueAsStr = ""; + + if (paramSources.size() > 0) { + QgsProcessingModelChildParameterSource firstParamSource = paramSources[0]; + + switch(firstParamSource.getSourceType()) { + + case Qgis::ProcessingModelChildParameterSource::ChildOutput: + paramValueAsStr = QStringLiteral( ": %1" ).arg( + firstParamSource.friendlyIdentifier(const_cast(model())) + ); + break; + + case Qgis::ProcessingModelChildParameterSource::Expression: + paramValueAsStr = QStringLiteral( ": %1" ).arg(firstParamSource.expression()); + break; + + case Qgis::ProcessingModelChildParameterSource::ExpressionText: + paramValueAsStr = QStringLiteral( ": %1" ).arg(firstParamSource.expressionText()); + break; + + case Qgis::ProcessingModelChildParameterSource::ModelOutput: + paramValueAsStr = QStringLiteral( ": output from '%1'" ).arg( + firstParamSource.friendlyIdentifier(const_cast(model())) + ); + break; + + case Qgis::ProcessingModelChildParameterSource::ModelParameter: + { + QString friendlyName = firstParamSource.friendlyIdentifier(const_cast(model())); + paramValueAsStr = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": value from '%1'" ).arg(friendlyName); + break; + } + + case Qgis::ProcessingModelChildParameterSource::StaticValue: + default: + QVariant paramValue = paramSources[0].staticValue(); + paramValueAsStr = QStringLiteral( ": %1" ).arg(paramValue.toString()); + + // In case of an enum, we want to display the label of the enum value (and not just its index as an int) + if (param->type() == QgsProcessingParameterEnum::typeName()) { + const QgsProcessingParameterEnum* paramAsEnumParam = dynamic_cast(param); + paramValueAsStr = QStringLiteral( ": %1" ).arg(paramAsEnumParam->options().at(paramValue.toInt())); + } + } + title += paramValueAsStr; + } + return truncatedTextForItem( title ); } @@ -1172,7 +1312,7 @@ bool QgsModelChildAlgorithmGraphicItem::canDeleteComponent() return false; } -void QgsModelChildAlgorithmGraphicItem::setResults( const QgsProcessingModelChildAlgorithmResult &results ) +void QgsModelChildAlgorithmGraphicItem::setResults( const QgsProcessingModelChildAlgorithmResult &results) { if ( mResults == results ) return; diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h index 8b56de1697b..a8e8a9b730b 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h @@ -137,6 +137,8 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject */ void setItemRect( QRectF rect ); + QString getLinkedParamDataType(Qt::Edge edge, int index); + #ifndef SIP_RUN /** @@ -237,7 +239,7 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject /** * Returns the output socket graphics items at the specified \a index. - * + * * May return NULLPTR if no corresponding output socket exists. * \since QGIS 3.44 */ @@ -427,6 +429,8 @@ class GUI_EXPORT QgsModelParameterGraphicItem : public QgsModelComponentGraphicI void contextMenuEvent( QGraphicsSceneContextMenuEvent *event ) override; bool canDeleteComponent() override; + QString getLinkedParamDataType( Qt::Edge edge, int index ); + protected: QColor fillColor( State state ) const override; QColor strokeColor( State state ) const override; diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index 5afe026c680..c6497df9cf8 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -21,6 +21,11 @@ #include "qgsmodelgraphicsview.h" #include "qgsmodelviewtool.h" #include "qgsmodelviewmouseevent.h" +#include "qgsprocessingmodelcomponent.h" +#include "qgsprocessingoutputs.h" +#include "qgsprocessingparameters.h" +#include "qgsprocessingmodelchildalgorithm.h" +#include "qgsprocessingalgorithm.h" #include #include #include @@ -180,12 +185,20 @@ QgsModelDesignerSocketGraphicItem::QgsModelDesignerSocketGraphicItem( QgsModelCo void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * ) { - painter->setPen( QPen() ); - painter->setBrush( QBrush( QColor( 0, 0, 0, mHoverState ? 200 : 33 ), Qt::SolidPattern ) ); + + QColor outlineColor = getColor(); + QColor fillColor = QColor(outlineColor); + fillColor.setAlpha(isDefaultParamValue() ? 30 : 255); + + // Outline style + painter->setPen(QPen(outlineColor, mHoverState ? mSocketOutlineWidth * 2 : mSocketOutlineWidth)); + + // Fill style + painter->setBrush( QBrush( fillColor, Qt::SolidPattern ) ); painter->setRenderHint( QPainter::Antialiasing ); - constexpr float DISPLAY_SIZE = 3.2; + constexpr float DISPLAY_SIZE = 4; painter->drawEllipse( position(), DISPLAY_SIZE, DISPLAY_SIZE ); /* Uncomment to display bounding box */ #if 0 @@ -197,4 +210,204 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp #endif } + +QColor QgsModelDesignerSocketGraphicItem::getColor() { + QString dataType; + + // Possibly, the mComponentItem is an instance of QgsModelParameterGraphicItem. In this case, + // it needs to be explicitely casted so that the relevant getLinkedParamDataType method is being called + if (QgsModelParameterGraphicItem *paramItem = dynamic_cast(componentItem())) + { + dataType = paramItem->getLinkedParamDataType(mEdge, mIndex); + } + else + { + dataType = componentItem()->getLinkedParamDataType(mEdge, mIndex); + } + + return QgsModelDesignerSocketGraphicItem::typeToColorLookup(dataType); + +} + + +QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup(QString dataType) { + + // Numerical types + if( + dataType == QgsProcessingParameterMatrix::typeName() || + dataType == QgsProcessingParameterNumber::typeName() || + dataType == QgsProcessingParameterRange::typeName() || + dataType == QgsProcessingParameterColor::typeName() || + dataType == QgsProcessingOutputNumber::typeName() || + dataType == QgsProcessingParameterDistance::typeName() || + dataType == QgsProcessingParameterDuration::typeName() || + dataType == QgsProcessingParameterScale::typeName() + + ) { + return QColor(34, 157, 214); + } else + + // Boolean type + if( + dataType == QgsProcessingParameterBoolean::typeName() || + dataType == QgsProcessingOutputBoolean::typeName() + ) { + return QColor(51, 201, 28); + } else + + // Vector types + if( + dataType == QgsProcessingParameterPoint::typeName() || + dataType == QgsProcessingParameterGeometry::typeName() || + dataType == QgsProcessingParameterVectorLayer::typeName() || + dataType == QgsProcessingParameterMeshLayer::typeName() || + dataType == QgsProcessingParameterPointCloudLayer::typeName() || + dataType == QgsProcessingOutputVectorLayer::typeName() || + dataType == QgsProcessingOutputPointCloudLayer::typeName() || + dataType == QgsProcessingParameterExtent::typeName() || + dataType == QgsProcessingOutputVectorTileLayer::typeName() || + dataType == QgsProcessingParameterPointCloudDestination::typeName() || + dataType == QgsProcessingParameterVectorTileDestination::typeName() || + dataType == QgsProcessingParameterVectorDestination::typeName() || + dataType == QgsProcessingParameterFeatureSource::typeName() + ) { + return QColor(180, 180, 0); + } else + + // Raster type + if( + dataType == QgsProcessingParameterRasterLayer::typeName() || + dataType == QgsProcessingOutputRasterLayer::typeName() + + ) { + return QColor(0, 180, 180); + } else + + // enum + if( + dataType == QgsProcessingParameterEnum::typeName() + ) { + return QColor(128, 68, 201); + } else + + // String and datetime types + if( + dataType == QgsProcessingParameterString::typeName() || + dataType == QgsProcessingParameterDateTime::typeName() || + dataType == QgsProcessingParameterCrs::typeName() || + dataType == QgsProcessingOutputHtml::typeName() || + dataType == QgsProcessingOutputString::typeName() + + ) { + return QColor(100, 100, 255); + } else + + // filesystem types + if( + dataType == QgsProcessingParameterFile::typeName() || + dataType == QgsProcessingOutputFolder::typeName() || + dataType == QgsProcessingOutputFile::typeName() || + dataType == QgsProcessingParameterFolderDestination::typeName() || + dataType == QgsProcessingParameterFeatureSink::typeName() || + dataType == QgsProcessingParameterRasterDestination::typeName() || + dataType == QgsProcessingParameterFileDestination::typeName() + ) { + return QColor(80, 80, 80); + } else + + // Expression type + if(dataType == QgsProcessingParameterExpression::typeName()) { + return QColor(180, 80, 180); + } else + + // Other Layer types + if( + dataType == QgsProcessingParameterMultipleLayers::typeName() || + dataType == QgsProcessingParameterMapLayer::typeName() || + dataType == QgsProcessingParameterAnnotationLayer::typeName() || + dataType == QgsProcessingOutputMultipleLayers::typeName() + + ) { + return QColor(128, 128, 0); + } else + + // Default color, applies for: + // QgsProcessingParameterField + // QgsProcessingParameterMapTheme + // QgsProcessingParameterBand + // QgsProcessingParameterLayout + // QgsProcessingParameterLayoutItem + // QgsProcessingParameterCoordinateOperation + // QgsProcessingParameterAuthConfig // config + // QgsProcessingParameterDatabaseSchema + // QgsProcessingParameterDatabaseTable + // QgsProcessingParameterProviderConnection + // QgsProcessingParameterPointCloudAttribute + // QgsProcessingOutputVariant + // QgsProcessingOutputConditionalBranch + { + return QColor(128, 128, 128); + } +} + + +bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() { + if (!mComponent) { + return false; + } + + const QgsProcessingModelChildAlgorithm *child = dynamic_cast( mComponent ); + + if (!child) { + return false; + } + + bool isDefaultValue = true; + + // We can only know if the socket should be filled if the algorithm is non null + if (child->algorithm()) { + switch ( mEdge ) + { + // Input params + case Qt::TopEdge: + { + QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions(); + + if ( mIndex > (params.length() - 1) ) { + break; + } + + const QgsProcessingParameterDefinition* param = params.at( mIndex ); + QString name = param->name(); + + QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value(name); + if (paramSources.size() == 0) { + break; + } + + // The default value can only happen in the case of the parameter uses a static value + if (paramSources[0].getSourceType() != Qgis::ProcessingModelChildParameterSource::StaticValue) { + isDefaultValue = false; + break; + } + + isDefaultValue = paramSources[0].staticValue() == param->defaultValue(); + break; + } + + // Ouputs + case Qt::BottomEdge: + { + + break; + } + case Qt::LeftEdge: + case Qt::RightEdge: + break; + } + } + + return isDefaultValue; +} + ///@endcond diff --git a/src/gui/processing/models/qgsmodelgraphicitem.h b/src/gui/processing/models/qgsmodelgraphicitem.h index a892d87d917..58e205321b8 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.h +++ b/src/gui/processing/models/qgsmodelgraphicitem.h @@ -158,6 +158,8 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat { Q_OBJECT public: + static QColor typeToColorLookup(QString dataType); + /** * Constructor for QgsModelDesignerSocketGraphicItem, with the specified \a parent item. * @@ -170,7 +172,7 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = nullptr ) override; /** - * Returns the index of this socket in either QgsModelDesignerSocketGraphicItem::mInSockets + * Returns the index of this socket in either QgsModelDesignerSocketGraphicItem::mInSockets * or QgsModelDesignerSocketGraphicItem::mOutSockets array */ int index() const { return mIndex; }; @@ -184,7 +186,7 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat /** * Returns whether the socket is an input socket or not - * + * * Convenient function around mEdge member */ bool isInput() const { return mEdge == Qt::TopEdge; }; @@ -195,6 +197,11 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat /** Return the parent graphic item associated to the socket */ QgsModelComponentGraphicItem *componentItem() { return mComponentItem; }; + /* Returns the color of the socket based on the type of data the param corresponds to */ + QColor getColor(); + + /* Returns whether the param value bear the default param value */ + bool isDefaultParamValue(); signals: @@ -203,6 +210,8 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat QgsProcessingModelComponent *mComponent = nullptr; int mIndex = -1; Qt::Edge mEdge = Qt::Edge::TopEdge; + QColor mSocketColor = QColor( 200, 200, 200 ); + float mSocketOutlineWidth = 1.5; }; ///@endcond From 192298a3880ffe4fad80151e66e6cf6cc6bf7479 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 8 May 2025 07:16:15 +0000 Subject: [PATCH 02/42] auto-fix pre-commit issues --- .../gui/auto_additions/qgsmodelgraphicitem.py | 1 + .../qgsmodelcomponentgraphicitem.sip.in | 4 + .../models/qgsmodelgraphicitem.sip.in | 12 + .../gui/auto_additions/qgsmodelgraphicitem.py | 1 + .../qgsmodelcomponentgraphicitem.sip.in | 4 + .../models/qgsmodelgraphicitem.sip.in | 12 + .../processing/models/qgsmodelarrowitem.cpp | 9 +- .../models/qgsmodelcomponentgraphicitem.cpp | 83 +++--- .../models/qgsmodelcomponentgraphicitem.h | 2 +- .../processing/models/qgsmodelgraphicitem.cpp | 257 +++++++++--------- .../processing/models/qgsmodelgraphicitem.h | 2 +- 11 files changed, 210 insertions(+), 177 deletions(-) diff --git a/python/PyQt6/gui/auto_additions/qgsmodelgraphicitem.py b/python/PyQt6/gui/auto_additions/qgsmodelgraphicitem.py index b23d278f8f3..650e353643f 100644 --- a/python/PyQt6/gui/auto_additions/qgsmodelgraphicitem.py +++ b/python/PyQt6/gui/auto_additions/qgsmodelgraphicitem.py @@ -13,6 +13,7 @@ try: except (NameError, AttributeError): pass try: + QgsModelDesignerSocketGraphicItem.typeToColorLookup = staticmethod(QgsModelDesignerSocketGraphicItem.typeToColorLookup) QgsModelDesignerSocketGraphicItem.__overridden_methods__ = ['paint'] QgsModelDesignerSocketGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index be30199f191..d0ad7a3d7ec 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -112,6 +112,8 @@ Shows a preview of moving the item from its stored position by ``dx``, Sets a new scene ``rect`` for the item. %End + QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event ); @@ -362,6 +364,8 @@ Ownership of ``parameter`` is transferred to the item. virtual bool canDeleteComponent(); + QString getLinkedParamDataType( Qt::Edge edge, int index ); + protected: virtual QColor fillColor( State state ) const; diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in index 386914d81ac..66f8d637fb0 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in @@ -140,6 +140,8 @@ A socket allowing linking component together. #include "qgsmodelgraphicitem.h" %End public: + static QColor typeToColorLookup( QString dataType ); + QgsModelDesignerSocketGraphicItem( QgsModelComponentGraphicItem *parent /TransferThis/, QgsProcessingModelComponent *component, int index, const QPointF &position, Qt::Edge edge, const QSizeF &size = QSizeF( 11, 11 ) ); %Docstring Constructor for QgsModelDesignerSocketGraphicItem, with the specified @@ -178,6 +180,16 @@ Return the component associated to the socket */ QgsModelComponentGraphicItem *componentItem(); %Docstring Return the parent graphic item associated to the socket */ +%End + QColor getColor(); +%Docstring +Returns the color of the socket based on the type of data the param +corresponds to */ +%End + + bool isDefaultParamValue(); +%Docstring +Returns whether the param value bear the default param value */ %End signals: diff --git a/python/gui/auto_additions/qgsmodelgraphicitem.py b/python/gui/auto_additions/qgsmodelgraphicitem.py index b23d278f8f3..650e353643f 100644 --- a/python/gui/auto_additions/qgsmodelgraphicitem.py +++ b/python/gui/auto_additions/qgsmodelgraphicitem.py @@ -13,6 +13,7 @@ try: except (NameError, AttributeError): pass try: + QgsModelDesignerSocketGraphicItem.typeToColorLookup = staticmethod(QgsModelDesignerSocketGraphicItem.typeToColorLookup) QgsModelDesignerSocketGraphicItem.__overridden_methods__ = ['paint'] QgsModelDesignerSocketGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): diff --git a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index 74efa849e02..893c8baa8ae 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -112,6 +112,8 @@ Shows a preview of moving the item from its stored position by ``dx``, Sets a new scene ``rect`` for the item. %End + QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event ); @@ -362,6 +364,8 @@ Ownership of ``parameter`` is transferred to the item. virtual bool canDeleteComponent(); + QString getLinkedParamDataType( Qt::Edge edge, int index ); + protected: virtual QColor fillColor( State state ) const; diff --git a/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in index 386914d81ac..66f8d637fb0 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in @@ -140,6 +140,8 @@ A socket allowing linking component together. #include "qgsmodelgraphicitem.h" %End public: + static QColor typeToColorLookup( QString dataType ); + QgsModelDesignerSocketGraphicItem( QgsModelComponentGraphicItem *parent /TransferThis/, QgsProcessingModelComponent *component, int index, const QPointF &position, Qt::Edge edge, const QSizeF &size = QSizeF( 11, 11 ) ); %Docstring Constructor for QgsModelDesignerSocketGraphicItem, with the specified @@ -178,6 +180,16 @@ Return the component associated to the socket */ QgsModelComponentGraphicItem *componentItem(); %Docstring Return the parent graphic item associated to the socket */ +%End + QColor getColor(); +%Docstring +Returns the color of the socket based on the type of data the param +corresponds to */ +%End + + bool isDefaultParamValue(); +%Docstring +Returns whether the param value bear the default param value */ %End signals: diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index 9caa42d5867..ad1d52545b9 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -77,15 +77,16 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem // Possibly, the mComponentItem is an instance of QgsModelParameterGraphicItem. In this case, // it needs to be explicitely casted so that the relevant getLinkedParamDataType method is being called - if (QgsModelParameterGraphicItem *paramItem = dynamic_cast(mStartItem)){ - dataType = paramItem->getLinkedParamDataType(mStartEdge, mStartIndex); + if ( QgsModelParameterGraphicItem *paramItem = dynamic_cast( mStartItem ) ) + { + dataType = paramItem->getLinkedParamDataType( mStartEdge, mStartIndex ); } else { - dataType = mStartItem->getLinkedParamDataType(mStartEdge, mStartIndex); + dataType = mStartItem->getLinkedParamDataType( mStartEdge, mStartIndex ); } - QColor color = QgsModelDesignerSocketGraphicItem::typeToColorLookup(dataType); + QColor color = QgsModelDesignerSocketGraphicItem::typeToColorLookup( dataType ); if ( mStartItem->state() == QgsModelComponentGraphicItem::Selected || mEndItem->state() == QgsModelComponentGraphicItem::Selected ) color.setAlpha( 220 ); diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 16a9d7f1045..95d4f366095 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -499,11 +499,12 @@ QPixmap QgsModelComponentGraphicItem::iconPixmap() const void QgsModelComponentGraphicItem::updateButtonPositions() { - bool isParameter = dynamic_cast(mComponent.get()) != nullptr; + bool isParameter = dynamic_cast( mComponent.get() ) != nullptr; mEditButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, itemSize().height() / 2.0 - mButtonSize.height() / 2.0 - BUTTON_MARGIN ) ); mDeleteButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, mButtonSize.height() / 2.0 - itemSize().height() / 2.0 + BUTTON_MARGIN ) ); - if (isParameter) { + if ( isParameter ) + { if ( mExpandBottomButton ) { const QPointF pt = linkPoint( Qt::BottomEdge, -1, false ); @@ -517,7 +518,9 @@ void QgsModelComponentGraphicItem::updateButtonPositions() socket->setPosition( pt ); socket->setVisible( !collapsed ); } - } else { + } + else + { if ( mExpandTopButton ) { const QPointF pt = linkPoint( Qt::TopEdge, -1, true ); @@ -579,13 +582,18 @@ void QgsModelComponentGraphicItem::fold( Qt::Edge edge, bool folded ) // also need to update the model's stored component // TODO - this is not so nice, consider moving this to model class - if ( QgsProcessingModelChildAlgorithm *child = dynamic_cast( mComponent.get() ) ){ + if ( QgsProcessingModelChildAlgorithm *child = dynamic_cast( mComponent.get() ) ) + { mModel->childAlgorithm( child->childId() ).setLinksCollapsed( edge, folded ); - } else if ( QgsProcessingModelParameter *param = dynamic_cast( mComponent.get() ) ) { + } + else if ( QgsProcessingModelParameter *param = dynamic_cast( mComponent.get() ) ) + { QString paramName = param->parameterName(); QgsProcessingModelParameter paramComp = mModel->parameterComponent( paramName ); paramComp.setLinksCollapsed( edge, folded ); - } else if ( QgsProcessingModelOutput *output = dynamic_cast( mComponent.get() ) ){ + } + else if ( QgsProcessingModelOutput *output = dynamic_cast( mComponent.get() ) ) + { mModel->childAlgorithm( output->childId() ).modelOutput( output->name() ).setLinksCollapsed( edge, folded ); } @@ -862,11 +870,11 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const QString text = this->model()->parameterDefinition( parameter->parameterName() )->type(); // Getting the default value to append to the box name - if (const QgsProcessingParameterDefinition *paramDef = this->model()->parameterDefinition(parameter->parameterName())) + if ( const QgsProcessingParameterDefinition *paramDef = this->model()->parameterDefinition( parameter->parameterName() ) ) { QVariant paramValue = paramDef->defaultValue(); - if (paramValue.isValid() && !paramValue.toString().isEmpty()) + if ( paramValue.isValid() && !paramValue.toString().isEmpty() ) { text += ": " + paramValue.toString(); } @@ -880,10 +888,9 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const } - -QString QgsModelParameterGraphicItem::getLinkedParamDataType(Qt::Edge edge, int index) +QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge edge, int index ) { - QString unknownType = QString("unknown"); + QString unknownType = QString( "unknown" ); if ( index < 0 ) { @@ -1138,13 +1145,14 @@ int QgsModelChildAlgorithmGraphicItem::linkPointCount( Qt::Edge edge ) const } -QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int index) +QString QgsModelComponentGraphicItem::getLinkedParamDataType( Qt::Edge edge, int index ) { - QString unknownType = QString("unknown"); + QString unknownType = QString( "unknown" ); if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast( component() ) ) { - if ( !child->algorithm() ) { + if ( !child->algorithm() ) + { return unknownType; } @@ -1152,8 +1160,9 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int { case Qt::BottomEdge: { - if (index <= child->algorithm()->outputDefinitions().size() - 1) { - return child->algorithm()->outputDefinitions().at(index)->type(); + if ( index <= child->algorithm()->outputDefinitions().size() - 1 ) + { + return child->algorithm()->outputDefinitions().at( index )->type(); } return unknownType; } @@ -1161,8 +1170,9 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int { QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions(); - if (index <= params.size() - 1) { - return params.at(index)->type(); + if ( index <= params.size() - 1 ) + { + return params.at( index )->type(); } return unknownType; @@ -1178,7 +1188,6 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int } - QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int index ) const { if ( index < 0 ) @@ -1229,55 +1238,55 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind return QString(); } - const QgsProcessingParameterDefinition* param = params.at( index ); + const QgsProcessingParameterDefinition *param = params.at( index ); QString name = param->name(); QString title = param->description(); - QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value(name); + QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name ); QString paramValueAsStr = ""; - if (paramSources.size() > 0) { + if ( paramSources.size() > 0 ) + { QgsProcessingModelChildParameterSource firstParamSource = paramSources[0]; - switch(firstParamSource.getSourceType()) { - + switch ( firstParamSource.getSourceType() ) + { case Qgis::ProcessingModelChildParameterSource::ChildOutput: paramValueAsStr = QStringLiteral( ": %1" ).arg( - firstParamSource.friendlyIdentifier(const_cast(model())) + firstParamSource.friendlyIdentifier( const_cast( model() ) ) ); break; case Qgis::ProcessingModelChildParameterSource::Expression: - paramValueAsStr = QStringLiteral( ": %1" ).arg(firstParamSource.expression()); + paramValueAsStr = QStringLiteral( ": %1" ).arg( firstParamSource.expression() ); break; case Qgis::ProcessingModelChildParameterSource::ExpressionText: - paramValueAsStr = QStringLiteral( ": %1" ).arg(firstParamSource.expressionText()); + paramValueAsStr = QStringLiteral( ": %1" ).arg( firstParamSource.expressionText() ); break; case Qgis::ProcessingModelChildParameterSource::ModelOutput: - paramValueAsStr = QStringLiteral( ": output from '%1'" ).arg( - firstParamSource.friendlyIdentifier(const_cast(model())) - ); + paramValueAsStr = QStringLiteral( ": output from '%1'" ).arg( firstParamSource.friendlyIdentifier( const_cast( model() ) ) ); break; case Qgis::ProcessingModelChildParameterSource::ModelParameter: { - QString friendlyName = firstParamSource.friendlyIdentifier(const_cast(model())); - paramValueAsStr = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": value from '%1'" ).arg(friendlyName); + QString friendlyName = firstParamSource.friendlyIdentifier( const_cast( model() ) ); + paramValueAsStr = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": value from '%1'" ).arg( friendlyName ); break; } case Qgis::ProcessingModelChildParameterSource::StaticValue: default: QVariant paramValue = paramSources[0].staticValue(); - paramValueAsStr = QStringLiteral( ": %1" ).arg(paramValue.toString()); + paramValueAsStr = QStringLiteral( ": %1" ).arg( paramValue.toString() ); // In case of an enum, we want to display the label of the enum value (and not just its index as an int) - if (param->type() == QgsProcessingParameterEnum::typeName()) { - const QgsProcessingParameterEnum* paramAsEnumParam = dynamic_cast(param); - paramValueAsStr = QStringLiteral( ": %1" ).arg(paramAsEnumParam->options().at(paramValue.toInt())); + if ( param->type() == QgsProcessingParameterEnum::typeName() ) + { + const QgsProcessingParameterEnum *paramAsEnumParam = dynamic_cast( param ); + paramValueAsStr = QStringLiteral( ": %1" ).arg( paramAsEnumParam->options().at( paramValue.toInt() ) ); } } title += paramValueAsStr; @@ -1312,7 +1321,7 @@ bool QgsModelChildAlgorithmGraphicItem::canDeleteComponent() return false; } -void QgsModelChildAlgorithmGraphicItem::setResults( const QgsProcessingModelChildAlgorithmResult &results) +void QgsModelChildAlgorithmGraphicItem::setResults( const QgsProcessingModelChildAlgorithmResult &results ) { if ( mResults == results ) return; diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h index a8e8a9b730b..32e900eaa24 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h @@ -137,7 +137,7 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject */ void setItemRect( QRectF rect ); - QString getLinkedParamDataType(Qt::Edge edge, int index); + QString getLinkedParamDataType( Qt::Edge edge, int index ); #ifndef SIP_RUN diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index c6497df9cf8..cd5c9890f99 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -185,13 +185,12 @@ QgsModelDesignerSocketGraphicItem::QgsModelDesignerSocketGraphicItem( QgsModelCo void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * ) { - QColor outlineColor = getColor(); - QColor fillColor = QColor(outlineColor); - fillColor.setAlpha(isDefaultParamValue() ? 30 : 255); + QColor fillColor = QColor( outlineColor ); + fillColor.setAlpha( isDefaultParamValue() ? 30 : 255 ); // Outline style - painter->setPen(QPen(outlineColor, mHoverState ? mSocketOutlineWidth * 2 : mSocketOutlineWidth)); + painter->setPen( QPen( outlineColor, mHoverState ? mSocketOutlineWidth * 2 : mSocketOutlineWidth ) ); // Fill style painter->setBrush( QBrush( fillColor, Qt::SolidPattern ) ); @@ -211,161 +210,149 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp } -QColor QgsModelDesignerSocketGraphicItem::getColor() { +QColor QgsModelDesignerSocketGraphicItem::getColor() +{ QString dataType; // Possibly, the mComponentItem is an instance of QgsModelParameterGraphicItem. In this case, // it needs to be explicitely casted so that the relevant getLinkedParamDataType method is being called - if (QgsModelParameterGraphicItem *paramItem = dynamic_cast(componentItem())) + if ( QgsModelParameterGraphicItem *paramItem = dynamic_cast( componentItem() ) ) { - dataType = paramItem->getLinkedParamDataType(mEdge, mIndex); + dataType = paramItem->getLinkedParamDataType( mEdge, mIndex ); } else { - dataType = componentItem()->getLinkedParamDataType(mEdge, mIndex); + dataType = componentItem()->getLinkedParamDataType( mEdge, mIndex ); } - return QgsModelDesignerSocketGraphicItem::typeToColorLookup(dataType); - + return QgsModelDesignerSocketGraphicItem::typeToColorLookup( dataType ); } -QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup(QString dataType) { - +QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) +{ // Numerical types - if( - dataType == QgsProcessingParameterMatrix::typeName() || - dataType == QgsProcessingParameterNumber::typeName() || - dataType == QgsProcessingParameterRange::typeName() || - dataType == QgsProcessingParameterColor::typeName() || - dataType == QgsProcessingOutputNumber::typeName() || - dataType == QgsProcessingParameterDistance::typeName() || - dataType == QgsProcessingParameterDuration::typeName() || - dataType == QgsProcessingParameterScale::typeName() + if ( + dataType == QgsProcessingParameterMatrix::typeName() || dataType == QgsProcessingParameterNumber::typeName() || dataType == QgsProcessingParameterRange::typeName() || dataType == QgsProcessingParameterColor::typeName() || dataType == QgsProcessingOutputNumber::typeName() || dataType == QgsProcessingParameterDistance::typeName() || dataType == QgsProcessingParameterDuration::typeName() || dataType == QgsProcessingParameterScale::typeName() - ) { - return QColor(34, 157, 214); - } else - - // Boolean type - if( - dataType == QgsProcessingParameterBoolean::typeName() || - dataType == QgsProcessingOutputBoolean::typeName() - ) { - return QColor(51, 201, 28); - } else - - // Vector types - if( - dataType == QgsProcessingParameterPoint::typeName() || - dataType == QgsProcessingParameterGeometry::typeName() || - dataType == QgsProcessingParameterVectorLayer::typeName() || - dataType == QgsProcessingParameterMeshLayer::typeName() || - dataType == QgsProcessingParameterPointCloudLayer::typeName() || - dataType == QgsProcessingOutputVectorLayer::typeName() || - dataType == QgsProcessingOutputPointCloudLayer::typeName() || - dataType == QgsProcessingParameterExtent::typeName() || - dataType == QgsProcessingOutputVectorTileLayer::typeName() || - dataType == QgsProcessingParameterPointCloudDestination::typeName() || - dataType == QgsProcessingParameterVectorTileDestination::typeName() || - dataType == QgsProcessingParameterVectorDestination::typeName() || - dataType == QgsProcessingParameterFeatureSource::typeName() - ) { - return QColor(180, 180, 0); - } else - - // Raster type - if( - dataType == QgsProcessingParameterRasterLayer::typeName() || - dataType == QgsProcessingOutputRasterLayer::typeName() - - ) { - return QColor(0, 180, 180); - } else - - // enum - if( - dataType == QgsProcessingParameterEnum::typeName() - ) { - return QColor(128, 68, 201); - } else - - // String and datetime types - if( - dataType == QgsProcessingParameterString::typeName() || - dataType == QgsProcessingParameterDateTime::typeName() || - dataType == QgsProcessingParameterCrs::typeName() || - dataType == QgsProcessingOutputHtml::typeName() || - dataType == QgsProcessingOutputString::typeName() - - ) { - return QColor(100, 100, 255); - } else - - // filesystem types - if( - dataType == QgsProcessingParameterFile::typeName() || - dataType == QgsProcessingOutputFolder::typeName() || - dataType == QgsProcessingOutputFile::typeName() || - dataType == QgsProcessingParameterFolderDestination::typeName() || - dataType == QgsProcessingParameterFeatureSink::typeName() || - dataType == QgsProcessingParameterRasterDestination::typeName() || - dataType == QgsProcessingParameterFileDestination::typeName() - ) { - return QColor(80, 80, 80); - } else - - // Expression type - if(dataType == QgsProcessingParameterExpression::typeName()) { - return QColor(180, 80, 180); - } else - - // Other Layer types - if( - dataType == QgsProcessingParameterMultipleLayers::typeName() || - dataType == QgsProcessingParameterMapLayer::typeName() || - dataType == QgsProcessingParameterAnnotationLayer::typeName() || - dataType == QgsProcessingOutputMultipleLayers::typeName() - - ) { - return QColor(128, 128, 0); - } else - - // Default color, applies for: - // QgsProcessingParameterField - // QgsProcessingParameterMapTheme - // QgsProcessingParameterBand - // QgsProcessingParameterLayout - // QgsProcessingParameterLayoutItem - // QgsProcessingParameterCoordinateOperation - // QgsProcessingParameterAuthConfig // config - // QgsProcessingParameterDatabaseSchema - // QgsProcessingParameterDatabaseTable - // QgsProcessingParameterProviderConnection - // QgsProcessingParameterPointCloudAttribute - // QgsProcessingOutputVariant - // QgsProcessingOutputConditionalBranch + ) { - return QColor(128, 128, 128); + return QColor( 34, 157, 214 ); } + else + + // Boolean type + if ( + dataType == QgsProcessingParameterBoolean::typeName() || dataType == QgsProcessingOutputBoolean::typeName() + ) + { + return QColor( 51, 201, 28 ); + } + else + + // Vector types + if ( + dataType == QgsProcessingParameterPoint::typeName() || dataType == QgsProcessingParameterGeometry::typeName() || dataType == QgsProcessingParameterVectorLayer::typeName() || dataType == QgsProcessingParameterMeshLayer::typeName() || dataType == QgsProcessingParameterPointCloudLayer::typeName() || dataType == QgsProcessingOutputVectorLayer::typeName() || dataType == QgsProcessingOutputPointCloudLayer::typeName() || dataType == QgsProcessingParameterExtent::typeName() || dataType == QgsProcessingOutputVectorTileLayer::typeName() || dataType == QgsProcessingParameterPointCloudDestination::typeName() || dataType == QgsProcessingParameterVectorTileDestination::typeName() || dataType == QgsProcessingParameterVectorDestination::typeName() || dataType == QgsProcessingParameterFeatureSource::typeName() + ) + { + return QColor( 180, 180, 0 ); + } + else + + // Raster type + if ( + dataType == QgsProcessingParameterRasterLayer::typeName() || dataType == QgsProcessingOutputRasterLayer::typeName() + + ) + { + return QColor( 0, 180, 180 ); + } + else + + // enum + if ( + dataType == QgsProcessingParameterEnum::typeName() + ) + { + return QColor( 128, 68, 201 ); + } + else + + // String and datetime types + if ( + dataType == QgsProcessingParameterString::typeName() || dataType == QgsProcessingParameterDateTime::typeName() || dataType == QgsProcessingParameterCrs::typeName() || dataType == QgsProcessingOutputHtml::typeName() || dataType == QgsProcessingOutputString::typeName() + + ) + { + return QColor( 100, 100, 255 ); + } + else + + // filesystem types + if ( + dataType == QgsProcessingParameterFile::typeName() || dataType == QgsProcessingOutputFolder::typeName() || dataType == QgsProcessingOutputFile::typeName() || dataType == QgsProcessingParameterFolderDestination::typeName() || dataType == QgsProcessingParameterFeatureSink::typeName() || dataType == QgsProcessingParameterRasterDestination::typeName() || dataType == QgsProcessingParameterFileDestination::typeName() + ) + { + return QColor( 80, 80, 80 ); + } + else + + // Expression type + if ( dataType == QgsProcessingParameterExpression::typeName() ) + { + return QColor( 180, 80, 180 ); + } + else + + // Other Layer types + if ( + dataType == QgsProcessingParameterMultipleLayers::typeName() || dataType == QgsProcessingParameterMapLayer::typeName() || dataType == QgsProcessingParameterAnnotationLayer::typeName() || dataType == QgsProcessingOutputMultipleLayers::typeName() + + ) + { + return QColor( 128, 128, 0 ); + } + else + + // Default color, applies for: + // QgsProcessingParameterField + // QgsProcessingParameterMapTheme + // QgsProcessingParameterBand + // QgsProcessingParameterLayout + // QgsProcessingParameterLayoutItem + // QgsProcessingParameterCoordinateOperation + // QgsProcessingParameterAuthConfig // config + // QgsProcessingParameterDatabaseSchema + // QgsProcessingParameterDatabaseTable + // QgsProcessingParameterProviderConnection + // QgsProcessingParameterPointCloudAttribute + // QgsProcessingOutputVariant + // QgsProcessingOutputConditionalBranch + { + return QColor( 128, 128, 128 ); + } } -bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() { - if (!mComponent) { +bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() +{ + if ( !mComponent ) + { return false; } const QgsProcessingModelChildAlgorithm *child = dynamic_cast( mComponent ); - if (!child) { + if ( !child ) + { return false; } bool isDefaultValue = true; // We can only know if the socket should be filled if the algorithm is non null - if (child->algorithm()) { + if ( child->algorithm() ) + { switch ( mEdge ) { // Input params @@ -373,20 +360,23 @@ bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() { { QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions(); - if ( mIndex > (params.length() - 1) ) { + if ( mIndex > ( params.length() - 1 ) ) + { break; } - const QgsProcessingParameterDefinition* param = params.at( mIndex ); + const QgsProcessingParameterDefinition *param = params.at( mIndex ); QString name = param->name(); - QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value(name); - if (paramSources.size() == 0) { + QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name ); + if ( paramSources.size() == 0 ) + { break; } // The default value can only happen in the case of the parameter uses a static value - if (paramSources[0].getSourceType() != Qgis::ProcessingModelChildParameterSource::StaticValue) { + if ( paramSources[0].getSourceType() != Qgis::ProcessingModelChildParameterSource::StaticValue ) + { isDefaultValue = false; break; } @@ -398,7 +388,6 @@ bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() { // Ouputs case Qt::BottomEdge: { - break; } case Qt::LeftEdge: diff --git a/src/gui/processing/models/qgsmodelgraphicitem.h b/src/gui/processing/models/qgsmodelgraphicitem.h index 58e205321b8..f0f665e383a 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.h +++ b/src/gui/processing/models/qgsmodelgraphicitem.h @@ -158,7 +158,7 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat { Q_OBJECT public: - static QColor typeToColorLookup(QString dataType); + static QColor typeToColorLookup( QString dataType ); /** * Constructor for QgsModelDesignerSocketGraphicItem, with the specified \a parent item. From 9b45dedeb7eaa2183a3f109c808466700b3b9384 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Mon, 12 May 2025 15:13:05 +0200 Subject: [PATCH 03/42] Added color names --- .../processing/models/qgsmodelgraphicitem.cpp | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index cd5c9890f99..2244e31c589 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -237,7 +237,7 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) ) { - return QColor( 34, 157, 214 ); + return QColor( 34, 157, 214 ); // blue } else @@ -246,7 +246,7 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) dataType == QgsProcessingParameterBoolean::typeName() || dataType == QgsProcessingOutputBoolean::typeName() ) { - return QColor( 51, 201, 28 ); + return QColor( 51, 201, 28 ); // green } else @@ -255,7 +255,7 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) dataType == QgsProcessingParameterPoint::typeName() || dataType == QgsProcessingParameterGeometry::typeName() || dataType == QgsProcessingParameterVectorLayer::typeName() || dataType == QgsProcessingParameterMeshLayer::typeName() || dataType == QgsProcessingParameterPointCloudLayer::typeName() || dataType == QgsProcessingOutputVectorLayer::typeName() || dataType == QgsProcessingOutputPointCloudLayer::typeName() || dataType == QgsProcessingParameterExtent::typeName() || dataType == QgsProcessingOutputVectorTileLayer::typeName() || dataType == QgsProcessingParameterPointCloudDestination::typeName() || dataType == QgsProcessingParameterVectorTileDestination::typeName() || dataType == QgsProcessingParameterVectorDestination::typeName() || dataType == QgsProcessingParameterFeatureSource::typeName() ) { - return QColor( 180, 180, 0 ); + return QColor( 180, 180, 0 ); // kaki (greenish yellow) } else @@ -265,7 +265,7 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) ) { - return QColor( 0, 180, 180 ); + return QColor( 0, 180, 180 ); // turquoise } else @@ -274,7 +274,7 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) dataType == QgsProcessingParameterEnum::typeName() ) { - return QColor( 128, 68, 201 ); + return QColor( 128, 68, 201 ); // purple } else @@ -284,7 +284,7 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) ) { - return QColor( 100, 100, 255 ); + return QColor( 100, 100, 255 ); // slate blueish } else @@ -293,14 +293,14 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) dataType == QgsProcessingParameterFile::typeName() || dataType == QgsProcessingOutputFolder::typeName() || dataType == QgsProcessingOutputFile::typeName() || dataType == QgsProcessingParameterFolderDestination::typeName() || dataType == QgsProcessingParameterFeatureSink::typeName() || dataType == QgsProcessingParameterRasterDestination::typeName() || dataType == QgsProcessingParameterFileDestination::typeName() ) { - return QColor( 80, 80, 80 ); + return QColor( 80, 80, 80 ); // dark gray } else // Expression type if ( dataType == QgsProcessingParameterExpression::typeName() ) { - return QColor( 180, 80, 180 ); + return QColor( 180, 80, 180 ); // dark pink } else @@ -310,7 +310,7 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) ) { - return QColor( 128, 128, 0 ); + return QColor( 128, 128, 0 ); // Dark kaki } else @@ -329,7 +329,7 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) // QgsProcessingOutputVariant // QgsProcessingOutputConditionalBranch { - return QColor( 128, 128, 128 ); + return QColor( 128, 128, 128 ); // mid gray } } From 12c12642932ef9b7dcaa5d2c2e481176c8d36ce8 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Mon, 12 May 2025 15:15:49 +0200 Subject: [PATCH 04/42] testing with better line jumps 2 --- src/gui/processing/models/qgsmodelgraphicitem.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index 2244e31c589..36574327633 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -307,7 +307,6 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) // Other Layer types if ( dataType == QgsProcessingParameterMultipleLayers::typeName() || dataType == QgsProcessingParameterMapLayer::typeName() || dataType == QgsProcessingParameterAnnotationLayer::typeName() || dataType == QgsProcessingOutputMultipleLayers::typeName() - ) { return QColor( 128, 128, 0 ); // Dark kaki From 19e318fb1b5846b8fab38b41db43c50ecd23281c Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Mon, 12 May 2025 15:51:52 +0200 Subject: [PATCH 05/42] formatting --- .../qgsprocessingmodelchildparametersource.h | 5 - .../models/qgsmodelcomponentgraphicitem.cpp | 2 +- .../processing/models/qgsmodelgraphicitem.cpp | 163 +++++++----------- 3 files changed, 68 insertions(+), 102 deletions(-) diff --git a/src/core/processing/models/qgsprocessingmodelchildparametersource.h b/src/core/processing/models/qgsprocessingmodelchildparametersource.h index 24a050a8408..f4cbb128f5c 100644 --- a/src/core/processing/models/qgsprocessingmodelchildparametersource.h +++ b/src/core/processing/models/qgsprocessingmodelchildparametersource.h @@ -230,11 +230,6 @@ class CORE_EXPORT QgsProcessingModelChildParameterSource */ QString friendlyIdentifier( QgsProcessingModelAlgorithm *model ) const; - /** - * Returns the type of source - */ - Qgis::ProcessingModelChildParameterSource getSourceType() { return mSource; } - private: Qgis::ProcessingModelChildParameterSource mSource = Qgis::ProcessingModelChildParameterSource::StaticValue; diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 95d4f366095..82a6845cda1 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -1250,7 +1250,7 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind { QgsProcessingModelChildParameterSource firstParamSource = paramSources[0]; - switch ( firstParamSource.getSourceType() ) + switch ( firstParamSource.source() ) { case Qgis::ProcessingModelChildParameterSource::ChildOutput: paramValueAsStr = QStringLiteral( ": %1" ).arg( diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index 36574327633..3984f1aa57e 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -215,7 +215,7 @@ QColor QgsModelDesignerSocketGraphicItem::getColor() QString dataType; // Possibly, the mComponentItem is an instance of QgsModelParameterGraphicItem. In this case, - // it needs to be explicitely casted so that the relevant getLinkedParamDataType method is being called + // it needs to be explicitly casted so that the relevant getLinkedParamDataType method is being called if ( QgsModelParameterGraphicItem *paramItem = dynamic_cast( componentItem() ) ) { dataType = paramItem->getLinkedParamDataType( mEdge, mIndex ); @@ -234,102 +234,73 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) // Numerical types if ( dataType == QgsProcessingParameterMatrix::typeName() || dataType == QgsProcessingParameterNumber::typeName() || dataType == QgsProcessingParameterRange::typeName() || dataType == QgsProcessingParameterColor::typeName() || dataType == QgsProcessingOutputNumber::typeName() || dataType == QgsProcessingParameterDistance::typeName() || dataType == QgsProcessingParameterDuration::typeName() || dataType == QgsProcessingParameterScale::typeName() - ) - { return QColor( 34, 157, 214 ); // blue + + + // Boolean type + if ( + dataType == QgsProcessingParameterBoolean::typeName() || dataType == QgsProcessingOutputBoolean::typeName() + ) + return QColor( 51, 201, 28 ); // green + + // Vector types + if ( + dataType == QgsProcessingParameterPoint::typeName() || dataType == QgsProcessingParameterGeometry::typeName() || dataType == QgsProcessingParameterVectorLayer::typeName() || dataType == QgsProcessingParameterMeshLayer::typeName() || dataType == QgsProcessingParameterPointCloudLayer::typeName() || dataType == QgsProcessingOutputVectorLayer::typeName() || dataType == QgsProcessingOutputPointCloudLayer::typeName() || dataType == QgsProcessingParameterExtent::typeName() || dataType == QgsProcessingOutputVectorTileLayer::typeName() || dataType == QgsProcessingParameterPointCloudDestination::typeName() || dataType == QgsProcessingParameterVectorTileDestination::typeName() || dataType == QgsProcessingParameterVectorDestination::typeName() || dataType == QgsProcessingParameterFeatureSource::typeName() + ) + return QColor( 180, 180, 0 ); // kaki (greenish yellow) + + // Raster type + if ( + dataType == QgsProcessingParameterRasterLayer::typeName() || dataType == QgsProcessingOutputRasterLayer::typeName() + ) + return QColor( 0, 180, 180 ); // turquoise + + // enum + if ( + dataType == QgsProcessingParameterEnum::typeName() + ) + return QColor( 128, 68, 201 ); // purple + + // String and datetime types + if ( + dataType == QgsProcessingParameterString::typeName() || dataType == QgsProcessingParameterDateTime::typeName() || dataType == QgsProcessingParameterCrs::typeName() || dataType == QgsProcessingOutputHtml::typeName() || dataType == QgsProcessingOutputString::typeName() + ) + return QColor( 100, 100, 255 ); // slate blueish + + // filesystem types + if ( + dataType == QgsProcessingParameterFile::typeName() || dataType == QgsProcessingOutputFolder::typeName() || dataType == QgsProcessingOutputFile::typeName() || dataType == QgsProcessingParameterFolderDestination::typeName() || dataType == QgsProcessingParameterFeatureSink::typeName() || dataType == QgsProcessingParameterRasterDestination::typeName() || dataType == QgsProcessingParameterFileDestination::typeName() + ) + return QColor( 80, 80, 80 ); // dark gray + + // Expression type + if ( dataType == QgsProcessingParameterExpression::typeName() ) + return QColor( 180, 80, 180 ); // dark pink + + // Other Layer types + if ( + dataType == QgsProcessingParameterMultipleLayers::typeName() || dataType == QgsProcessingParameterMapLayer::typeName() || dataType == QgsProcessingParameterAnnotationLayer::typeName() || dataType == QgsProcessingOutputMultipleLayers::typeName() + ) + return QColor( 128, 128, 0 ); // Dark kaki + + // Default color, applies for: + // QgsProcessingParameterField + // QgsProcessingParameterMapTheme + // QgsProcessingParameterBand + // QgsProcessingParameterLayout + // QgsProcessingParameterLayoutItem + // QgsProcessingParameterCoordinateOperation + // QgsProcessingParameterAuthConfig // config + // QgsProcessingParameterDatabaseSchema + // QgsProcessingParameterDatabaseTable + // QgsProcessingParameterProviderConnection + // QgsProcessingParameterPointCloudAttribute + // QgsProcessingOutputVariant + // QgsProcessingOutputConditionalBranch + { + return QColor( 128, 128, 128 ); // mid gray } - else - - // Boolean type - if ( - dataType == QgsProcessingParameterBoolean::typeName() || dataType == QgsProcessingOutputBoolean::typeName() - ) - { - return QColor( 51, 201, 28 ); // green - } - else - - // Vector types - if ( - dataType == QgsProcessingParameterPoint::typeName() || dataType == QgsProcessingParameterGeometry::typeName() || dataType == QgsProcessingParameterVectorLayer::typeName() || dataType == QgsProcessingParameterMeshLayer::typeName() || dataType == QgsProcessingParameterPointCloudLayer::typeName() || dataType == QgsProcessingOutputVectorLayer::typeName() || dataType == QgsProcessingOutputPointCloudLayer::typeName() || dataType == QgsProcessingParameterExtent::typeName() || dataType == QgsProcessingOutputVectorTileLayer::typeName() || dataType == QgsProcessingParameterPointCloudDestination::typeName() || dataType == QgsProcessingParameterVectorTileDestination::typeName() || dataType == QgsProcessingParameterVectorDestination::typeName() || dataType == QgsProcessingParameterFeatureSource::typeName() - ) - { - return QColor( 180, 180, 0 ); // kaki (greenish yellow) - } - else - - // Raster type - if ( - dataType == QgsProcessingParameterRasterLayer::typeName() || dataType == QgsProcessingOutputRasterLayer::typeName() - - ) - { - return QColor( 0, 180, 180 ); // turquoise - } - else - - // enum - if ( - dataType == QgsProcessingParameterEnum::typeName() - ) - { - return QColor( 128, 68, 201 ); // purple - } - else - - // String and datetime types - if ( - dataType == QgsProcessingParameterString::typeName() || dataType == QgsProcessingParameterDateTime::typeName() || dataType == QgsProcessingParameterCrs::typeName() || dataType == QgsProcessingOutputHtml::typeName() || dataType == QgsProcessingOutputString::typeName() - - ) - { - return QColor( 100, 100, 255 ); // slate blueish - } - else - - // filesystem types - if ( - dataType == QgsProcessingParameterFile::typeName() || dataType == QgsProcessingOutputFolder::typeName() || dataType == QgsProcessingOutputFile::typeName() || dataType == QgsProcessingParameterFolderDestination::typeName() || dataType == QgsProcessingParameterFeatureSink::typeName() || dataType == QgsProcessingParameterRasterDestination::typeName() || dataType == QgsProcessingParameterFileDestination::typeName() - ) - { - return QColor( 80, 80, 80 ); // dark gray - } - else - - // Expression type - if ( dataType == QgsProcessingParameterExpression::typeName() ) - { - return QColor( 180, 80, 180 ); // dark pink - } - else - - // Other Layer types - if ( - dataType == QgsProcessingParameterMultipleLayers::typeName() || dataType == QgsProcessingParameterMapLayer::typeName() || dataType == QgsProcessingParameterAnnotationLayer::typeName() || dataType == QgsProcessingOutputMultipleLayers::typeName() - ) - { - return QColor( 128, 128, 0 ); // Dark kaki - } - else - - // Default color, applies for: - // QgsProcessingParameterField - // QgsProcessingParameterMapTheme - // QgsProcessingParameterBand - // QgsProcessingParameterLayout - // QgsProcessingParameterLayoutItem - // QgsProcessingParameterCoordinateOperation - // QgsProcessingParameterAuthConfig // config - // QgsProcessingParameterDatabaseSchema - // QgsProcessingParameterDatabaseTable - // QgsProcessingParameterProviderConnection - // QgsProcessingParameterPointCloudAttribute - // QgsProcessingOutputVariant - // QgsProcessingOutputConditionalBranch - { - return QColor( 128, 128, 128 ); // mid gray - } } @@ -374,7 +345,7 @@ bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() } // The default value can only happen in the case of the parameter uses a static value - if ( paramSources[0].getSourceType() != Qgis::ProcessingModelChildParameterSource::StaticValue ) + if ( paramSources[0].source() != Qgis::ProcessingModelChildParameterSource::StaticValue ) { isDefaultValue = false; break; @@ -384,7 +355,7 @@ bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() break; } - // Ouputs + // Outputs case Qt::BottomEdge: { break; From 2fe7c92204b8159195fb5c78b45475300053c69b Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Mon, 12 May 2025 16:47:56 +0200 Subject: [PATCH 06/42] now using virtual method for getting param data type --- .../auto_additions/qgsmodelcomponentgraphicitem.py | 4 ++-- .../models/qgsmodelcomponentgraphicitem.sip.in | 5 +++-- .../auto_additions/qgsmodelcomponentgraphicitem.py | 4 ++-- .../models/qgsmodelcomponentgraphicitem.sip.in | 5 +++-- src/gui/processing/models/qgsmodelarrowitem.cpp | 14 +------------- .../models/qgsmodelcomponentgraphicitem.cpp | 2 +- .../models/qgsmodelcomponentgraphicitem.h | 4 ++-- 7 files changed, 14 insertions(+), 24 deletions(-) diff --git a/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py b/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py index 9055186f952..9d267daba7d 100644 --- a/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py +++ b/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py @@ -16,7 +16,7 @@ QgsModelComponentGraphicItem.Flag.__and__ = lambda flag1, flag2: _force_int(flag QgsModelComponentGraphicItem.Flag.__or__ = lambda flag1, flag2: QgsModelComponentGraphicItem.Flag(_force_int(flag1) | _force_int(flag2)) try: QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"} - QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] + QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition'] QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint'] QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']} @@ -30,7 +30,7 @@ try: except (NameError, AttributeError): pass try: - QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] + QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'getLinkedParamDataType', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] QgsModelParameterGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): pass diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index d0ad7a3d7ec..1fe08199f3c 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -112,7 +112,7 @@ Shows a preview of moving the item from its stored position by ``dx``, Sets a new scene ``rect`` for the item. %End - QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); @@ -364,7 +364,8 @@ Ownership of ``parameter`` is transferred to the item. virtual bool canDeleteComponent(); - QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ); + protected: virtual QColor fillColor( State state ) const; diff --git a/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py b/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py index c6c7013495b..0a1e16ee20d 100644 --- a/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py +++ b/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py @@ -1,7 +1,7 @@ # The following has been generated automatically from src/gui/processing/models/qgsmodelcomponentgraphicitem.h try: QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"} - QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] + QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition'] QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint'] QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']} @@ -15,7 +15,7 @@ try: except (NameError, AttributeError): pass try: - QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] + QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'getLinkedParamDataType', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] QgsModelParameterGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): pass diff --git a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index 893c8baa8ae..f243eb816e8 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -112,7 +112,7 @@ Shows a preview of moving the item from its stored position by ``dx``, Sets a new scene ``rect`` for the item. %End - QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); @@ -364,7 +364,8 @@ Ownership of ``parameter`` is transferred to the item. virtual bool canDeleteComponent(); - QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ); + protected: virtual QColor fillColor( State state ) const; diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index ad1d52545b9..8c7c9727306 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -73,19 +73,7 @@ QgsModelArrowItem::QgsModelArrowItem( QgsModelComponentGraphicItem *startItem, M void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * ) { - QString dataType; - - // Possibly, the mComponentItem is an instance of QgsModelParameterGraphicItem. In this case, - // it needs to be explicitely casted so that the relevant getLinkedParamDataType method is being called - if ( QgsModelParameterGraphicItem *paramItem = dynamic_cast( mStartItem ) ) - { - dataType = paramItem->getLinkedParamDataType( mStartEdge, mStartIndex ); - } - else - { - dataType = mStartItem->getLinkedParamDataType( mStartEdge, mStartIndex ); - } - + QString dataType = mStartItem->getLinkedParamDataType( mStartEdge, mStartIndex ); QColor color = QgsModelDesignerSocketGraphicItem::typeToColorLookup( dataType ); if ( mStartItem->state() == QgsModelComponentGraphicItem::Selected || mEndItem->state() == QgsModelComponentGraphicItem::Selected ) diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 82a6845cda1..3cd59410ea5 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -888,7 +888,7 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const } -QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge edge, int index ) +QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) { QString unknownType = QString( "unknown" ); diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h index 32e900eaa24..f01e0e26a0b 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h @@ -137,7 +137,7 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject */ void setItemRect( QRectF rect ); - QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); #ifndef SIP_RUN @@ -429,7 +429,7 @@ class GUI_EXPORT QgsModelParameterGraphicItem : public QgsModelComponentGraphicI void contextMenuEvent( QGraphicsSceneContextMenuEvent *event ) override; bool canDeleteComponent() override; - QString getLinkedParamDataType( Qt::Edge edge, int index ); + QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) override; protected: QColor fillColor( State state ) const override; From 9b95398cdbeab49e8d4de2e937de4b57eef77c84 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Tue, 13 May 2025 14:12:30 +0200 Subject: [PATCH 07/42] simplified button positioning --- .../models/qgsmodelcomponentgraphicitem.cpp | 36 ++++++------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 3cd59410ea5..6b6d5bf6136 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -497,19 +497,16 @@ QPixmap QgsModelComponentGraphicItem::iconPixmap() const return QPixmap(); } + void QgsModelComponentGraphicItem::updateButtonPositions() { - bool isParameter = dynamic_cast( mComponent.get() ) != nullptr; mEditButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, itemSize().height() / 2.0 - mButtonSize.height() / 2.0 - BUTTON_MARGIN ) ); mDeleteButton->setPosition( QPointF( itemSize().width() / 2.0 - mButtonSize.width() / 2.0 - BUTTON_MARGIN, mButtonSize.height() / 2.0 - itemSize().height() / 2.0 + BUTTON_MARGIN ) ); - if ( isParameter ) + if ( mExpandBottomButton ) { - if ( mExpandBottomButton ) - { - const QPointF pt = linkPoint( Qt::BottomEdge, -1, false ); - mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) ); - } + const QPointF pt = linkPoint( Qt::BottomEdge, -1, false ); + mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) ); bool collapsed = mComponent->linksCollapsed( Qt::BottomEdge ); for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mOutSockets ) ) @@ -519,18 +516,12 @@ void QgsModelComponentGraphicItem::updateButtonPositions() socket->setVisible( !collapsed ); } } - else + + + if ( mExpandTopButton ) { - if ( mExpandTopButton ) - { - const QPointF pt = linkPoint( Qt::TopEdge, -1, true ); - mExpandTopButton->setPosition( QPointF( 0, pt.y() ) ); - } - if ( mExpandBottomButton ) - { - const QPointF pt = linkPoint( Qt::BottomEdge, -1, false ); - mExpandBottomButton->setPosition( QPointF( 0, pt.y() ) ); - } + const QPointF pt = linkPoint( Qt::TopEdge, -1, true ); + mExpandTopButton->setPosition( QPointF( 0, pt.y() ) ); bool collapsed = mComponent->linksCollapsed( Qt::TopEdge ); for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mInSockets ) ) @@ -539,17 +530,10 @@ void QgsModelComponentGraphicItem::updateButtonPositions() socket->setPosition( pt ); socket->setVisible( !collapsed ); } - - collapsed = mComponent->linksCollapsed( Qt::BottomEdge ); - for ( QgsModelDesignerSocketGraphicItem *socket : std::as_const( mOutSockets ) ) - { - const QPointF pt = linkPoint( Qt::BottomEdge, socket->index(), false ); - socket->setPosition( pt ); - socket->setVisible( !collapsed ); - } } } + QSizeF QgsModelComponentGraphicItem::itemSize() const { return !mTempSize.isValid() ? mComponent->size() : mTempSize; From 545e264c7072bd27d6dc2d8ee449edca62f973b3 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Tue, 13 May 2025 14:14:30 +0200 Subject: [PATCH 08/42] removed var used only once --- src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 6b6d5bf6136..d2b4b84488b 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -572,8 +572,7 @@ void QgsModelComponentGraphicItem::fold( Qt::Edge edge, bool folded ) } else if ( QgsProcessingModelParameter *param = dynamic_cast( mComponent.get() ) ) { - QString paramName = param->parameterName(); - QgsProcessingModelParameter paramComp = mModel->parameterComponent( paramName ); + QgsProcessingModelParameter paramComp = mModel->parameterComponent( param->parameterName() ); paramComp.setLinksCollapsed( edge, folded ); } else if ( QgsProcessingModelOutput *output = dynamic_cast( mComponent.get() ) ) From 9bacaee3c6ee792144c3df7299659881b455e8c1 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Tue, 13 May 2025 14:26:16 +0200 Subject: [PATCH 09/42] return empty string to signal error --- .../models/qgsmodelcomponentgraphicitem.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index d2b4b84488b..0e68f3fc81a 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -873,11 +873,9 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) { - QString unknownType = QString( "unknown" ); - if ( index < 0 ) { - return unknownType; + return QString(); } if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) ) @@ -885,7 +883,7 @@ QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge /* unused return this->model()->parameterDefinition( parameter->parameterName() )->type(); } - return unknownType; + return QString(); } @@ -1130,13 +1128,11 @@ int QgsModelChildAlgorithmGraphicItem::linkPointCount( Qt::Edge edge ) const QString QgsModelComponentGraphicItem::getLinkedParamDataType( Qt::Edge edge, int index ) { - QString unknownType = QString( "unknown" ); - if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast( component() ) ) { if ( !child->algorithm() ) { - return unknownType; + return QString(); } switch ( edge ) @@ -1147,7 +1143,7 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType( Qt::Edge edge, int { return child->algorithm()->outputDefinitions().at( index )->type(); } - return unknownType; + return QString(); } case Qt::TopEdge: { @@ -1158,7 +1154,7 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType( Qt::Edge edge, int return params.at( index )->type(); } - return unknownType; + return QString(); } case Qt::LeftEdge: @@ -1167,7 +1163,7 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType( Qt::Edge edge, int } } - return unknownType; + return QString(); } From c4b0d73b7d4eaecc19733a5d8d39c286635fd621 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Tue, 13 May 2025 14:33:51 +0200 Subject: [PATCH 10/42] removed unnecessary else returns --- .../qgsprocessingmodelchildparametersource.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp b/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp index 6b24b5c32ff..e6c962ad4a0 100644 --- a/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp +++ b/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp @@ -225,19 +225,19 @@ QString QgsProcessingModelChildParameterSource::friendlyIdentifier( QgsProcessin { case Qgis::ProcessingModelChildParameterSource::ModelParameter: { - if (model) { - const QgsProcessingParameterDefinition* paramDefinition = model->parameterDefinition( mParameterName ); + + if ( model ) + { + const QgsProcessingParameterDefinition *paramDefinition = model->parameterDefinition( mParameterName ); // A model can be valid (non null) but we could be looking for a null parameter (if input if not set yet) - if (paramDefinition == nullptr) { - return mParameterName; - } else { + if ( paramDefinition ) + { return model->parameterDefinition( mParameterName )->description(); } - - } else { - return mParameterName; } + + return mParameterName; } case Qgis::ProcessingModelChildParameterSource::ChildOutput: { From f36e86ff5da58aecd2c4e5984faaf24f672bc760 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Tue, 13 May 2025 18:01:20 +0200 Subject: [PATCH 11/42] refectored param color logic --- .../auto_additions/qgsprocessingoutputs.py | 72 ++++---- .../auto_additions/qgsprocessingparameters.py | 66 +++---- .../processing/qgsprocessingoutputs.sip.in | 63 ++++++- .../processing/qgsprocessingparameters.sip.in | 139 ++++++++++++++ .../qgsmodelcomponentgraphicitem.py | 4 +- .../gui/auto_additions/qgsmodelgraphicitem.py | 1 - .../qgsmodelcomponentgraphicitem.sip.in | 10 + .../models/qgsmodelgraphicitem.sip.in | 2 - .../auto_additions/qgsprocessingoutputs.py | 72 ++++---- .../auto_additions/qgsprocessingparameters.py | 66 +++---- .../processing/qgsprocessingoutputs.sip.in | 63 ++++++- .../processing/qgsprocessingparameters.sip.in | 139 ++++++++++++++ .../qgsmodelcomponentgraphicitem.py | 4 +- .../gui/auto_additions/qgsmodelgraphicitem.py | 1 - .../qgsmodelcomponentgraphicitem.sip.in | 10 + .../models/qgsmodelgraphicitem.sip.in | 2 - src/core/processing/qgsprocessingoutputs.h | 60 ++++++ src/core/processing/qgsprocessingparameters.h | 172 ++++++++++++++++++ .../processing/models/qgsmodelarrowitem.cpp | 3 +- .../models/qgsmodelcomponentgraphicitem.cpp | 56 ++++++ .../models/qgsmodelcomponentgraphicitem.h | 10 + .../processing/models/qgsmodelgraphicitem.cpp | 85 +-------- .../processing/models/qgsmodelgraphicitem.h | 2 - 23 files changed, 851 insertions(+), 251 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py index e566beaccfb..8e1fdc5e8af 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py @@ -7,84 +7,84 @@ 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__ = ['type', 'getColor'] QgsProcessingOutputRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputPointCloudLayer.typeName = staticmethod(QgsProcessingOutputPointCloudLayer.typeName) - QgsProcessingOutputPointCloudLayer.__overridden_methods__ = ['type'] - QgsProcessingOutputPointCloudLayer.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.__overridden_methods__ = ['type'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName) - QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString'] - QgsProcessingOutputMultipleLayers.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName) - QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString'] - QgsProcessingOutputHtml.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputVariant.typeName) - QgsProcessingOutputVariant.__overridden_methods__ = ['type', 'valueAsString'] - QgsProcessingOutputVariant.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName) - QgsProcessingOutputNumber.__overridden_methods__ = ['type', 'valueAsString'] - QgsProcessingOutputNumber.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName) - QgsProcessingOutputString.__overridden_methods__ = ['type'] - QgsProcessingOutputString.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.__overridden_methods__ = ['type', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName) - QgsProcessingOutputBoolean.__overridden_methods__ = ['type', 'valueAsString'] - QgsProcessingOutputBoolean.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName) - QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString'] - QgsProcessingOutputFolder.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName) - QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString'] - QgsProcessingOutputFile.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputConditionalBranch.typeName = staticmethod(QgsProcessingOutputConditionalBranch.typeName) - QgsProcessingOutputConditionalBranch.__overridden_methods__ = ['type'] - QgsProcessingOutputConditionalBranch.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.__overridden_methods__ = ['type'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName) - QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type'] - QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputDefinition.__virtual_methods__ = ['valueAsString', 'valueAsFormattedString'] + QgsProcessingOutputDefinition.__virtual_methods__ = ['getColor', 'valueAsString', 'valueAsFormattedString'] QgsProcessingOutputDefinition.__abstract_methods__ = ['type'] QgsProcessingOutputDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py index b4f166c7639..68e9bbbe92d 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['getColor', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,12 +378,12 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingParameterDefinition.__virtual_methods__ = ['isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] + QgsProcessingParameterDefinition.__virtual_methods__ = ['getColor', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type'] QgsProcessingParameterDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 253600f1bfb..e5ab43b2967 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -65,6 +65,10 @@ Constructor for QgsProcessingOutputDefinition. virtual ~QgsProcessingOutputDefinition(); + virtual QColor getColor() const; +%Docstring +A fallback color to represent a processing output +%End virtual QString type() const = 0; %Docstring Unique output type name. @@ -215,6 +219,10 @@ 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 Returns the type name for the output class. @@ -258,7 +266,11 @@ Constructor for QgsProcessingOutputRasterLayer. 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 class QgsProcessingOutputPointCloudLayer : QgsProcessingOutputDefinition { @@ -294,7 +306,7 @@ when the number and nature of the output layers is not predefined. .. note:: Always prefer to explicitly define :py:class:`QgsProcessingOutputVectorLayer`, - :py:class:`QgsProcessingOutputRasterLayer` or :py:class:`QgsProcessingOutputMapLayer` where possible. :py:class:`QgsProcessingOutputMultipleLayers` + QgsProcessingOutputRasterLayer or QgsProcessingOutputMapLayer where possible. :py:class:`QgsProcessingOutputMultipleLayers` should only ever be used when the number of output layers is not fixed - e.g. as a result of processing all layers in a specified folder. @@ -319,7 +331,10 @@ Returns the type name for the output class. 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 class QgsProcessingOutputHtml : QgsProcessingOutputDefinition { @@ -344,7 +359,11 @@ Returns the type name for the output class. 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 class QgsProcessingOutputVariant : QgsProcessingOutputDefinition @@ -369,6 +388,11 @@ Constructor for QgsProcessingOutputVariant. static QString typeName(); %Docstring Returns the type name for the output class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a range parameter %End virtual QString type() const; @@ -393,6 +417,10 @@ 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 Returns the type name for the output class. @@ -424,7 +452,11 @@ Constructor for QgsProcessingOutputString. 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 class QgsProcessingOutputBoolean : QgsProcessingOutputDefinition { @@ -442,6 +474,11 @@ A boolean output for processing algorithms. QgsProcessingOutputBoolean( const QString &name, const QString &description = QString() ); %Docstring Constructor for :py:class:`QgsProcessingOutputNumber`. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a boolean output %End static QString typeName(); @@ -478,7 +515,10 @@ Returns the type name for the output class. 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 class QgsProcessingOutputFile : QgsProcessingOutputDefinition { @@ -504,7 +544,10 @@ Returns the type name for the output class. 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 class QgsProcessingOutputConditionalBranch : QgsProcessingOutputDefinition { @@ -555,7 +598,11 @@ Constructor for QgsProcessingOutputVectorTileLayer. 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 /************************************************************************ * This file has been generated automatically from * diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index c7d1d923e20..329333cca9a 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -364,6 +364,11 @@ Constructor for QgsProcessingParameterDefinition. virtual ~QgsProcessingParameterDefinition(); + virtual QColor getColor() const; +%Docstring +A color to represent the default parameter +%End + virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/; %Docstring Creates a clone of the parameter definition. @@ -1885,6 +1890,10 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End + virtual QColor getColor() const; +%Docstring +A color to represent a boolean parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1920,6 +1929,10 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End + virtual QColor getColor() const; +%Docstring +A color to represent a crs parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1960,6 +1973,10 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End + virtual QColor getColor() const; +%Docstring +A color to represent an extent parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1999,6 +2016,11 @@ A point parameter for processing algorithms. bool optional = false ); %Docstring Constructor for QgsProcessingParameterPoint. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a point parameter %End static QString typeName(); @@ -2043,6 +2065,10 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End + virtual QColor getColor() const; +%Docstring +A color to represent a geometry parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2125,6 +2151,10 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End + virtual QColor getColor() const; +%Docstring +A color to represent a file parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2241,6 +2271,11 @@ Constructor for QgsProcessingParameterMatrix. static QString typeName(); %Docstring Returns the type name for the parameter class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a mtrix parameter %End virtual QgsProcessingParameterDefinition *clone() const /Factory/; @@ -2336,6 +2371,10 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End + virtual QColor getColor() const; +%Docstring +A color to represent a multiple layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2437,6 +2476,11 @@ Constructor for QgsProcessingParameterNumber. static QString typeName(); %Docstring Returns the type name for the parameter class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a number parameter %End virtual QgsProcessingParameterDefinition *clone() const /Factory/; @@ -2546,6 +2590,10 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End + virtual QColor getColor() const; +%Docstring +A color to represent a color parameter +%End virtual QgsProcessingParameterDistance *clone() const /Factory/; @@ -2807,6 +2855,10 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End + virtual QColor getColor() const; +%Docstring +A color to represent a duration parameter +%End virtual QgsProcessingParameterDuration *clone() const /Factory/; @@ -2865,6 +2917,10 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End + virtual QColor getColor() const; +%Docstring +A color to represent a scale parameter +%End virtual QgsProcessingParameterScale *clone() const /Factory/; @@ -2902,6 +2958,11 @@ Constructor for QgsProcessingParameterRange. static QString typeName(); %Docstring Returns the type name for the parameter class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a range parameter %End virtual QgsProcessingParameterDefinition *clone() const /Factory/; @@ -2956,6 +3017,10 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent a raster layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3014,6 +3079,10 @@ values. Constructor for QgsProcessingParameterEnum. %End + virtual QColor getColor() const; +%Docstring +A color to represent an enum parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3132,6 +3201,10 @@ accordingly.) Constructor for QgsProcessingParameterString. %End + virtual QColor getColor() const; +%Docstring +A color to represent a string parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3235,6 +3308,10 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End + virtual QColor getColor() const; +%Docstring +A color to represent an expression parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3354,6 +3431,11 @@ Consider using the more versatile bool optional = false ); %Docstring Constructor for QgsProcessingParameterVectorLayer. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a vector layer parameter %End static QString typeName(); @@ -3409,6 +3491,10 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent a mesh layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3451,6 +3537,10 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent a map layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3631,6 +3721,10 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End + virtual QColor getColor() const; +%Docstring +A color to represent a feature source parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3807,6 +3901,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a feature sink parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3928,6 +4026,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a vector destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4017,6 +4119,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a raster destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4090,6 +4196,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a file destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4160,6 +4270,10 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End + virtual QColor getColor() const; +%Docstring +A color to represent a folder destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4430,6 +4544,11 @@ varying color opacity. static QString typeName(); %Docstring Returns the type name for the parameter class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a color parameter %End virtual QgsProcessingParameterDefinition *clone() const /Factory/; @@ -4687,6 +4806,10 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End + virtual QColor getColor() const; +%Docstring +A color to represent a datetime parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5066,6 +5189,10 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent a point cloud layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5110,6 +5237,10 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent an annotation layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5157,6 +5288,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a point cloud destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5322,6 +5457,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a vector tile destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py b/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py index 9d267daba7d..a6401c380ba 100644 --- a/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py +++ b/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py @@ -16,7 +16,7 @@ QgsModelComponentGraphicItem.Flag.__and__ = lambda flag1, flag2: _force_int(flag QgsModelComponentGraphicItem.Flag.__or__ = lambda flag1, flag2: QgsModelComponentGraphicItem.Flag(_force_int(flag1) | _force_int(flag2)) try: QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"} - QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] + QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'getLinkColor', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition'] QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint'] QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']} @@ -30,7 +30,7 @@ try: except (NameError, AttributeError): pass try: - QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'getLinkedParamDataType', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] + QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'getLinkedParamDataType', 'getLinkColor', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] QgsModelParameterGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): pass diff --git a/python/PyQt6/gui/auto_additions/qgsmodelgraphicitem.py b/python/PyQt6/gui/auto_additions/qgsmodelgraphicitem.py index 650e353643f..b23d278f8f3 100644 --- a/python/PyQt6/gui/auto_additions/qgsmodelgraphicitem.py +++ b/python/PyQt6/gui/auto_additions/qgsmodelgraphicitem.py @@ -13,7 +13,6 @@ try: except (NameError, AttributeError): pass try: - QgsModelDesignerSocketGraphicItem.typeToColorLookup = staticmethod(QgsModelDesignerSocketGraphicItem.typeToColorLookup) QgsModelDesignerSocketGraphicItem.__overridden_methods__ = ['paint'] QgsModelDesignerSocketGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index 1fe08199f3c..2ad5a00fb89 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -114,6 +114,8 @@ Sets a new scene ``rect`` for the item. virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QColor getLinkColor( Qt::Edge edge, int index ); + virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event ); @@ -326,6 +328,11 @@ comment Updates the item's button positions, based on the current item rect. %End + QColor fallbackColor() const; +%Docstring +Get the fallback color if parameter or output do not have a specific +color +%End }; QFlags operator|(QgsModelComponentGraphicItem::Flag f1, QFlags f2); @@ -367,6 +374,9 @@ Ownership of ``parameter`` is transferred to the item. virtual QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ); + virtual QColor getLinkColor( Qt::Edge edge, int index ); + + protected: virtual QColor fillColor( State state ) const; diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in index 66f8d637fb0..4606554205b 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in @@ -140,8 +140,6 @@ A socket allowing linking component together. #include "qgsmodelgraphicitem.h" %End public: - static QColor typeToColorLookup( QString dataType ); - QgsModelDesignerSocketGraphicItem( QgsModelComponentGraphicItem *parent /TransferThis/, QgsProcessingModelComponent *component, int index, const QPointF &position, Qt::Edge edge, const QSizeF &size = QSizeF( 11, 11 ) ); %Docstring Constructor for QgsModelDesignerSocketGraphicItem, with the specified diff --git a/python/core/auto_additions/qgsprocessingoutputs.py b/python/core/auto_additions/qgsprocessingoutputs.py index e566beaccfb..8e1fdc5e8af 100644 --- a/python/core/auto_additions/qgsprocessingoutputs.py +++ b/python/core/auto_additions/qgsprocessingoutputs.py @@ -7,84 +7,84 @@ 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__ = ['type', 'getColor'] QgsProcessingOutputRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputPointCloudLayer.typeName = staticmethod(QgsProcessingOutputPointCloudLayer.typeName) - QgsProcessingOutputPointCloudLayer.__overridden_methods__ = ['type'] - QgsProcessingOutputPointCloudLayer.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.__overridden_methods__ = ['type'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName) - QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString'] - QgsProcessingOutputMultipleLayers.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName) - QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString'] - QgsProcessingOutputHtml.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputVariant.typeName) - QgsProcessingOutputVariant.__overridden_methods__ = ['type', 'valueAsString'] - QgsProcessingOutputVariant.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName) - QgsProcessingOutputNumber.__overridden_methods__ = ['type', 'valueAsString'] - QgsProcessingOutputNumber.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName) - QgsProcessingOutputString.__overridden_methods__ = ['type'] - QgsProcessingOutputString.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.__overridden_methods__ = ['type', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName) - QgsProcessingOutputBoolean.__overridden_methods__ = ['type', 'valueAsString'] - QgsProcessingOutputBoolean.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName) - QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString'] - QgsProcessingOutputFolder.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName) - QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString'] - QgsProcessingOutputFile.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputConditionalBranch.typeName = staticmethod(QgsProcessingOutputConditionalBranch.typeName) - QgsProcessingOutputConditionalBranch.__overridden_methods__ = ['type'] - QgsProcessingOutputConditionalBranch.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.__overridden_methods__ = ['type'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName) - QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type'] - QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.typeName) + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type', 'getColor'] + QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputDefinition.__virtual_methods__ = ['valueAsString', 'valueAsFormattedString'] + QgsProcessingOutputDefinition.__virtual_methods__ = ['getColor', 'valueAsString', 'valueAsFormattedString'] QgsProcessingOutputDefinition.__abstract_methods__ = ['type'] QgsProcessingOutputDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/core/auto_additions/qgsprocessingparameters.py b/python/core/auto_additions/qgsprocessingparameters.py index b4f166c7639..68e9bbbe92d 100644 --- a/python/core/auto_additions/qgsprocessingparameters.py +++ b/python/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['getColor', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,12 +378,12 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingParameterDefinition.__virtual_methods__ = ['isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] + QgsProcessingParameterDefinition.__virtual_methods__ = ['getColor', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type'] QgsProcessingParameterDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 253600f1bfb..e5ab43b2967 100644 --- a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -65,6 +65,10 @@ Constructor for QgsProcessingOutputDefinition. virtual ~QgsProcessingOutputDefinition(); + virtual QColor getColor() const; +%Docstring +A fallback color to represent a processing output +%End virtual QString type() const = 0; %Docstring Unique output type name. @@ -215,6 +219,10 @@ 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 Returns the type name for the output class. @@ -258,7 +266,11 @@ Constructor for QgsProcessingOutputRasterLayer. 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 class QgsProcessingOutputPointCloudLayer : QgsProcessingOutputDefinition { @@ -294,7 +306,7 @@ when the number and nature of the output layers is not predefined. .. note:: Always prefer to explicitly define :py:class:`QgsProcessingOutputVectorLayer`, - :py:class:`QgsProcessingOutputRasterLayer` or :py:class:`QgsProcessingOutputMapLayer` where possible. :py:class:`QgsProcessingOutputMultipleLayers` + QgsProcessingOutputRasterLayer or QgsProcessingOutputMapLayer where possible. :py:class:`QgsProcessingOutputMultipleLayers` should only ever be used when the number of output layers is not fixed - e.g. as a result of processing all layers in a specified folder. @@ -319,7 +331,10 @@ Returns the type name for the output class. 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 class QgsProcessingOutputHtml : QgsProcessingOutputDefinition { @@ -344,7 +359,11 @@ Returns the type name for the output class. 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 class QgsProcessingOutputVariant : QgsProcessingOutputDefinition @@ -369,6 +388,11 @@ Constructor for QgsProcessingOutputVariant. static QString typeName(); %Docstring Returns the type name for the output class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a range parameter %End virtual QString type() const; @@ -393,6 +417,10 @@ 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 Returns the type name for the output class. @@ -424,7 +452,11 @@ Constructor for QgsProcessingOutputString. 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 class QgsProcessingOutputBoolean : QgsProcessingOutputDefinition { @@ -442,6 +474,11 @@ A boolean output for processing algorithms. QgsProcessingOutputBoolean( const QString &name, const QString &description = QString() ); %Docstring Constructor for :py:class:`QgsProcessingOutputNumber`. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a boolean output %End static QString typeName(); @@ -478,7 +515,10 @@ Returns the type name for the output class. 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 class QgsProcessingOutputFile : QgsProcessingOutputDefinition { @@ -504,7 +544,10 @@ Returns the type name for the output class. 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 class QgsProcessingOutputConditionalBranch : QgsProcessingOutputDefinition { @@ -555,7 +598,11 @@ Constructor for QgsProcessingOutputVectorTileLayer. 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 /************************************************************************ * This file has been generated automatically from * diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index fe5e1033276..19ad62daf01 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -364,6 +364,11 @@ Constructor for QgsProcessingParameterDefinition. virtual ~QgsProcessingParameterDefinition(); + virtual QColor getColor() const; +%Docstring +A color to represent the default parameter +%End + virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/; %Docstring Creates a clone of the parameter definition. @@ -1885,6 +1890,10 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End + virtual QColor getColor() const; +%Docstring +A color to represent a boolean parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1920,6 +1929,10 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End + virtual QColor getColor() const; +%Docstring +A color to represent a crs parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1960,6 +1973,10 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End + virtual QColor getColor() const; +%Docstring +A color to represent an extent parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1999,6 +2016,11 @@ A point parameter for processing algorithms. bool optional = false ); %Docstring Constructor for QgsProcessingParameterPoint. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a point parameter %End static QString typeName(); @@ -2043,6 +2065,10 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End + virtual QColor getColor() const; +%Docstring +A color to represent a geometry parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2125,6 +2151,10 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End + virtual QColor getColor() const; +%Docstring +A color to represent a file parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2241,6 +2271,11 @@ Constructor for QgsProcessingParameterMatrix. static QString typeName(); %Docstring Returns the type name for the parameter class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a mtrix parameter %End virtual QgsProcessingParameterDefinition *clone() const /Factory/; @@ -2336,6 +2371,10 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End + virtual QColor getColor() const; +%Docstring +A color to represent a multiple layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2437,6 +2476,11 @@ Constructor for QgsProcessingParameterNumber. static QString typeName(); %Docstring Returns the type name for the parameter class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a number parameter %End virtual QgsProcessingParameterDefinition *clone() const /Factory/; @@ -2546,6 +2590,10 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End + virtual QColor getColor() const; +%Docstring +A color to represent a color parameter +%End virtual QgsProcessingParameterDistance *clone() const /Factory/; @@ -2807,6 +2855,10 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End + virtual QColor getColor() const; +%Docstring +A color to represent a duration parameter +%End virtual QgsProcessingParameterDuration *clone() const /Factory/; @@ -2865,6 +2917,10 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End + virtual QColor getColor() const; +%Docstring +A color to represent a scale parameter +%End virtual QgsProcessingParameterScale *clone() const /Factory/; @@ -2902,6 +2958,11 @@ Constructor for QgsProcessingParameterRange. static QString typeName(); %Docstring Returns the type name for the parameter class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a range parameter %End virtual QgsProcessingParameterDefinition *clone() const /Factory/; @@ -2956,6 +3017,10 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent a raster layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3014,6 +3079,10 @@ values. Constructor for QgsProcessingParameterEnum. %End + virtual QColor getColor() const; +%Docstring +A color to represent an enum parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3132,6 +3201,10 @@ accordingly.) Constructor for QgsProcessingParameterString. %End + virtual QColor getColor() const; +%Docstring +A color to represent a string parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3235,6 +3308,10 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End + virtual QColor getColor() const; +%Docstring +A color to represent an expression parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3354,6 +3431,11 @@ Consider using the more versatile bool optional = false ); %Docstring Constructor for QgsProcessingParameterVectorLayer. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a vector layer parameter %End static QString typeName(); @@ -3409,6 +3491,10 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent a mesh layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3451,6 +3537,10 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent a map layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3631,6 +3721,10 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End + virtual QColor getColor() const; +%Docstring +A color to represent a feature source parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3807,6 +3901,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a feature sink parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3928,6 +4026,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a vector destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4017,6 +4119,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a raster destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4090,6 +4196,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a file destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4160,6 +4270,10 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End + virtual QColor getColor() const; +%Docstring +A color to represent a folder destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4430,6 +4544,11 @@ varying color opacity. static QString typeName(); %Docstring Returns the type name for the parameter class. +%End + + virtual QColor getColor() const; +%Docstring +A color to represent a color parameter %End virtual QgsProcessingParameterDefinition *clone() const /Factory/; @@ -4687,6 +4806,10 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End + virtual QColor getColor() const; +%Docstring +A color to represent a datetime parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5066,6 +5189,10 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent a point cloud layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5110,6 +5237,10 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End + virtual QColor getColor() const; +%Docstring +A color to represent an annotation layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5157,6 +5288,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a point cloud destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5322,6 +5457,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End + virtual QColor getColor() const; +%Docstring +A color to represent a vector tile destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py b/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py index 0a1e16ee20d..1e7a3ef58e0 100644 --- a/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py +++ b/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py @@ -1,7 +1,7 @@ # The following has been generated automatically from src/gui/processing/models/qgsmodelcomponentgraphicitem.h try: QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"} - QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] + QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'getLinkColor', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition'] QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint'] QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']} @@ -15,7 +15,7 @@ try: except (NameError, AttributeError): pass try: - QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'getLinkedParamDataType', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] + QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'getLinkedParamDataType', 'getLinkColor', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] QgsModelParameterGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): pass diff --git a/python/gui/auto_additions/qgsmodelgraphicitem.py b/python/gui/auto_additions/qgsmodelgraphicitem.py index 650e353643f..b23d278f8f3 100644 --- a/python/gui/auto_additions/qgsmodelgraphicitem.py +++ b/python/gui/auto_additions/qgsmodelgraphicitem.py @@ -13,7 +13,6 @@ try: except (NameError, AttributeError): pass try: - QgsModelDesignerSocketGraphicItem.typeToColorLookup = staticmethod(QgsModelDesignerSocketGraphicItem.typeToColorLookup) QgsModelDesignerSocketGraphicItem.__overridden_methods__ = ['paint'] QgsModelDesignerSocketGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): diff --git a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index f243eb816e8..fe83de5974a 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -114,6 +114,8 @@ Sets a new scene ``rect`` for the item. virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QColor getLinkColor( Qt::Edge edge, int index ); + virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event ); @@ -326,6 +328,11 @@ comment Updates the item's button positions, based on the current item rect. %End + QColor fallbackColor() const; +%Docstring +Get the fallback color if parameter or output do not have a specific +color +%End }; QFlags operator|(QgsModelComponentGraphicItem::Flag f1, QFlags f2); @@ -367,6 +374,9 @@ Ownership of ``parameter`` is transferred to the item. virtual QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ); + virtual QColor getLinkColor( Qt::Edge edge, int index ); + + protected: virtual QColor fillColor( State state ) const; diff --git a/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in index 66f8d637fb0..4606554205b 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in @@ -140,8 +140,6 @@ A socket allowing linking component together. #include "qgsmodelgraphicitem.h" %End public: - static QColor typeToColorLookup( QString dataType ); - QgsModelDesignerSocketGraphicItem( QgsModelComponentGraphicItem *parent /TransferThis/, QgsProcessingModelComponent *component, int index, const QPointF &position, Qt::Edge edge, const QSizeF &size = QSizeF( 11, 11 ) ); %Docstring Constructor for QgsModelDesignerSocketGraphicItem, with the specified diff --git a/src/core/processing/qgsprocessingoutputs.h b/src/core/processing/qgsprocessingoutputs.h index 44cd0d5744e..3e6e418c384 100644 --- a/src/core/processing/qgsprocessingoutputs.h +++ b/src/core/processing/qgsprocessingoutputs.h @@ -18,6 +18,7 @@ #ifndef QGSPROCESSINGOUTPUTS_H #define QGSPROCESSINGOUTPUTS_H +#include #include "qgis_core.h" #include "qgis.h" @@ -85,6 +86,11 @@ class CORE_EXPORT QgsProcessingOutputDefinition virtual ~QgsProcessingOutputDefinition() = default; + /** + * A fallback color to represent a processing output + */ + virtual QColor getColor() const { return QColor( 128, 128, 128 ); /* mid gray */ }; + /** * Unique output type name. */ @@ -218,6 +224,11 @@ class CORE_EXPORT QgsProcessingOutputVectorLayer : public QgsProcessingOutputDef */ QgsProcessingOutputVectorLayer( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry ); + /** + * A color to represent a vector layer ouput + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the output class. */ @@ -260,6 +271,11 @@ class CORE_EXPORT QgsProcessingOutputRasterLayer : public QgsProcessingOutputDef */ static QString typeName() { return QStringLiteral( "outputRaster" ); } QString type() const override { return typeName(); } + + /** + * A color to represent a raster layer output + */ + virtual QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; }; /** @@ -312,6 +328,10 @@ class CORE_EXPORT QgsProcessingOutputMultipleLayers : public QgsProcessingOutput 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 + */ + virtual QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; }; /** @@ -334,6 +354,11 @@ 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 + */ + virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; }; @@ -356,6 +381,12 @@ class CORE_EXPORT QgsProcessingOutputVariant : public QgsProcessingOutputDefinit * Returns the type name for the output class. */ static QString typeName() { return QStringLiteral( "outputVariant" ); } + + /** + * A color to represent a range parameter + */ + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QString type() const override; QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override; @@ -375,6 +406,11 @@ class CORE_EXPORT QgsProcessingOutputNumber : public QgsProcessingOutputDefiniti */ QgsProcessingOutputNumber( const QString &name, const QString &description = QString() ); + /** + * A color to represent a number output + */ + virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + /** * Returns the type name for the output class. */ @@ -403,6 +439,11 @@ class CORE_EXPORT QgsProcessingOutputString : public QgsProcessingOutputDefiniti */ static QString typeName() { return QStringLiteral( "outputString" ); } QString type() const override { return typeName(); } + + /** + * A color to represent a string output + */ + virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; }; /** @@ -420,6 +461,12 @@ class CORE_EXPORT QgsProcessingOutputBoolean : public QgsProcessingOutputDefinit */ QgsProcessingOutputBoolean( const QString &name, const QString &description = QString() ); + /** + * A color to represent a boolean output + */ + virtual QColor getColor() const override { return QColor( 51, 201, 28 ); /* green */ }; + + /** * Returns the type name for the output class. */ @@ -450,6 +497,10 @@ class CORE_EXPORT QgsProcessingOutputFolder : public QgsProcessingOutputDefiniti 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 + */ + virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; /** @@ -473,6 +524,10 @@ class CORE_EXPORT QgsProcessingOutputFile : public QgsProcessingOutputDefinition 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 + */ + virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; /** @@ -518,6 +573,11 @@ class CORE_EXPORT QgsProcessingOutputVectorTileLayer : public QgsProcessingOutpu */ static QString typeName() { return QStringLiteral( "outputVectorTile" ); } QString type() const override { return typeName(); } + + /** + * A color to represent a vector tile layer output + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; }; #endif // QGSPROCESSINGOUTPUTS_H diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index 12534d824ce..b3682d21238 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -28,6 +28,7 @@ #include "qgsremappingproxyfeaturesink.h" #include #include +#include class QgsProcessingContext; class QgsProcessingAlgorithm; @@ -460,6 +461,11 @@ class CORE_EXPORT QgsProcessingParameterDefinition virtual ~QgsProcessingParameterDefinition() = default; + /** + * A color to represent the default parameter + */ + virtual QColor getColor() const { return QColor( 128, 128, 128 ); /* mid gray */ } + /** * Creates a clone of the parameter definition. */ @@ -1782,6 +1788,11 @@ class CORE_EXPORT QgsProcessingParameterBoolean : public QgsProcessingParameterD QgsProcessingParameterBoolean( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a boolean parameter + */ + virtual QColor getColor() const override { return QColor( 51, 201, 28 ); /* green */ }; + /** * Returns the type name for the parameter class. */ @@ -1812,6 +1823,11 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a crs parameter + */ + virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + /** * Returns the type name for the parameter class. */ @@ -1845,6 +1861,11 @@ class CORE_EXPORT QgsProcessingParameterExtent : public QgsProcessingParameterDe QgsProcessingParameterExtent( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent an extent parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the parameter class. */ @@ -1888,6 +1909,12 @@ class CORE_EXPORT QgsProcessingParameterPoint : public QgsProcessingParameterDef QgsProcessingParameterPoint( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a point parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + + /** * Returns the type name for the parameter class. */ @@ -1923,6 +1950,11 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter */ QgsProcessingParameterGeometry( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false, const QList< int > &geometryTypes = QList< int >(), bool allowMultipart = true ); + /** + * A color to represent a geometry parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the parameter class. */ @@ -1993,6 +2025,11 @@ class CORE_EXPORT QgsProcessingParameterFile : public QgsProcessingParameterDefi QgsProcessingParameterFile( const QString &name, const QString &description = QString(), Qgis::ProcessingFileParameterBehavior behavior = Qgis::ProcessingFileParameterBehavior::File, const QString &extension = QString(), const QVariant &defaultValue = QVariant(), bool optional = false, const QString &fileFilter = QString() ); + /** + * A color to represent a file parameter + */ + virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + /** * Returns the type name for the parameter class. */ @@ -2091,6 +2128,12 @@ class CORE_EXPORT QgsProcessingParameterMatrix : public QgsProcessingParameterDe * Returns the type name for the parameter class. */ static QString typeName() { return QStringLiteral( "matrix" ); } + + /** + * A color to represent a mtrix parameter + */ + virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override; @@ -2171,6 +2214,11 @@ class CORE_EXPORT QgsProcessingParameterMultipleLayers : public QgsProcessingPar const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a multiple layer parameter + */ + virtual QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + /** * Returns the type name for the parameter class. */ @@ -2262,6 +2310,12 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe * Returns the type name for the parameter class. */ static QString typeName() { return QStringLiteral( "number" ); } + + /** + * A color to represent a number parameter + */ + virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override; @@ -2360,6 +2414,11 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter */ static QString typeName() { return QStringLiteral( "distance" ); } // cppcheck-suppress duplInheritedMember + /** + * A color to represent a color parameter + */ + virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QgsProcessingParameterDistance *clone() const override SIP_FACTORY; QString type() const override; @@ -2597,6 +2656,11 @@ class CORE_EXPORT QgsProcessingParameterDuration : public QgsProcessingParameter */ static QString typeName() { return QStringLiteral( "duration" ); } // cppcheck-suppress duplInheritedMember + /** + * A color to represent a duration parameter + */ + virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QgsProcessingParameterDuration *clone() const override SIP_FACTORY; QString type() const override; @@ -2651,6 +2715,11 @@ class CORE_EXPORT QgsProcessingParameterScale : public QgsProcessingParameterNum */ static QString typeName() { return QStringLiteral( "scale" ); } // cppcheck-suppress duplInheritedMember + /** + * A color to represent a scale parameter + */ + virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QgsProcessingParameterScale *clone() const override SIP_FACTORY; QString type() const override; @@ -2684,6 +2753,12 @@ class CORE_EXPORT QgsProcessingParameterRange : public QgsProcessingParameterDef * Returns the type name for the parameter class. */ static QString typeName() { return QStringLiteral( "range" ); } + + /** + * A color to represent a range parameter + */ + virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override; @@ -2730,6 +2805,11 @@ class CORE_EXPORT QgsProcessingParameterRasterLayer : public QgsProcessingParame QgsProcessingParameterRasterLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a raster layer parameter + */ + virtual QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; + /** * Returns the type name for the parameter class. */ @@ -2779,6 +2859,11 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi bool optional = false, bool usesStaticStrings = false ); + /** + * A color to represent an enum parameter + */ + virtual QColor getColor() const override { return QColor( 128, 68, 201 ); /* purple */ }; + /** * Returns the type name for the parameter class. */ @@ -2883,6 +2968,11 @@ class CORE_EXPORT QgsProcessingParameterString : public QgsProcessingParameterDe bool multiLine = false, bool optional = false ); + /** + * A color to represent a string parameter + */ + virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + /** * Returns the type name for the parameter class. */ @@ -2974,6 +3064,11 @@ class CORE_EXPORT QgsProcessingParameterExpression : public QgsProcessingParamet const QString &parentLayerParameterName = QString(), bool optional = false, Qgis::ExpressionType type = Qgis::ExpressionType::Qgis ); + /** + * A color to represent an expression parameter + */ + virtual QColor getColor() const override { return QColor( 176, 76, 158 ); /* dark pink */ }; + /** * Returns the type name for the parameter class. */ @@ -3079,6 +3174,12 @@ class CORE_EXPORT QgsProcessingParameterVectorLayer : public QgsProcessingParame const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a vector layer parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + + /** * Returns the type name for the parameter class. */ @@ -3120,6 +3221,11 @@ class CORE_EXPORT QgsProcessingParameterMeshLayer : public QgsProcessingParamete const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a mesh layer parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the parameter class. */ @@ -3154,6 +3260,11 @@ class CORE_EXPORT QgsProcessingParameterMapLayer : public QgsProcessingParameter bool optional = false, const QList< int > &types = QList< int >() ); + /** + * A color to represent a map layer parameter + */ + virtual QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + /** * Returns the type name for the parameter class. */ @@ -3301,6 +3412,11 @@ class CORE_EXPORT QgsProcessingParameterFeatureSource : public QgsProcessingPara const QList< int > &types = QList< int >(), const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a feature source parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the parameter class. */ @@ -3465,6 +3581,11 @@ class CORE_EXPORT QgsProcessingParameterFeatureSink : public QgsProcessingDestin QgsProcessingParameterFeatureSink( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry, const QVariant &defaultValue = QVariant(), bool optional = false, bool createByDefault = true, bool supportsAppend = false ); + /** + * A color to represent a feature sink parameter + */ + virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + /** * Returns the type name for the parameter class. */ @@ -3562,6 +3683,11 @@ class CORE_EXPORT QgsProcessingParameterVectorDestination : public QgsProcessing QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry, const QVariant &defaultValue = QVariant(), bool optional = false, bool createByDefault = true ); + /** + * A color to represent a vector destination parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the parameter class. */ @@ -3636,6 +3762,11 @@ class CORE_EXPORT QgsProcessingParameterRasterDestination : public QgsProcessing bool optional = false, bool createByDefault = true ); + /** + * A color to represent a raster destination parameter + */ + virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + /** * Returns the type name for the parameter class. */ @@ -3697,6 +3828,11 @@ class CORE_EXPORT QgsProcessingParameterFileDestination : public QgsProcessingDe bool optional = false, bool createByDefault = true ); + /** + * A color to represent a file destination parameter + */ + virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + /** * Returns the type name for the parameter class. */ @@ -3754,6 +3890,11 @@ class CORE_EXPORT QgsProcessingParameterFolderDestination : public QgsProcessing bool optional = false, bool createByDefault = true ); + /** + * A color to represent a folder destination parameter + */ + virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + /** * Returns the type name for the parameter class. */ @@ -3980,6 +4121,12 @@ class CORE_EXPORT QgsProcessingParameterColor : public QgsProcessingParameterDef * Returns the type name for the parameter class. */ static QString typeName() { return QStringLiteral( "color" ); } + + /** + * A color to represent a color parameter + */ + virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override; @@ -4194,6 +4341,11 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter const QDateTime &maxValue = QDateTime() ); + /** + * A color to represent a datetime parameter + */ + virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + /** * Returns the type name for the parameter class. */ @@ -4513,6 +4665,11 @@ class CORE_EXPORT QgsProcessingParameterPointCloudLayer : public QgsProcessingPa QgsProcessingParameterPointCloudLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent a point cloud layer parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the parameter class. */ @@ -4548,6 +4705,11 @@ class CORE_EXPORT QgsProcessingParameterAnnotationLayer : public QgsProcessingPa QgsProcessingParameterAnnotationLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); + /** + * A color to represent an annotation layer parameter + */ + virtual QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + /** * Returns the type name for the parameter class. */ @@ -4587,6 +4749,11 @@ class CORE_EXPORT QgsProcessingParameterPointCloudDestination : public QgsProces bool optional = false, bool createByDefault = true ); + /** + * A color to represent a point cloud destination parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the parameter class. */ @@ -4723,6 +4890,11 @@ class CORE_EXPORT QgsProcessingParameterVectorTileDestination : public QgsProces bool optional = false, bool createByDefault = true ); + /** + * A color to represent a vector tile destination parameter + */ + virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + /** * Returns the type name for the parameter class. */ diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index 8c7c9727306..50c64b74b8d 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -73,8 +73,7 @@ QgsModelArrowItem::QgsModelArrowItem( QgsModelComponentGraphicItem *startItem, M void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * ) { - QString dataType = mStartItem->getLinkedParamDataType( mStartEdge, mStartIndex ); - QColor color = QgsModelDesignerSocketGraphicItem::typeToColorLookup( dataType ); + QColor color = mStartItem->getLinkColor( mStartEdge, mStartIndex ); if ( mStartItem->state() == QgsModelComponentGraphicItem::Selected || mEndItem->state() == QgsModelComponentGraphicItem::Selected ) color.setAlpha( 220 ); diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 0e68f3fc81a..d0a778381fd 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -887,6 +887,22 @@ QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge /* unused } +QColor QgsModelParameterGraphicItem::getLinkColor( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) +{ + if ( index < 0 ) + { + return fallbackColor(); + } + + if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) ) + { + return this->model()->parameterDefinition( parameter->parameterName() )->getColor(); + } + + return fallbackColor(); +} + + void QgsModelParameterGraphicItem::updateStoredComponentPosition( const QPointF &pos, const QSizeF &size ) { if ( QgsProcessingModelParameter *param = dynamic_cast( component() ) ) @@ -1166,6 +1182,46 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType( Qt::Edge edge, int return QString(); } +QColor QgsModelComponentGraphicItem::getLinkColor( Qt::Edge edge, int index ) +{ + if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast( component() ) ) + { + if ( !child->algorithm() ) + { + return fallbackColor(); + } + + switch ( edge ) + { + case Qt::BottomEdge: + { + if ( index <= child->algorithm()->outputDefinitions().size() - 1 ) + { + return child->algorithm()->outputDefinitions().at( index )->getColor(); + } + return fallbackColor(); + } + case Qt::TopEdge: + { + QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions(); + + if ( index <= params.size() - 1 ) + { + return params.at( index )->getColor(); + } + + return fallbackColor(); + } + + case Qt::LeftEdge: + case Qt::RightEdge: + break; + } + } + + return fallbackColor(); +} + QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int index ) const { diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h index f01e0e26a0b..c325b646154 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h @@ -139,6 +139,8 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QColor getLinkColor( Qt::Edge edge, int index ); + #ifndef SIP_RUN /** @@ -365,6 +367,11 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject */ void updateButtonPositions(); + /** + * Get the fallback color if parameter or output do not have a specific color + */ + QColor fallbackColor() const { return mFallbackColor; }; + private: QSizeF itemSize() const; @@ -402,6 +409,7 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject bool mIsHovering = false; QSizeF mTempSize; + QColor mFallbackColor = QColor( 128, 128, 128 ); /* mid gray */ }; Q_DECLARE_OPERATORS_FOR_FLAGS( QgsModelComponentGraphicItem::Flags ) @@ -431,6 +439,8 @@ class GUI_EXPORT QgsModelParameterGraphicItem : public QgsModelComponentGraphicI QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) override; + QColor getLinkColor( Qt::Edge edge, int index ) override; + protected: QColor fillColor( State state ) const override; QColor strokeColor( State state ) const override; diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index 3984f1aa57e..65ba0974ff3 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -212,95 +212,14 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp QColor QgsModelDesignerSocketGraphicItem::getColor() { - QString dataType; - // 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( componentItem() ) ) { - dataType = paramItem->getLinkedParamDataType( mEdge, mIndex ); - } - else - { - dataType = componentItem()->getLinkedParamDataType( mEdge, mIndex ); + return paramItem->getLinkColor( mEdge, mIndex ); } - return QgsModelDesignerSocketGraphicItem::typeToColorLookup( dataType ); -} - - -QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup( QString dataType ) -{ - // Numerical types - if ( - dataType == QgsProcessingParameterMatrix::typeName() || dataType == QgsProcessingParameterNumber::typeName() || dataType == QgsProcessingParameterRange::typeName() || dataType == QgsProcessingParameterColor::typeName() || dataType == QgsProcessingOutputNumber::typeName() || dataType == QgsProcessingParameterDistance::typeName() || dataType == QgsProcessingParameterDuration::typeName() || dataType == QgsProcessingParameterScale::typeName() - ) - return QColor( 34, 157, 214 ); // blue - - - // Boolean type - if ( - dataType == QgsProcessingParameterBoolean::typeName() || dataType == QgsProcessingOutputBoolean::typeName() - ) - return QColor( 51, 201, 28 ); // green - - // Vector types - if ( - dataType == QgsProcessingParameterPoint::typeName() || dataType == QgsProcessingParameterGeometry::typeName() || dataType == QgsProcessingParameterVectorLayer::typeName() || dataType == QgsProcessingParameterMeshLayer::typeName() || dataType == QgsProcessingParameterPointCloudLayer::typeName() || dataType == QgsProcessingOutputVectorLayer::typeName() || dataType == QgsProcessingOutputPointCloudLayer::typeName() || dataType == QgsProcessingParameterExtent::typeName() || dataType == QgsProcessingOutputVectorTileLayer::typeName() || dataType == QgsProcessingParameterPointCloudDestination::typeName() || dataType == QgsProcessingParameterVectorTileDestination::typeName() || dataType == QgsProcessingParameterVectorDestination::typeName() || dataType == QgsProcessingParameterFeatureSource::typeName() - ) - return QColor( 180, 180, 0 ); // kaki (greenish yellow) - - // Raster type - if ( - dataType == QgsProcessingParameterRasterLayer::typeName() || dataType == QgsProcessingOutputRasterLayer::typeName() - ) - return QColor( 0, 180, 180 ); // turquoise - - // enum - if ( - dataType == QgsProcessingParameterEnum::typeName() - ) - return QColor( 128, 68, 201 ); // purple - - // String and datetime types - if ( - dataType == QgsProcessingParameterString::typeName() || dataType == QgsProcessingParameterDateTime::typeName() || dataType == QgsProcessingParameterCrs::typeName() || dataType == QgsProcessingOutputHtml::typeName() || dataType == QgsProcessingOutputString::typeName() - ) - return QColor( 100, 100, 255 ); // slate blueish - - // filesystem types - if ( - dataType == QgsProcessingParameterFile::typeName() || dataType == QgsProcessingOutputFolder::typeName() || dataType == QgsProcessingOutputFile::typeName() || dataType == QgsProcessingParameterFolderDestination::typeName() || dataType == QgsProcessingParameterFeatureSink::typeName() || dataType == QgsProcessingParameterRasterDestination::typeName() || dataType == QgsProcessingParameterFileDestination::typeName() - ) - return QColor( 80, 80, 80 ); // dark gray - - // Expression type - if ( dataType == QgsProcessingParameterExpression::typeName() ) - return QColor( 180, 80, 180 ); // dark pink - - // Other Layer types - if ( - dataType == QgsProcessingParameterMultipleLayers::typeName() || dataType == QgsProcessingParameterMapLayer::typeName() || dataType == QgsProcessingParameterAnnotationLayer::typeName() || dataType == QgsProcessingOutputMultipleLayers::typeName() - ) - return QColor( 128, 128, 0 ); // Dark kaki - - // Default color, applies for: - // QgsProcessingParameterField - // QgsProcessingParameterMapTheme - // QgsProcessingParameterBand - // QgsProcessingParameterLayout - // QgsProcessingParameterLayoutItem - // QgsProcessingParameterCoordinateOperation - // QgsProcessingParameterAuthConfig // config - // QgsProcessingParameterDatabaseSchema - // QgsProcessingParameterDatabaseTable - // QgsProcessingParameterProviderConnection - // QgsProcessingParameterPointCloudAttribute - // QgsProcessingOutputVariant - // QgsProcessingOutputConditionalBranch - { - return QColor( 128, 128, 128 ); // mid gray - } + return componentItem()->getLinkColor( mEdge, mIndex ); } diff --git a/src/gui/processing/models/qgsmodelgraphicitem.h b/src/gui/processing/models/qgsmodelgraphicitem.h index f0f665e383a..3bbbc619631 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.h +++ b/src/gui/processing/models/qgsmodelgraphicitem.h @@ -158,8 +158,6 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat { Q_OBJECT public: - static QColor typeToColorLookup( QString dataType ); - /** * Constructor for QgsModelDesignerSocketGraphicItem, with the specified \a parent item. * From 1dda85e367e70a8116c37131946bbbc58737f045 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Wed, 14 May 2025 14:08:36 +0200 Subject: [PATCH 12/42] moved virtual method body to cpp file --- .../processing/qgsprocessingoutputs.sip.in | 1 + .../qgsmodelcomponentgraphicitem.py | 2 +- .../qgsmodelcomponentgraphicitem.sip.in | 2 - .../processing/qgsprocessingoutputs.sip.in | 1 + .../qgsmodelcomponentgraphicitem.py | 2 +- .../qgsmodelcomponentgraphicitem.sip.in | 2 - src/core/processing/qgsprocessingoutputs.cpp | 6 ++ src/core/processing/qgsprocessingoutputs.h | 22 +++---- .../processing/qgsprocessingparameters.cpp | 6 +- src/core/processing/qgsprocessingparameters.h | 66 +++++++++---------- .../models/qgsmodelcomponentgraphicitem.h | 4 +- 11 files changed, 61 insertions(+), 53 deletions(-) diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in index e5ab43b2967..59081c7e084 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -69,6 +69,7 @@ Constructor for QgsProcessingOutputDefinition. %Docstring A fallback color to represent a processing output %End + virtual QString type() const = 0; %Docstring Unique output type name. diff --git a/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py b/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py index a6401c380ba..378eac4ebf9 100644 --- a/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py +++ b/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py @@ -16,7 +16,7 @@ QgsModelComponentGraphicItem.Flag.__and__ = lambda flag1, flag2: _force_int(flag QgsModelComponentGraphicItem.Flag.__or__ = lambda flag1, flag2: QgsModelComponentGraphicItem.Flag(_force_int(flag1) | _force_int(flag2)) try: QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"} - QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'getLinkColor', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] + QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition'] QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint'] QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']} diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index 2ad5a00fb89..b5a5aa98b92 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -114,8 +114,6 @@ Sets a new scene ``rect`` for the item. virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); - virtual QColor getLinkColor( Qt::Edge edge, int index ); - virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event ); diff --git a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in index e5ab43b2967..59081c7e084 100644 --- a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -69,6 +69,7 @@ Constructor for QgsProcessingOutputDefinition. %Docstring A fallback color to represent a processing output %End + virtual QString type() const = 0; %Docstring Unique output type name. diff --git a/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py b/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py index 1e7a3ef58e0..9bb04b28e64 100644 --- a/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py +++ b/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py @@ -1,7 +1,7 @@ # The following has been generated automatically from src/gui/processing/models/qgsmodelcomponentgraphicitem.h try: QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"} - QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'getLinkColor', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] + QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition'] QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint'] QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']} diff --git a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index fe83de5974a..8f91044f5dc 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -114,8 +114,6 @@ Sets a new scene ``rect`` for the item. virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); - virtual QColor getLinkColor( Qt::Edge edge, int index ); - virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); virtual void hoverEnterEvent( QGraphicsSceneHoverEvent *event ); diff --git a/src/core/processing/qgsprocessingoutputs.cpp b/src/core/processing/qgsprocessingoutputs.cpp index 9983f3bdd93..f81972d24f9 100644 --- a/src/core/processing/qgsprocessingoutputs.cpp +++ b/src/core/processing/qgsprocessingoutputs.cpp @@ -48,6 +48,11 @@ QString QgsProcessingOutputDefinition::valueAsFormattedString( const QVariant &v return valueAsString( value, context, ok ); } +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 ) , mDataType( type ) @@ -63,6 +68,7 @@ void QgsProcessingOutputVectorLayer::setDataType( Qgis::ProcessingSourceType typ mDataType = type; } + QgsProcessingOutputRasterLayer::QgsProcessingOutputRasterLayer( const QString &name, const QString &description ) : QgsProcessingOutputDefinition( name, description ) {} diff --git a/src/core/processing/qgsprocessingoutputs.h b/src/core/processing/qgsprocessingoutputs.h index 3e6e418c384..0dd77750cdb 100644 --- a/src/core/processing/qgsprocessingoutputs.h +++ b/src/core/processing/qgsprocessingoutputs.h @@ -89,7 +89,7 @@ class CORE_EXPORT QgsProcessingOutputDefinition /** * A fallback color to represent a processing output */ - virtual QColor getColor() const { return QColor( 128, 128, 128 ); /* mid gray */ }; + virtual QColor getColor() const; /** * Unique output type name. @@ -227,7 +227,7 @@ class CORE_EXPORT QgsProcessingOutputVectorLayer : public QgsProcessingOutputDef /** * A color to represent a vector layer ouput */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 0, 255, 0 ); /* green */ }; /** * Returns the type name for the output class. @@ -275,7 +275,7 @@ class CORE_EXPORT QgsProcessingOutputRasterLayer : public QgsProcessingOutputDef /** * A color to represent a raster layer output */ - virtual QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; + QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; }; /** @@ -331,7 +331,7 @@ class CORE_EXPORT QgsProcessingOutputMultipleLayers : public QgsProcessingOutput /** * A color to represent a multiple layer output */ - virtual QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; }; /** @@ -358,7 +358,7 @@ class CORE_EXPORT QgsProcessingOutputHtml : public QgsProcessingOutputDefinition /** * A color to represent an HTML output */ - virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; }; @@ -409,7 +409,7 @@ class CORE_EXPORT QgsProcessingOutputNumber : public QgsProcessingOutputDefiniti /** * A color to represent a number output */ - virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; /** * Returns the type name for the output class. @@ -443,7 +443,7 @@ class CORE_EXPORT QgsProcessingOutputString : public QgsProcessingOutputDefiniti /** * A color to represent a string output */ - virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; }; /** @@ -464,7 +464,7 @@ class CORE_EXPORT QgsProcessingOutputBoolean : public QgsProcessingOutputDefinit /** * A color to represent a boolean output */ - virtual QColor getColor() const override { return QColor( 51, 201, 28 ); /* green */ }; + QColor getColor() const override { return QColor( 51, 201, 28 ); /* green */ }; /** @@ -500,7 +500,7 @@ class CORE_EXPORT QgsProcessingOutputFolder : public QgsProcessingOutputDefiniti /** * A color to represent a folder output */ - virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; /** @@ -527,7 +527,7 @@ class CORE_EXPORT QgsProcessingOutputFile : public QgsProcessingOutputDefinition /** * A color to represent a file output */ - virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; /** @@ -577,7 +577,7 @@ class CORE_EXPORT QgsProcessingOutputVectorTileLayer : public QgsProcessingOutpu /** * A color to represent a vector tile layer output */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; }; #endif // QGSPROCESSINGOUTPUTS_H diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 22004d2354c..285f7e9a67c 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -66,7 +66,6 @@ bool QgsProcessingFeatureSourceDefinition::loadVariant( const QVariantMap &map ) return true; } - // // QgsProcessingOutputLayerDefinition // @@ -3017,6 +3016,11 @@ QgsProcessingParameterDefinition *QgsProcessingParameterBoolean::clone() const return new QgsProcessingParameterBoolean( *this ); } +QColor QgsProcessingParameterDefinition::getColor() const +{ + return QColor( 128, 128, 128 ); /* mid gray */ +} + QString QgsProcessingParameterBoolean::valueAsPythonString( const QVariant &val, QgsProcessingContext & ) const { if ( !val.isValid() ) diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index b3682d21238..00309f66d81 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -464,7 +464,7 @@ class CORE_EXPORT QgsProcessingParameterDefinition /** * A color to represent the default parameter */ - virtual QColor getColor() const { return QColor( 128, 128, 128 ); /* mid gray */ } + virtual QColor getColor() const; /** * Creates a clone of the parameter definition. @@ -1791,7 +1791,7 @@ class CORE_EXPORT QgsProcessingParameterBoolean : public QgsProcessingParameterD /** * A color to represent a boolean parameter */ - virtual QColor getColor() const override { return QColor( 51, 201, 28 ); /* green */ }; + QColor getColor() const override { return QColor( 51, 201, 28 ); /* green */ }; /** * Returns the type name for the parameter class. @@ -1826,7 +1826,7 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin /** * A color to represent a crs parameter */ - virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; /** * Returns the type name for the parameter class. @@ -1864,7 +1864,7 @@ class CORE_EXPORT QgsProcessingParameterExtent : public QgsProcessingParameterDe /** * A color to represent an extent parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** * Returns the type name for the parameter class. @@ -1912,7 +1912,7 @@ class CORE_EXPORT QgsProcessingParameterPoint : public QgsProcessingParameterDef /** * A color to represent a point parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** @@ -1953,7 +1953,7 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter /** * A color to represent a geometry parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** * Returns the type name for the parameter class. @@ -2028,7 +2028,7 @@ class CORE_EXPORT QgsProcessingParameterFile : public QgsProcessingParameterDefi /** * A color to represent a file parameter */ - virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -2132,7 +2132,7 @@ class CORE_EXPORT QgsProcessingParameterMatrix : public QgsProcessingParameterDe /** * A color to represent a mtrix parameter */ - virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } @@ -2217,7 +2217,7 @@ class CORE_EXPORT QgsProcessingParameterMultipleLayers : public QgsProcessingPar /** * A color to represent a multiple layer parameter */ - virtual QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; /** * Returns the type name for the parameter class. @@ -2314,7 +2314,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe /** * A color to represent a number parameter */ - virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } @@ -2417,7 +2417,7 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter /** * A color to represent a color parameter */ - virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDistance *clone() const override SIP_FACTORY; @@ -2659,7 +2659,7 @@ class CORE_EXPORT QgsProcessingParameterDuration : public QgsProcessingParameter /** * A color to represent a duration parameter */ - virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDuration *clone() const override SIP_FACTORY; @@ -2718,7 +2718,7 @@ class CORE_EXPORT QgsProcessingParameterScale : public QgsProcessingParameterNum /** * A color to represent a scale parameter */ - virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterScale *clone() const override SIP_FACTORY; @@ -2757,7 +2757,7 @@ class CORE_EXPORT QgsProcessingParameterRange : public QgsProcessingParameterDef /** * A color to represent a range parameter */ - virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } @@ -2808,7 +2808,7 @@ class CORE_EXPORT QgsProcessingParameterRasterLayer : public QgsProcessingParame /** * A color to represent a raster layer parameter */ - virtual QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; + QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; /** * Returns the type name for the parameter class. @@ -2862,7 +2862,7 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi /** * A color to represent an enum parameter */ - virtual QColor getColor() const override { return QColor( 128, 68, 201 ); /* purple */ }; + QColor getColor() const override { return QColor( 128, 68, 201 ); /* purple */ }; /** * Returns the type name for the parameter class. @@ -2971,7 +2971,7 @@ class CORE_EXPORT QgsProcessingParameterString : public QgsProcessingParameterDe /** * A color to represent a string parameter */ - virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; /** * Returns the type name for the parameter class. @@ -3067,7 +3067,7 @@ class CORE_EXPORT QgsProcessingParameterExpression : public QgsProcessingParamet /** * A color to represent an expression parameter */ - virtual QColor getColor() const override { return QColor( 176, 76, 158 ); /* dark pink */ }; + QColor getColor() const override { return QColor( 176, 76, 158 ); /* dark pink */ }; /** * Returns the type name for the parameter class. @@ -3177,7 +3177,7 @@ class CORE_EXPORT QgsProcessingParameterVectorLayer : public QgsProcessingParame /** * A color to represent a vector layer parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** @@ -3224,7 +3224,7 @@ class CORE_EXPORT QgsProcessingParameterMeshLayer : public QgsProcessingParamete /** * A color to represent a mesh layer parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** * Returns the type name for the parameter class. @@ -3263,7 +3263,7 @@ class CORE_EXPORT QgsProcessingParameterMapLayer : public QgsProcessingParameter /** * A color to represent a map layer parameter */ - virtual QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; /** * Returns the type name for the parameter class. @@ -3415,7 +3415,7 @@ class CORE_EXPORT QgsProcessingParameterFeatureSource : public QgsProcessingPara /** * A color to represent a feature source parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** * Returns the type name for the parameter class. @@ -3584,7 +3584,7 @@ class CORE_EXPORT QgsProcessingParameterFeatureSink : public QgsProcessingDestin /** * A color to represent a feature sink parameter */ - virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -3686,7 +3686,7 @@ class CORE_EXPORT QgsProcessingParameterVectorDestination : public QgsProcessing /** * A color to represent a vector destination parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** * Returns the type name for the parameter class. @@ -3765,7 +3765,7 @@ class CORE_EXPORT QgsProcessingParameterRasterDestination : public QgsProcessing /** * A color to represent a raster destination parameter */ - virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -3831,7 +3831,7 @@ class CORE_EXPORT QgsProcessingParameterFileDestination : public QgsProcessingDe /** * A color to represent a file destination parameter */ - virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -3893,7 +3893,7 @@ class CORE_EXPORT QgsProcessingParameterFolderDestination : public QgsProcessing /** * A color to represent a folder destination parameter */ - virtual QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -4125,7 +4125,7 @@ class CORE_EXPORT QgsProcessingParameterColor : public QgsProcessingParameterDef /** * A color to represent a color parameter */ - virtual QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } @@ -4344,7 +4344,7 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter /** * A color to represent a datetime parameter */ - virtual QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; /** * Returns the type name for the parameter class. @@ -4668,7 +4668,7 @@ class CORE_EXPORT QgsProcessingParameterPointCloudLayer : public QgsProcessingPa /** * A color to represent a point cloud layer parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** * Returns the type name for the parameter class. @@ -4708,7 +4708,7 @@ class CORE_EXPORT QgsProcessingParameterAnnotationLayer : public QgsProcessingPa /** * A color to represent an annotation layer parameter */ - virtual QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; /** * Returns the type name for the parameter class. @@ -4752,7 +4752,7 @@ class CORE_EXPORT QgsProcessingParameterPointCloudDestination : public QgsProces /** * A color to represent a point cloud destination parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** * Returns the type name for the parameter class. @@ -4893,7 +4893,7 @@ class CORE_EXPORT QgsProcessingParameterVectorTileDestination : public QgsProces /** * A color to represent a vector tile destination parameter */ - virtual QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; /** * Returns the type name for the parameter class. diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h index c325b646154..d3dad54fe1d 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h @@ -139,10 +139,10 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); - virtual QColor getLinkColor( Qt::Edge edge, int index ); - #ifndef SIP_RUN + virtual QColor getLinkColor( Qt::Edge edge, int index ); + /** * Shows a preview of setting a new \a rect for the item. */ From 46ebf8dff223f95b3c7124e6746c11636edd38fc Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Wed, 14 May 2025 15:07:25 +0200 Subject: [PATCH 13/42] moved virtual method body to cpp file 2 --- .../auto_additions/qgsprocessingoutputs.py | 70 ++++---- .../auto_additions/qgsprocessingparameters.py | 64 +++---- .../processing/qgsprocessingoutputs.sip.in | 58 ++---- .../processing/qgsprocessingparameters.sip.in | 167 +++++------------- .../auto_additions/qgsprocessingoutputs.py | 70 ++++---- .../auto_additions/qgsprocessingparameters.py | 64 +++---- .../processing/qgsprocessingoutputs.sip.in | 58 ++---- .../processing/qgsprocessingparameters.sip.in | 167 +++++------------- 8 files changed, 254 insertions(+), 464 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py index 8e1fdc5e8af..e85abfa77fd 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py @@ -7,80 +7,80 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName) - QgsProcessingOutputVectorLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputVectorLayer.__overridden_methods__ = ['type'] QgsProcessingOutputVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName) - QgsProcessingOutputRasterLayer.__overridden_methods__ = ['type', 'getColor'] + QgsProcessingOutputRasterLayer.__overridden_methods__ = ['type'] QgsProcessingOutputRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.__overridden_methods__ = ['type'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.__group__ = ['processing'] + QgsProcessingOutputPointCloudLayer.typeName = staticmethod(QgsProcessingOutputPointCloudLayer.typeName) + QgsProcessingOutputPointCloudLayer.__overridden_methods__ = ['type'] + QgsProcessingOutputPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.__group__ = ['processing'] + QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName) + QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString'] + QgsProcessingOutputMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.__group__ = ['processing'] + QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName) + QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString'] + QgsProcessingOutputHtml.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.__group__ = ['processing'] + QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputVariant.typeName) + QgsProcessingOutputVariant.__overridden_methods__ = ['type', 'valueAsString'] + QgsProcessingOutputVariant.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.__group__ = ['processing'] + QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName) + QgsProcessingOutputNumber.__overridden_methods__ = ['type', 'valueAsString'] + QgsProcessingOutputNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.__overridden_methods__ = ['type', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.__group__ = ['processing'] + QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName) + QgsProcessingOutputString.__overridden_methods__ = ['type'] + QgsProcessingOutputString.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.__group__ = ['processing'] + QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName) + QgsProcessingOutputBoolean.__overridden_methods__ = ['type', 'valueAsString'] + QgsProcessingOutputBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.__group__ = ['processing'] + QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName) + QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString'] + QgsProcessingOutputFolder.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.__group__ = ['processing'] + QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName) + QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString'] + QgsProcessingOutputFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.__overridden_methods__ = ['type'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.__group__ = ['processing'] + QgsProcessingOutputConditionalBranch.typeName = staticmethod(QgsProcessingOutputConditionalBranch.typeName) + QgsProcessingOutputConditionalBranch.__overridden_methods__ = ['type'] + QgsProcessingOutputConditionalBranch.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] + QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName) + QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type'] + QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: diff --git a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py index 68e9bbbe92d..05d48db7a19 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['getColor', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,7 +378,7 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 59081c7e084..4b46ea6a61e 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -220,10 +220,7 @@ 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 Returns the type name for the output class. @@ -268,10 +265,7 @@ 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 +}; class QgsProcessingOutputPointCloudLayer : QgsProcessingOutputDefinition { @@ -307,7 +301,7 @@ when the number and nature of the output layers is not predefined. .. note:: Always prefer to explicitly define :py:class:`QgsProcessingOutputVectorLayer`, - QgsProcessingOutputRasterLayer or QgsProcessingOutputMapLayer where possible. :py:class:`QgsProcessingOutputMultipleLayers` + :py:class:`QgsProcessingOutputRasterLayer` or :py:class:`QgsProcessingOutputMapLayer` where possible. :py:class:`QgsProcessingOutputMultipleLayers` should only ever be used when the number of output layers is not fixed - e.g. as a result of processing all layers in a specified folder. @@ -332,10 +326,7 @@ Returns the type name for the output class. 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 +}; class QgsProcessingOutputHtml : QgsProcessingOutputDefinition { @@ -361,10 +352,7 @@ Returns the type name for the output class. 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 +}; class QgsProcessingOutputVariant : QgsProcessingOutputDefinition @@ -391,12 +379,12 @@ Constructor for QgsProcessingOutputVariant. Returns the type name for the output class. %End - virtual QColor getColor() const; + + virtual QString type() 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; @@ -418,10 +406,7 @@ 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 Returns the type name for the output class. @@ -454,10 +439,7 @@ 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 +}; class QgsProcessingOutputBoolean : QgsProcessingOutputDefinition { @@ -477,10 +459,7 @@ 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 @@ -516,10 +495,7 @@ Returns the type name for the output class. 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 +}; class QgsProcessingOutputFile : QgsProcessingOutputDefinition { @@ -545,10 +521,7 @@ Returns the type name for the output class. 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 +}; class QgsProcessingOutputConditionalBranch : QgsProcessingOutputDefinition { @@ -600,10 +573,7 @@ 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 +}; /************************************************************************ * This file has been generated automatically from * diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index 329333cca9a..7640ec10526 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -1890,10 +1890,7 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End - virtual QColor getColor() const; -%Docstring -A color to represent a boolean parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1929,10 +1926,7 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QColor getColor() const; -%Docstring -A color to represent a crs parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1973,10 +1967,7 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End - virtual QColor getColor() const; -%Docstring -A color to represent an extent parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2018,10 +2009,7 @@ A point parameter for processing algorithms. Constructor for QgsProcessingParameterPoint. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point parameter -%End + static QString typeName(); %Docstring @@ -2065,10 +2053,7 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End - virtual QColor getColor() const; -%Docstring -A color to represent a geometry parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2151,10 +2136,7 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End - virtual QColor getColor() const; -%Docstring -A color to represent a file parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2273,12 +2255,12 @@ Constructor for QgsProcessingParameterMatrix. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + %Docstring A color to represent a mtrix parameter %End - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2371,10 +2353,7 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End - virtual QColor getColor() const; -%Docstring -A color to represent a multiple layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2478,12 +2457,12 @@ Constructor for QgsProcessingParameterNumber. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + %Docstring A color to represent a number parameter %End - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2590,12 +2569,12 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDistance *clone() const /Factory/; + %Docstring A color to represent a color parameter %End - virtual QgsProcessingParameterDistance *clone() const /Factory/; - virtual QString type() const; @@ -2855,12 +2834,12 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDuration *clone() const /Factory/; + %Docstring A color to represent a duration parameter %End - virtual QgsProcessingParameterDuration *clone() const /Factory/; - virtual QString type() const; @@ -2917,12 +2896,12 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterScale *clone() const /Factory/; + %Docstring A color to represent a scale parameter %End - virtual QgsProcessingParameterScale *clone() const /Factory/; - virtual QString type() const; @@ -2960,12 +2939,12 @@ Constructor for QgsProcessingParameterRange. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + %Docstring A color to represent a range parameter %End - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -3017,10 +2996,7 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a raster layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3079,10 +3055,7 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QColor getColor() const; -%Docstring -A color to represent an enum parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3201,10 +3174,7 @@ accordingly.) Constructor for QgsProcessingParameterString. %End - virtual QColor getColor() const; -%Docstring -A color to represent a string parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3308,10 +3278,7 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End - virtual QColor getColor() const; -%Docstring -A color to represent an expression parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3433,10 +3400,7 @@ Consider using the more versatile Constructor for QgsProcessingParameterVectorLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector layer parameter -%End + static QString typeName(); %Docstring @@ -3491,10 +3455,7 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a mesh layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3537,10 +3498,7 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a map layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3721,10 +3679,7 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End - virtual QColor getColor() const; -%Docstring -A color to represent a feature source parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3901,10 +3856,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a feature sink parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4026,10 +3978,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4119,10 +4068,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a raster destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4196,10 +4142,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a file destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4270,10 +4213,7 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End - virtual QColor getColor() const; -%Docstring -A color to represent a folder destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4546,12 +4486,12 @@ varying color opacity. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + %Docstring A color to represent a color parameter %End - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - virtual QString type() const; virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const; @@ -4806,10 +4746,7 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End - virtual QColor getColor() const; -%Docstring -A color to represent a datetime parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5189,10 +5126,7 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point cloud layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5237,10 +5171,7 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent an annotation layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5288,10 +5219,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point cloud destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5457,10 +5385,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector tile destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/python/core/auto_additions/qgsprocessingoutputs.py b/python/core/auto_additions/qgsprocessingoutputs.py index 8e1fdc5e8af..e85abfa77fd 100644 --- a/python/core/auto_additions/qgsprocessingoutputs.py +++ b/python/core/auto_additions/qgsprocessingoutputs.py @@ -7,80 +7,80 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName) - QgsProcessingOutputVectorLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputVectorLayer.__overridden_methods__ = ['type'] QgsProcessingOutputVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName) - QgsProcessingOutputRasterLayer.__overridden_methods__ = ['type', 'getColor'] + QgsProcessingOutputRasterLayer.__overridden_methods__ = ['type'] QgsProcessingOutputRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.__overridden_methods__ = ['type'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputPointCloudLayer.__group__ = ['processing'] + QgsProcessingOutputPointCloudLayer.typeName = staticmethod(QgsProcessingOutputPointCloudLayer.typeName) + QgsProcessingOutputPointCloudLayer.__overridden_methods__ = ['type'] + QgsProcessingOutputPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.__group__ = ['processing'] + QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName) + QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'valueAsString'] + QgsProcessingOutputMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.__group__ = ['processing'] + QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName) + QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'valueAsFormattedString'] + QgsProcessingOutputHtml.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputVariant.__group__ = ['processing'] + QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputVariant.typeName) + QgsProcessingOutputVariant.__overridden_methods__ = ['type', 'valueAsString'] + QgsProcessingOutputVariant.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputNumber.__group__ = ['processing'] + QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName) + QgsProcessingOutputNumber.__overridden_methods__ = ['type', 'valueAsString'] + QgsProcessingOutputNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.__overridden_methods__ = ['type', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.__group__ = ['processing'] + QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName) + QgsProcessingOutputString.__overridden_methods__ = ['type'] + QgsProcessingOutputString.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputBoolean.__group__ = ['processing'] + QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName) + QgsProcessingOutputBoolean.__overridden_methods__ = ['type', 'valueAsString'] + QgsProcessingOutputBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.__group__ = ['processing'] + QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName) + QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'valueAsFormattedString'] + QgsProcessingOutputFolder.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.__group__ = ['processing'] + QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName) + QgsProcessingOutputFile.__overridden_methods__ = ['type', 'valueAsFormattedString'] + QgsProcessingOutputFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.__overridden_methods__ = ['type'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputConditionalBranch.__group__ = ['processing'] + QgsProcessingOutputConditionalBranch.typeName = staticmethod(QgsProcessingOutputConditionalBranch.typeName) + QgsProcessingOutputConditionalBranch.__overridden_methods__ = ['type'] + QgsProcessingOutputConditionalBranch.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.typeName) - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type', 'getColor'] - QgsProcessingOutputRasterLayer.QgsProcessingOutputMultipleLayers.QgsProcessingOutputHtml.QgsProcessingOutputString.QgsProcessingOutputFolder.QgsProcessingOutputFile.QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] + QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName) + QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['type'] + QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: diff --git a/python/core/auto_additions/qgsprocessingparameters.py b/python/core/auto_additions/qgsprocessingparameters.py index 68e9bbbe92d..05d48db7a19 100644 --- a/python/core/auto_additions/qgsprocessingparameters.py +++ b/python/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['getColor', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,7 +378,7 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass diff --git a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 59081c7e084..4b46ea6a61e 100644 --- a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -220,10 +220,7 @@ 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 Returns the type name for the output class. @@ -268,10 +265,7 @@ 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 +}; class QgsProcessingOutputPointCloudLayer : QgsProcessingOutputDefinition { @@ -307,7 +301,7 @@ when the number and nature of the output layers is not predefined. .. note:: Always prefer to explicitly define :py:class:`QgsProcessingOutputVectorLayer`, - QgsProcessingOutputRasterLayer or QgsProcessingOutputMapLayer where possible. :py:class:`QgsProcessingOutputMultipleLayers` + :py:class:`QgsProcessingOutputRasterLayer` or :py:class:`QgsProcessingOutputMapLayer` where possible. :py:class:`QgsProcessingOutputMultipleLayers` should only ever be used when the number of output layers is not fixed - e.g. as a result of processing all layers in a specified folder. @@ -332,10 +326,7 @@ Returns the type name for the output class. 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 +}; class QgsProcessingOutputHtml : QgsProcessingOutputDefinition { @@ -361,10 +352,7 @@ Returns the type name for the output class. 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 +}; class QgsProcessingOutputVariant : QgsProcessingOutputDefinition @@ -391,12 +379,12 @@ Constructor for QgsProcessingOutputVariant. Returns the type name for the output class. %End - virtual QColor getColor() const; + + virtual QString type() 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; @@ -418,10 +406,7 @@ 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 Returns the type name for the output class. @@ -454,10 +439,7 @@ 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 +}; class QgsProcessingOutputBoolean : QgsProcessingOutputDefinition { @@ -477,10 +459,7 @@ 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 @@ -516,10 +495,7 @@ Returns the type name for the output class. 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 +}; class QgsProcessingOutputFile : QgsProcessingOutputDefinition { @@ -545,10 +521,7 @@ Returns the type name for the output class. 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 +}; class QgsProcessingOutputConditionalBranch : QgsProcessingOutputDefinition { @@ -600,10 +573,7 @@ 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 +}; /************************************************************************ * This file has been generated automatically from * diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 19ad62daf01..1d7b0dd7036 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -1890,10 +1890,7 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End - virtual QColor getColor() const; -%Docstring -A color to represent a boolean parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1929,10 +1926,7 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QColor getColor() const; -%Docstring -A color to represent a crs parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1973,10 +1967,7 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End - virtual QColor getColor() const; -%Docstring -A color to represent an extent parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2018,10 +2009,7 @@ A point parameter for processing algorithms. Constructor for QgsProcessingParameterPoint. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point parameter -%End + static QString typeName(); %Docstring @@ -2065,10 +2053,7 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End - virtual QColor getColor() const; -%Docstring -A color to represent a geometry parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2151,10 +2136,7 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End - virtual QColor getColor() const; -%Docstring -A color to represent a file parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2273,12 +2255,12 @@ Constructor for QgsProcessingParameterMatrix. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + %Docstring A color to represent a mtrix parameter %End - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2371,10 +2353,7 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End - virtual QColor getColor() const; -%Docstring -A color to represent a multiple layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2478,12 +2457,12 @@ Constructor for QgsProcessingParameterNumber. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + %Docstring A color to represent a number parameter %End - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2590,12 +2569,12 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDistance *clone() const /Factory/; + %Docstring A color to represent a color parameter %End - virtual QgsProcessingParameterDistance *clone() const /Factory/; - virtual QString type() const; @@ -2855,12 +2834,12 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDuration *clone() const /Factory/; + %Docstring A color to represent a duration parameter %End - virtual QgsProcessingParameterDuration *clone() const /Factory/; - virtual QString type() const; @@ -2917,12 +2896,12 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterScale *clone() const /Factory/; + %Docstring A color to represent a scale parameter %End - virtual QgsProcessingParameterScale *clone() const /Factory/; - virtual QString type() const; @@ -2960,12 +2939,12 @@ Constructor for QgsProcessingParameterRange. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + %Docstring A color to represent a range parameter %End - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -3017,10 +2996,7 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a raster layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3079,10 +3055,7 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QColor getColor() const; -%Docstring -A color to represent an enum parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3201,10 +3174,7 @@ accordingly.) Constructor for QgsProcessingParameterString. %End - virtual QColor getColor() const; -%Docstring -A color to represent a string parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3308,10 +3278,7 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End - virtual QColor getColor() const; -%Docstring -A color to represent an expression parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3433,10 +3400,7 @@ Consider using the more versatile Constructor for QgsProcessingParameterVectorLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector layer parameter -%End + static QString typeName(); %Docstring @@ -3491,10 +3455,7 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a mesh layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3537,10 +3498,7 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a map layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3721,10 +3679,7 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End - virtual QColor getColor() const; -%Docstring -A color to represent a feature source parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3901,10 +3856,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a feature sink parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4026,10 +3978,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4119,10 +4068,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a raster destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4196,10 +4142,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a file destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4270,10 +4213,7 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End - virtual QColor getColor() const; -%Docstring -A color to represent a folder destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4546,12 +4486,12 @@ varying color opacity. Returns the type name for the parameter class. %End - virtual QColor getColor() const; + + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + %Docstring A color to represent a color parameter %End - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - virtual QString type() const; virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const; @@ -4806,10 +4746,7 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End - virtual QColor getColor() const; -%Docstring -A color to represent a datetime parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5189,10 +5126,7 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point cloud layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5237,10 +5171,7 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent an annotation layer parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5288,10 +5219,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point cloud destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5457,10 +5385,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector tile destination parameter -%End + static QString typeName(); %Docstring Returns the type name for the parameter class. From 287fc1b0f22726f1c24706a538be2b449e543aba Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Wed, 14 May 2025 16:26:07 +0200 Subject: [PATCH 14/42] simplified getting socket colors --- .../auto_additions/qgsprocessingoutputs.py | 22 +++--- .../processing/qgsprocessingoutputs.sip.in | 69 ++++++++++++++++--- .../auto_additions/qgsprocessingoutputs.py | 22 +++--- .../processing/qgsprocessingoutputs.sip.in | 69 ++++++++++++++++--- src/core/processing/qgsprocessingoutputs.cpp | 56 ++++++++++++++- src/core/processing/qgsprocessingoutputs.h | 37 +++++----- .../processing/models/qgsmodelgraphicitem.cpp | 7 -- 7 files changed, 215 insertions(+), 67 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py index e85abfa77fd..3c94b6543aa 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py @@ -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 diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 4b46ea6a61e..fb9d9aa96f4 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -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; }; /************************************************************************ diff --git a/python/core/auto_additions/qgsprocessingoutputs.py b/python/core/auto_additions/qgsprocessingoutputs.py index e85abfa77fd..3c94b6543aa 100644 --- a/python/core/auto_additions/qgsprocessingoutputs.py +++ b/python/core/auto_additions/qgsprocessingoutputs.py @@ -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 diff --git a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 4b46ea6a61e..fb9d9aa96f4 100644 --- a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -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; }; /************************************************************************ diff --git a/src/core/processing/qgsprocessingoutputs.cpp b/src/core/processing/qgsprocessingoutputs.cpp index f81972d24f9..bd3c2ef0a1a 100644 --- a/src/core/processing/qgsprocessingoutputs.cpp +++ b/src/core/processing/qgsprocessingoutputs.cpp @@ -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 */ +} diff --git a/src/core/processing/qgsprocessingoutputs.h b/src/core/processing/qgsprocessingoutputs.h index 0dd77750cdb..d0bb1aa3218 100644 --- a/src/core/processing/qgsprocessingoutputs.h +++ b/src/core/processing/qgsprocessingoutputs.h @@ -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 diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index 65ba0974ff3..a585ae0d386 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -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( componentItem() ) ) - { - return paramItem->getLinkColor( mEdge, mIndex ); - } - return componentItem()->getLinkColor( mEdge, mIndex ); } From 1f622fb9b5d536a8c8123f72fb3d926c96b858fb Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Wed, 14 May 2025 16:53:29 +0200 Subject: [PATCH 15/42] moving the socket with a small offset to better align --- src/gui/processing/models/qgsmodelgraphicitem.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index a585ae0d386..7e06f11f1b2 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -198,7 +198,9 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp painter->setRenderHint( QPainter::Antialiasing ); constexpr float DISPLAY_SIZE = 4; - painter->drawEllipse( position(), DISPLAY_SIZE, DISPLAY_SIZE ); + float ellipseOffset = 0.4; + QPointF ellipsePosition = QPointF( position().x() + ellipseOffset, position().y() + ellipseOffset ); + painter->drawEllipse( ellipsePosition, DISPLAY_SIZE, DISPLAY_SIZE ); /* Uncomment to display bounding box */ #if 0 painter->save(); From 1af32010e87870050e37bfda882aa52dcfbfca1c Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 15 May 2025 11:34:28 +0200 Subject: [PATCH 16/42] Adjusted start socket position and style --- .../processing/models/qgsmodelarrowitem.cpp | 21 ++++++++++++++----- .../models/qgsmodelcomponentgraphicitem.cpp | 4 ++-- .../models/qgsmodelviewtoollink.cpp | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index 50c64b74b8d..419b57c1615 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -82,21 +82,23 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem else color.setAlpha( 80 ); + // QPen p = pen(); p.setColor( color ); - p.setWidth( 2 ); + p.setWidth( 0 ); painter->setPen( p ); + painter->setBrush( color ); painter->setRenderHint( QPainter::Antialiasing ); switch ( mStartMarker ) { - case Marker::Circle: - painter->drawEllipse( mStartPoint, 3.0, 3.0 ); - break; case Marker::ArrowHead: drawArrowHead( painter, mStartPoint, path().pointAtPercent( 0.0 ) - path().pointAtPercent( 0.05 ) ); break; + + // start marker are no longer drawn + case Marker::Circle: case Marker::NoMarker: break; } @@ -104,7 +106,7 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem switch ( mEndMarker ) { case Marker::Circle: - painter->drawEllipse( mEndPoint, 3.0, 3.0 ); + painter->drawEllipse( mEndPoint, 3, 3 ); break; case Marker::ArrowHead: drawArrowHead( painter, mEndPoint, path().pointAtPercent( 1.0 ) - path().pointAtPercent( 0.95 ) ); @@ -113,7 +115,16 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem break; } + painter->setBrush( color ); + painter->setRenderHint( QPainter::Antialiasing ); painter->setBrush( Qt::NoBrush ); + + // Set the painter back to regular stroke thickness + p = pen(); + p.setColor( color ); + p.setWidth( 2 ); + painter->setPen( p ); + painter->drawPath( path() ); } diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index d0a778381fd..7f4f6a62c06 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -636,8 +636,8 @@ QPointF QgsModelComponentGraphicItem::linkPoint( Qt::Edge edge, int index, bool const QFontMetricsF fm( mFont ); const double w = fm.boundingRect( text ).width(); const double h = fm.height() * 1.2 * ( pointIndex + 1 ) + fm.height() / 2.0; - const double y = h + itemSize().height() / 2.0 + 6; - const double x = !mComponent->linksCollapsed( Qt::BottomEdge ) ? ( -itemSize().width() / 2 + 33 + w + 10 ) : 10; + const double y = h + itemSize().height() / 2.0 + 6.4; + const double x = !mComponent->linksCollapsed( Qt::BottomEdge ) ? ( -itemSize().width() / 2 + 33 + w + 10 ) : 10.4; return QPointF( incoming ? -itemSize().width() / 2 + offsetX : x, y ); } break; diff --git a/src/gui/processing/models/qgsmodelviewtoollink.cpp b/src/gui/processing/models/qgsmodelviewtoollink.cpp index f44e6b1a77e..43bda452850 100644 --- a/src/gui/processing/models/qgsmodelviewtoollink.cpp +++ b/src/gui/processing/models/qgsmodelviewtoollink.cpp @@ -122,7 +122,7 @@ void QgsModelViewToolLink::modelReleaseEvent( QgsModelViewMouseEvent *event ) * whether the user dragged : * - From an input socket to an output socket * - From an output socket to an input socket - * + * * In the code, we always come back to the first case */ if ( !mToSocket->isInput() ) From f84c4ff43b3a6401d5fac548e68cdc5ebdf0de0a Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 15 May 2025 11:35:51 +0200 Subject: [PATCH 17/42] merging switch cases --- src/gui/processing/models/qgsmodelgraphicitem.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index 7e06f11f1b2..e6c980b39e2 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -271,9 +271,6 @@ bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() // Outputs case Qt::BottomEdge: - { - break; - } case Qt::LeftEdge: case Qt::RightEdge: break; From 0e1e1505ebcf729d7a33d36f5bdc53eeb7ab1974 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 15 May 2025 11:51:28 +0200 Subject: [PATCH 18/42] output socket now are always filled --- src/gui/processing/models/qgsmodelgraphicitem.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index e6c980b39e2..dc68d8eefb0 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -187,7 +187,16 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp { QColor outlineColor = getColor(); QColor fillColor = QColor( outlineColor ); - fillColor.setAlpha( isDefaultParamValue() ? 30 : 255 ); + + if ( isInput() ) + { + fillColor.setAlpha( isDefaultParamValue() ? 30 : 255 ); + } + else + { + // outputs are always filled sockets + fillColor.setAlpha( 255 ); + } // Outline style painter->setPen( QPen( outlineColor, mHoverState ? mSocketOutlineWidth * 2 : mSocketOutlineWidth ) ); @@ -201,6 +210,7 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp float ellipseOffset = 0.4; QPointF ellipsePosition = QPointF( position().x() + ellipseOffset, position().y() + ellipseOffset ); painter->drawEllipse( ellipsePosition, DISPLAY_SIZE, DISPLAY_SIZE ); + /* Uncomment to display bounding box */ #if 0 painter->save(); From cce86d7cff8754f20d2d94076d53bc83d9fd2a08 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Fri, 16 May 2025 16:53:38 +0200 Subject: [PATCH 19/42] WIP tailored prompt for param type --- .../auto_additions/qgsprocessingparameters.py | 66 +++---- .../processing/qgsprocessingparameters.sip.in | 187 +++++++++++++----- .../auto_additions/qgsprocessingparameters.py | 66 +++---- .../processing/qgsprocessingparameters.sip.in | 187 +++++++++++++----- .../processing/qgsprocessingparameters.cpp | 137 ++++++++++++- src/core/processing/qgsprocessingparameters.h | 18 ++ .../models/qgsmodelcomponentgraphicitem.cpp | 13 +- 7 files changed, 509 insertions(+), 165 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py index 05d48db7a19..8341fd68105 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,12 +378,12 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingParameterDefinition.__virtual_methods__ = ['getColor', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] + QgsProcessingParameterDefinition.__virtual_methods__ = ['getColor', 'getUserFriendlyValue', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type'] QgsProcessingParameterDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index 7640ec10526..e7ca6b693a7 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -367,6 +367,13 @@ Constructor for QgsProcessingParameterDefinition. virtual QColor getColor() const; %Docstring A color to represent the default parameter +%End + + virtual QString getUserFriendlyValue( QVariant paramValue ) const; +%Docstring +Get a user friendly string representation of the provided parameter +value. (Meant to be override by child classes to adapt to specific param +types) %End virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/; @@ -1890,7 +1897,10 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a boolean parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1926,6 +1936,16 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End + virtual QColor getColor() const; +%Docstring +A color to represent a crs parameter +%End + virtual QString getUserFriendlyValue( QVariant paramValue ) const; + +%Docstring +Get a user friendly string representation of the provided parameter +value. +%End static QString typeName(); %Docstring @@ -1967,7 +1987,10 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End - + virtual QColor getColor() const; +%Docstring +A color to represent an extent parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2009,7 +2032,10 @@ A point parameter for processing algorithms. Constructor for QgsProcessingParameterPoint. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a point parameter +%End static QString typeName(); %Docstring @@ -2053,7 +2079,10 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End - + virtual QColor getColor() const; +%Docstring +A color to represent a geometry parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2136,7 +2165,10 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a file parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2255,12 +2287,12 @@ Constructor for QgsProcessingParameterMatrix. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a mtrix parameter %End + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2353,7 +2385,10 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a multiple layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2457,12 +2492,12 @@ Constructor for QgsProcessingParameterNumber. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a number parameter %End + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2569,12 +2604,15 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDistance *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a color parameter %End + virtual QString getUserFriendlyValue( QVariant paramValue ) const; + + + virtual QgsProcessingParameterDistance *clone() const /Factory/; + virtual QString type() const; @@ -2834,12 +2872,12 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDuration *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a duration parameter %End + virtual QgsProcessingParameterDuration *clone() const /Factory/; + virtual QString type() const; @@ -2896,12 +2934,12 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterScale *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a scale parameter %End + virtual QgsProcessingParameterScale *clone() const /Factory/; + virtual QString type() const; @@ -2939,12 +2977,12 @@ Constructor for QgsProcessingParameterRange. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a range parameter %End + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2996,7 +3034,10 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a raster layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3055,6 +3096,16 @@ values. Constructor for QgsProcessingParameterEnum. %End + virtual QColor getColor() const; +%Docstring +A color to represent an enum parameter +%End + virtual QString getUserFriendlyValue( QVariant paramValue ) const; + +%Docstring +Get a user friendly string representation of the provided parameter +value. +%End static QString typeName(); %Docstring @@ -3174,7 +3225,10 @@ accordingly.) Constructor for QgsProcessingParameterString. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a string parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3278,7 +3332,10 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End - + virtual QColor getColor() const; +%Docstring +A color to represent an expression parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3400,7 +3457,10 @@ Consider using the more versatile Constructor for QgsProcessingParameterVectorLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a vector layer parameter +%End static QString typeName(); %Docstring @@ -3455,7 +3515,10 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a mesh layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3498,7 +3561,10 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a map layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3679,7 +3745,10 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a feature source parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3856,7 +3925,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a feature sink parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3978,7 +4050,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a vector destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4068,7 +4143,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a raster destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4142,7 +4220,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a file destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4213,7 +4294,10 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a folder destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4486,12 +4570,12 @@ varying color opacity. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a color parameter %End + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + virtual QString type() const; virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const; @@ -4746,7 +4830,10 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a datetime parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5126,7 +5213,10 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a point cloud layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5171,7 +5261,10 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent an annotation layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5219,7 +5312,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a point cloud destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5385,7 +5481,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a vector tile destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/python/core/auto_additions/qgsprocessingparameters.py b/python/core/auto_additions/qgsprocessingparameters.py index 05d48db7a19..8341fd68105 100644 --- a/python/core/auto_additions/qgsprocessingparameters.py +++ b/python/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,12 +378,12 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingParameterDefinition.__virtual_methods__ = ['getColor', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] + QgsProcessingParameterDefinition.__virtual_methods__ = ['getColor', 'getUserFriendlyValue', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type'] QgsProcessingParameterDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 1d7b0dd7036..0014b092103 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -367,6 +367,13 @@ Constructor for QgsProcessingParameterDefinition. virtual QColor getColor() const; %Docstring A color to represent the default parameter +%End + + virtual QString getUserFriendlyValue( QVariant paramValue ) const; +%Docstring +Get a user friendly string representation of the provided parameter +value. (Meant to be override by child classes to adapt to specific param +types) %End virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/; @@ -1890,7 +1897,10 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a boolean parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1926,6 +1936,16 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End + virtual QColor getColor() const; +%Docstring +A color to represent a crs parameter +%End + virtual QString getUserFriendlyValue( QVariant paramValue ) const; + +%Docstring +Get a user friendly string representation of the provided parameter +value. +%End static QString typeName(); %Docstring @@ -1967,7 +1987,10 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End - + virtual QColor getColor() const; +%Docstring +A color to represent an extent parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2009,7 +2032,10 @@ A point parameter for processing algorithms. Constructor for QgsProcessingParameterPoint. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a point parameter +%End static QString typeName(); %Docstring @@ -2053,7 +2079,10 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End - + virtual QColor getColor() const; +%Docstring +A color to represent a geometry parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2136,7 +2165,10 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a file parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2255,12 +2287,12 @@ Constructor for QgsProcessingParameterMatrix. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a mtrix parameter %End + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2353,7 +2385,10 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a multiple layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2457,12 +2492,12 @@ Constructor for QgsProcessingParameterNumber. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a number parameter %End + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2569,12 +2604,15 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDistance *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a color parameter %End + virtual QString getUserFriendlyValue( QVariant paramValue ) const; + + + virtual QgsProcessingParameterDistance *clone() const /Factory/; + virtual QString type() const; @@ -2834,12 +2872,12 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDuration *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a duration parameter %End + virtual QgsProcessingParameterDuration *clone() const /Factory/; + virtual QString type() const; @@ -2896,12 +2934,12 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterScale *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a scale parameter %End + virtual QgsProcessingParameterScale *clone() const /Factory/; + virtual QString type() const; @@ -2939,12 +2977,12 @@ Constructor for QgsProcessingParameterRange. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a range parameter %End + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + virtual QString type() const; virtual bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = 0 ) const; @@ -2996,7 +3034,10 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a raster layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3055,6 +3096,16 @@ values. Constructor for QgsProcessingParameterEnum. %End + virtual QColor getColor() const; +%Docstring +A color to represent an enum parameter +%End + virtual QString getUserFriendlyValue( QVariant paramValue ) const; + +%Docstring +Get a user friendly string representation of the provided parameter +value. +%End static QString typeName(); %Docstring @@ -3174,7 +3225,10 @@ accordingly.) Constructor for QgsProcessingParameterString. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a string parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3278,7 +3332,10 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End - + virtual QColor getColor() const; +%Docstring +A color to represent an expression parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3400,7 +3457,10 @@ Consider using the more versatile Constructor for QgsProcessingParameterVectorLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a vector layer parameter +%End static QString typeName(); %Docstring @@ -3455,7 +3515,10 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a mesh layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3498,7 +3561,10 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a map layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3679,7 +3745,10 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a feature source parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3856,7 +3925,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a feature sink parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3978,7 +4050,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a vector destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4068,7 +4143,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a raster destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4142,7 +4220,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a file destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4213,7 +4294,10 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a folder destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4486,12 +4570,12 @@ varying color opacity. Returns the type name for the parameter class. %End - - virtual QgsProcessingParameterDefinition *clone() const /Factory/; - + virtual QColor getColor() const; %Docstring A color to represent a color parameter %End + virtual QgsProcessingParameterDefinition *clone() const /Factory/; + virtual QString type() const; virtual QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const; @@ -4746,7 +4830,10 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a datetime parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5126,7 +5213,10 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a point cloud layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5171,7 +5261,10 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End - + virtual QColor getColor() const; +%Docstring +A color to represent an annotation layer parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5219,7 +5312,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a point cloud destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5385,7 +5481,10 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - + virtual QColor getColor() const; +%Docstring +A color to represent a vector tile destination parameter +%End static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 285f7e9a67c..01bc1b8dd99 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -39,6 +39,7 @@ #include "qgsproviderregistry.h" #include "qgsvariantutils.h" #include "qgsmessagelog.h" +#include "qgsunittypes.h" #include #include @@ -3021,6 +3022,123 @@ QColor QgsProcessingParameterDefinition::getColor() const return QColor( 128, 128, 128 ); /* mid gray */ } +QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramValue ) const +{ + if ( paramValue.userType() == qMetaTypeId() ) + { + const QgsPointXY r = paramValue.value(); + return QStringLiteral( "%1, %2" ).arg( qgsDoubleToString( r.x(), 4 ), + qgsDoubleToString( r.y(), 4 ) ); + } + + else if ( paramValue.userType() == qMetaTypeId() ) + { + const QgsReferencedPointXY r = paramValue.value(); + return QStringLiteral( "[%1] %1, %3" ).arg( + r.crs().authid(), + qgsDoubleToString( r.x() ), + qgsDoubleToString( r.y() ) + ); + } + + else if ( paramValue.userType() == qMetaTypeId< QgsGeometry>() ) + { + const QgsGeometry g = paramValue.value(); + if ( !g.isNull() ) + { + const QString wkt = g.asWkt(); + return QStringLiteral( "wkt(%1)" ).arg( wkt ); + } + return QStringLiteral( "wkt(null)" ); + } + + else if ( paramValue.userType() == qMetaTypeId() ) + { + const QgsReferencedGeometry g = paramValue.value(); + if ( !g.isNull() ) + { + const QString wkt = g.asWkt(); + return QStringLiteral( "[%1] wkt(%2)" ).arg( g.crs().authid(), wkt ); + } + return QStringLiteral( "wkt(null)" ); + } + + if ( paramValue.userType() == qMetaTypeId() ) + { + const QgsGeometry g = QgsGeometry::fromRect( paramValue.value() ); + if ( !g.isNull() ) + { + const QString wkt = g.asWkt(); + return QStringLiteral( "wkt(%1)" ).arg( wkt ); + } + return QStringLiteral( "wkt(null)" ); + } + + else if ( paramValue.userType() == qMetaTypeId() ) + { + const QgsReferencedGeometry g = QgsReferencedGeometry::fromReferencedRect( paramValue.value() ); + if ( !g.isNull() ) + { + const QString wkt = g.asWkt(); + return QStringLiteral( "[%1] wkt(%2)" ).arg( g.crs().authid(), wkt ); + } + return QStringLiteral( "wkt(null)" ); + } + + else if ( paramValue.userType() == qMetaTypeId() ) + { + const QgsProcessingOutputLayerDefinition fromVar = qvariant_cast( paramValue ); + if ( fromVar.sink.propertyType() == Qgis::PropertyType::Static ) + { + return fromVar.sink.staticValue().toString(); + } + else + { + return fromVar.sink.asExpression(); + } + } + else if ( paramValue.userType() == QMetaType::Type::QDateTime ) + { + const QDateTime dt = paramValue.toDateTime(); + if ( !dt.isValid() ) + return QStringLiteral( "invalid datetime" ); + else + return QStringLiteral( "%1-%2-%3T%4:%5:%6" ) + .arg( dt.date().year() ) + .arg( dt.date().month() ) + .arg( dt.date().day() ) + .arg( dt.time().hour() ) + .arg( dt.time().minute() ) + .arg( dt.time().second() ); + } + + else if ( paramValue.userType() == QMetaType::Type::QDate ) + { + const QDate dt = paramValue.toDate(); + if ( !dt.isValid() ) + return QStringLiteral( "invalid date" ); + else + return QStringLiteral( "%1-%2-%3" ) + .arg( dt.year() ) + .arg( dt.month() ) + .arg( dt.day() ); + } + + else if ( paramValue.userType() == QMetaType::Type::QTime ) + { + const QTime dt = paramValue.toTime(); + if ( !dt.isValid() ) + return QStringLiteral( "invalid time" ); + else + return QStringLiteral( "%4:%5:%6" ) + .arg( dt.hour() ) + .arg( dt.minute() ) + .arg( dt.second() ); + } + + return paramValue.toString(); +} + QString QgsProcessingParameterBoolean::valueAsPythonString( const QVariant &val, QgsProcessingContext & ) const { if ( !val.isValid() ) @@ -3180,6 +3298,11 @@ QgsProcessingParameterCrs *QgsProcessingParameterCrs::fromScriptCode( const QStr return new QgsProcessingParameterCrs( name, description, definition.compare( QLatin1String( "none" ), Qt::CaseInsensitive ) == 0 ? QVariant() : definition, isOptional ); } +QString QgsProcessingParameterCrs::getUserFriendlyValue( QVariant paramValue ) const +{ + return paramValue.value().authid(); +} + QgsProcessingParameterMapLayer::QgsProcessingParameterMapLayer( const QString &name, const QString &description, const QVariant &defaultValue, bool optional, const QList &types ) : QgsProcessingParameterDefinition( name, description, defaultValue, optional ) , QgsProcessingParameterLimitedDataTypes( types ) @@ -3592,7 +3715,8 @@ QString QgsProcessingParameterExtent::valueAsPythonString( const QVariant &value return QStringLiteral( "'%1, %3, %2, %4 [%5]'" ).arg( qgsDoubleToString( r.xMinimum() ), qgsDoubleToString( r.yMinimum() ), qgsDoubleToString( r.xMaximum() ), - qgsDoubleToString( r.yMaximum() ), r.crs().authid() ); + qgsDoubleToString( r.yMaximum() ), + r.crs().authid() ); } else if ( value.userType() == qMetaTypeId< QgsGeometry>() ) { @@ -5267,6 +5391,11 @@ QString QgsProcessingParameterEnum::asPythonString( const QgsProcessing::PythonO return QString(); } +QString QgsProcessingParameterEnum::getUserFriendlyValue( QVariant paramValue ) const +{ + return options().at( paramValue.toInt() ); +} + QStringList QgsProcessingParameterEnum::options() const { return mOptions; @@ -7729,6 +7858,12 @@ bool QgsProcessingParameterDistance::fromVariantMap( const QVariantMap &map ) } +QString QgsProcessingParameterDistance::getUserFriendlyValue( QVariant paramValue ) const +{ + return QStringLiteral( "%1 %2" ).arg( paramValue.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); +} + + // // QgsProcessingParameterArea diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index 00309f66d81..ecd9c009435 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -466,6 +466,12 @@ class CORE_EXPORT QgsProcessingParameterDefinition */ virtual QColor getColor() const; + /** + * Get a user friendly string representation of the provided parameter value. + * (Meant to be override by child classes to adapt to specific param types) + */ + virtual QString getUserFriendlyValue( QVariant paramValue ) const; + /** * Creates a clone of the parameter definition. */ @@ -1828,6 +1834,11 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin */ QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + /** + * Get a user friendly string representation of the provided parameter value. + */ + QString getUserFriendlyValue( QVariant paramValue ) const override; + /** * Returns the type name for the parameter class. */ @@ -2419,6 +2430,8 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter */ QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QString getUserFriendlyValue( QVariant paramValue ) const override; + QgsProcessingParameterDistance *clone() const override SIP_FACTORY; QString type() const override; @@ -2864,6 +2877,11 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi */ QColor getColor() const override { return QColor( 128, 68, 201 ); /* purple */ }; + /** + * Get a user friendly string representation of the provided parameter value. + */ + QString getUserFriendlyValue( QVariant paramValue ) const override; + /** * Returns the type name for the parameter class. */ diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 7f4f6a62c06..c2ff9ce065f 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -857,9 +857,9 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const { QVariant paramValue = paramDef->defaultValue(); - if ( paramValue.isValid() && !paramValue.toString().isEmpty() ) + if ( paramValue.isValid() ) { - text += ": " + paramValue.toString(); + text += ": " + paramDef->getUserFriendlyValue( paramValue ); } } @@ -1315,14 +1315,7 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind case Qgis::ProcessingModelChildParameterSource::StaticValue: default: QVariant paramValue = paramSources[0].staticValue(); - paramValueAsStr = QStringLiteral( ": %1" ).arg( paramValue.toString() ); - - // In case of an enum, we want to display the label of the enum value (and not just its index as an int) - if ( param->type() == QgsProcessingParameterEnum::typeName() ) - { - const QgsProcessingParameterEnum *paramAsEnumParam = dynamic_cast( param ); - paramValueAsStr = QStringLiteral( ": %1" ).arg( paramAsEnumParam->options().at( paramValue.toInt() ) ); - } + paramValueAsStr = QStringLiteral( ": %1" ).arg( param->getUserFriendlyValue( paramValue ) ); } title += paramValueAsStr; } From 620db939b8d20176d7e680141ff49daf1be95bee Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Fri, 23 May 2025 16:34:56 +0200 Subject: [PATCH 20/42] Update color groups --- .../auto_additions/qgsprocessingoutputs.py | 4 +- .../processing/qgsprocessingoutputs.sip.in | 12 +++--- .../auto_additions/qgsprocessingoutputs.py | 4 +- .../processing/qgsprocessingoutputs.sip.in | 12 +++--- src/core/processing/qgsprocessingoutputs.cpp | 19 ++++----- src/core/processing/qgsprocessingoutputs.h | 10 ++--- src/core/processing/qgsprocessingparameters.h | 40 +++++++++---------- 7 files changed, 51 insertions(+), 50 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py index 3c94b6543aa..cfc5f5a345f 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py @@ -1,7 +1,7 @@ # The following has been generated automatically from src/core/processing/qgsprocessingoutputs.h try: QgsProcessingOutputMapLayer.typeName = staticmethod(QgsProcessingOutputMapLayer.typeName) - QgsProcessingOutputMapLayer.__overridden_methods__ = ['type'] + QgsProcessingOutputMapLayer.__overridden_methods__ = ['getColor', 'type'] QgsProcessingOutputMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -37,7 +37,7 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputVariant.typeName) - QgsProcessingOutputVariant.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputVariant.__overridden_methods__ = ['type', 'valueAsString'] QgsProcessingOutputVariant.__group__ = ['processing'] except (NameError, AttributeError): pass diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in index fb9d9aa96f4..7effbc85743 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -192,6 +192,12 @@ raster), use :py:class:`QgsProcessingOutputVectorLayer` or QgsProcessingOutputMapLayer( const QString &name, const QString &description = QString() ); %Docstring Constructor for QgsProcessingOutputMapLayer. +%End + + virtual QColor getColor() const; + +%Docstring +A color to represent a map layer ouput %End static QString typeName(); @@ -397,12 +403,6 @@ Constructor for QgsProcessingOutputVariant. static QString typeName(); %Docstring Returns the type name for the output class. -%End - - virtual QColor getColor() const; - -%Docstring -A color to represent a range parameter %End virtual QString type() const; diff --git a/python/core/auto_additions/qgsprocessingoutputs.py b/python/core/auto_additions/qgsprocessingoutputs.py index 3c94b6543aa..cfc5f5a345f 100644 --- a/python/core/auto_additions/qgsprocessingoutputs.py +++ b/python/core/auto_additions/qgsprocessingoutputs.py @@ -1,7 +1,7 @@ # The following has been generated automatically from src/core/processing/qgsprocessingoutputs.h try: QgsProcessingOutputMapLayer.typeName = staticmethod(QgsProcessingOutputMapLayer.typeName) - QgsProcessingOutputMapLayer.__overridden_methods__ = ['type'] + QgsProcessingOutputMapLayer.__overridden_methods__ = ['getColor', 'type'] QgsProcessingOutputMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -37,7 +37,7 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputVariant.typeName = staticmethod(QgsProcessingOutputVariant.typeName) - QgsProcessingOutputVariant.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputVariant.__overridden_methods__ = ['type', 'valueAsString'] QgsProcessingOutputVariant.__group__ = ['processing'] except (NameError, AttributeError): pass diff --git a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in index fb9d9aa96f4..7effbc85743 100644 --- a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -192,6 +192,12 @@ raster), use :py:class:`QgsProcessingOutputVectorLayer` or QgsProcessingOutputMapLayer( const QString &name, const QString &description = QString() ); %Docstring Constructor for QgsProcessingOutputMapLayer. +%End + + virtual QColor getColor() const; + +%Docstring +A color to represent a map layer ouput %End static QString typeName(); @@ -397,12 +403,6 @@ Constructor for QgsProcessingOutputVariant. static QString typeName(); %Docstring Returns the type name for the output class. -%End - - virtual QColor getColor() const; - -%Docstring -A color to represent a range parameter %End virtual QString type() const; diff --git a/src/core/processing/qgsprocessingoutputs.cpp b/src/core/processing/qgsprocessingoutputs.cpp index bd3c2ef0a1a..3ac4cda3999 100644 --- a/src/core/processing/qgsprocessingoutputs.cpp +++ b/src/core/processing/qgsprocessingoutputs.cpp @@ -70,7 +70,7 @@ void QgsProcessingOutputVectorLayer::setDataType( Qgis::ProcessingSourceType typ QColor QgsProcessingOutputVectorLayer::getColor() const { - return QColor( 180, 180, 0 ); /* greenish yellow */ + return QColor( 122, 0, 47 ); /* burgundy */ } QgsProcessingOutputRasterLayer::QgsProcessingOutputRasterLayer( const QString &name, const QString &description ) @@ -92,7 +92,7 @@ QgsProcessingOutputVectorTileLayer::QgsProcessingOutputVectorTileLayer( const QS QColor QgsProcessingOutputVectorTileLayer::getColor() const { - return QColor( 180, 180, 0 ); /* greenish yellow */ + return QColor( 137, 150, 171 ); /* cold gray */ } QgsProcessingOutputHtml::QgsProcessingOutputHtml( const QString &name, const QString &description ) @@ -112,7 +112,7 @@ QString QgsProcessingOutputHtml::valueAsFormattedString( const QVariant &value, QColor QgsProcessingOutputHtml::getColor() const { - return QColor( 100, 100, 255 ); /* slate blueish */ + return QColor( 120, 100, 255 ); /* lavender blue */ } QgsProcessingOutputNumber::QgsProcessingOutputNumber( const QString &name, const QString &description ) @@ -148,7 +148,7 @@ QgsProcessingOutputString::QgsProcessingOutputString( const QString &name, const QColor QgsProcessingOutputString::getColor() const { - return QColor( 100, 100, 255 ); /* slate blueish */ + return QColor( 120, 100, 255 ); /* lavender blue */ } QgsProcessingOutputBoolean::QgsProcessingOutputBoolean( const QString &name, const QString &description ) @@ -220,6 +220,11 @@ QString QgsProcessingOutputMapLayer::type() const return typeName(); } +QColor QgsProcessingOutputMapLayer::getColor() const +{ + return QColor( 137, 150, 171 ); /* cold gray */ +} + QgsProcessingOutputMultipleLayers::QgsProcessingOutputMultipleLayers( const QString &name, const QString &description ) : QgsProcessingOutputDefinition( name, description ) {} @@ -262,7 +267,7 @@ QString QgsProcessingOutputMultipleLayers::valueAsString( const QVariant &value, QColor QgsProcessingOutputMultipleLayers::getColor() const { - return QColor( 237, 142, 0 ); /* orange */ + return QColor( 137, 150, 171 ); /* cold gray */ } QgsProcessingOutputConditionalBranch::QgsProcessingOutputConditionalBranch( const QString &name, const QString &description ) @@ -322,7 +327,3 @@ QString QgsProcessingOutputVariant::valueAsString( const QVariant &value, QgsPro return QgsProcessingOutputDefinition::valueAsString( value, context, ok ); } -QColor QgsProcessingOutputVariant::getColor() const -{ - return QColor( 34, 157, 214 ); /* blue */ -} diff --git a/src/core/processing/qgsprocessingoutputs.h b/src/core/processing/qgsprocessingoutputs.h index d0bb1aa3218..1a33bacc234 100644 --- a/src/core/processing/qgsprocessingoutputs.h +++ b/src/core/processing/qgsprocessingoutputs.h @@ -201,6 +201,11 @@ class CORE_EXPORT QgsProcessingOutputMapLayer : public QgsProcessingOutputDefini */ QgsProcessingOutputMapLayer( const QString &name, const QString &description = QString() ); + /** + * A color to represent a map layer ouput + */ + QColor getColor() const override; + /** * Returns the type name for the output class. */ @@ -382,11 +387,6 @@ class CORE_EXPORT QgsProcessingOutputVariant : public QgsProcessingOutputDefinit */ static QString typeName() { return QStringLiteral( "outputVariant" ); } - /** - * A color to represent a range parameter - */ - QColor getColor() const override; - QString type() const override; QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override; diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index ecd9c009435..dfa0e536656 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -1832,7 +1832,7 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin /** * A color to represent a crs parameter */ - QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + QColor getColor() const override { return QColor( 120, 100, 255 ); /* lavender blue */ }; /** * Get a user friendly string representation of the provided parameter value. @@ -1875,7 +1875,7 @@ class CORE_EXPORT QgsProcessingParameterExtent : public QgsProcessingParameterDe /** * A color to represent an extent parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; /** * Returns the type name for the parameter class. @@ -1923,7 +1923,7 @@ class CORE_EXPORT QgsProcessingParameterPoint : public QgsProcessingParameterDef /** * A color to represent a point parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** @@ -1964,7 +1964,7 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter /** * A color to represent a geometry parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** * Returns the type name for the parameter class. @@ -2228,7 +2228,7 @@ class CORE_EXPORT QgsProcessingParameterMultipleLayers : public QgsProcessingPar /** * A color to represent a multiple layer parameter */ - QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -2875,7 +2875,7 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi /** * A color to represent an enum parameter */ - QColor getColor() const override { return QColor( 128, 68, 201 ); /* purple */ }; + QColor getColor() const override { return QColor( 152, 68, 201 ); /* purple */ }; /** * Get a user friendly string representation of the provided parameter value. @@ -2989,7 +2989,7 @@ class CORE_EXPORT QgsProcessingParameterString : public QgsProcessingParameterDe /** * A color to represent a string parameter */ - QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + QColor getColor() const override { return QColor( 120, 100, 255 ); /* lavender blue */ }; /** * Returns the type name for the parameter class. @@ -3085,7 +3085,7 @@ class CORE_EXPORT QgsProcessingParameterExpression : public QgsProcessingParamet /** * A color to represent an expression parameter */ - QColor getColor() const override { return QColor( 176, 76, 158 ); /* dark pink */ }; + QColor getColor() const override { return QColor( 120, 100, 255 ); /* lavender blue */ }; /** * Returns the type name for the parameter class. @@ -3195,7 +3195,7 @@ class CORE_EXPORT QgsProcessingParameterVectorLayer : public QgsProcessingParame /** * A color to represent a vector layer parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** @@ -3242,7 +3242,7 @@ class CORE_EXPORT QgsProcessingParameterMeshLayer : public QgsProcessingParamete /** * A color to represent a mesh layer parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -3281,7 +3281,7 @@ class CORE_EXPORT QgsProcessingParameterMapLayer : public QgsProcessingParameter /** * A color to represent a map layer parameter */ - QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -3433,7 +3433,7 @@ class CORE_EXPORT QgsProcessingParameterFeatureSource : public QgsProcessingPara /** * A color to represent a feature source parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** * Returns the type name for the parameter class. @@ -3602,7 +3602,7 @@ class CORE_EXPORT QgsProcessingParameterFeatureSink : public QgsProcessingDestin /** * A color to represent a feature sink parameter */ - QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** * Returns the type name for the parameter class. @@ -3704,7 +3704,7 @@ class CORE_EXPORT QgsProcessingParameterVectorDestination : public QgsProcessing /** * A color to represent a vector destination parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** * Returns the type name for the parameter class. @@ -3783,7 +3783,7 @@ class CORE_EXPORT QgsProcessingParameterRasterDestination : public QgsProcessing /** * A color to represent a raster destination parameter */ - QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; /** * Returns the type name for the parameter class. @@ -4362,7 +4362,7 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter /** * A color to represent a datetime parameter */ - QColor getColor() const override { return QColor( 100, 100, 255 ); /* slate blueish */ }; + QColor getColor() const override { return QColor( 120, 100, 255 ); /* lavender blue */ }; /** * Returns the type name for the parameter class. @@ -4686,7 +4686,7 @@ class CORE_EXPORT QgsProcessingParameterPointCloudLayer : public QgsProcessingPa /** * A color to represent a point cloud layer parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -4726,7 +4726,7 @@ class CORE_EXPORT QgsProcessingParameterAnnotationLayer : public QgsProcessingPa /** * A color to represent an annotation layer parameter */ - QColor getColor() const override { return QColor( 237, 142, 0 ); /* orange */ }; + QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -4770,7 +4770,7 @@ class CORE_EXPORT QgsProcessingParameterPointCloudDestination : public QgsProces /** * A color to represent a point cloud destination parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -4911,7 +4911,7 @@ class CORE_EXPORT QgsProcessingParameterVectorTileDestination : public QgsProces /** * A color to represent a vector tile destination parameter */ - QColor getColor() const override { return QColor( 180, 180, 0 ); /* greenish yellow */ }; + QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. From 5a121ceb959092309c2b466d821abc4dde50982d Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Mon, 26 May 2025 14:32:37 +0200 Subject: [PATCH 21/42] gradient along path when type is fluid --- src/gui/processing/models/qgsmodelarrowitem.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index 419b57c1615..8a96ae8cec2 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -121,10 +121,20 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem // Set the painter back to regular stroke thickness p = pen(); - p.setColor( color ); + QColor endColor = mEndItem->getLinkColor( mEndEdge, mEndIndex ); + color.setAlpha( 255 ); + + QLinearGradient gradient; + QPointF startPoint = path().pointAtPercent( 0.0 ); + QPointF endPoint = path().pointAtPercent( 1.0 ); + gradient.setStart( startPoint ); + gradient.setFinalStop( endPoint ); + gradient.setColorAt( 0, color ); + gradient.setColorAt( 1, endColor ); + + p.setBrush( QBrush( gradient ) ); p.setWidth( 2 ); painter->setPen( p ); - painter->drawPath( path() ); } From a44563fd4df675be968cb899b559ab6d58a54db6 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Mon, 26 May 2025 15:22:03 +0200 Subject: [PATCH 22/42] shorter gradient --- src/core/processing/qgsprocessingoutputs.cpp | 4 ++-- src/core/processing/qgsprocessingparameters.h | 8 ++++---- src/gui/processing/models/qgsmodelarrowitem.cpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/processing/qgsprocessingoutputs.cpp b/src/core/processing/qgsprocessingoutputs.cpp index 3ac4cda3999..949763588c6 100644 --- a/src/core/processing/qgsprocessingoutputs.cpp +++ b/src/core/processing/qgsprocessingoutputs.cpp @@ -112,7 +112,7 @@ QString QgsProcessingOutputHtml::valueAsFormattedString( const QVariant &value, QColor QgsProcessingOutputHtml::getColor() const { - return QColor( 120, 100, 255 ); /* lavender blue */ + return QColor( 255, 131, 23 ); /* orange */ } QgsProcessingOutputNumber::QgsProcessingOutputNumber( const QString &name, const QString &description ) @@ -148,7 +148,7 @@ QgsProcessingOutputString::QgsProcessingOutputString( const QString &name, const QColor QgsProcessingOutputString::getColor() const { - return QColor( 120, 100, 255 ); /* lavender blue */ + return QColor( 255, 131, 23 ); /* orange */ } QgsProcessingOutputBoolean::QgsProcessingOutputBoolean( const QString &name, const QString &description ) diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index dfa0e536656..0eeb4f65d45 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -1832,7 +1832,7 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin /** * A color to represent a crs parameter */ - QColor getColor() const override { return QColor( 120, 100, 255 ); /* lavender blue */ }; + QColor getColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; /** * Get a user friendly string representation of the provided parameter value. @@ -2989,7 +2989,7 @@ class CORE_EXPORT QgsProcessingParameterString : public QgsProcessingParameterDe /** * A color to represent a string parameter */ - QColor getColor() const override { return QColor( 120, 100, 255 ); /* lavender blue */ }; + QColor getColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; /** * Returns the type name for the parameter class. @@ -3085,7 +3085,7 @@ class CORE_EXPORT QgsProcessingParameterExpression : public QgsProcessingParamet /** * A color to represent an expression parameter */ - QColor getColor() const override { return QColor( 120, 100, 255 ); /* lavender blue */ }; + QColor getColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; /** * Returns the type name for the parameter class. @@ -4362,7 +4362,7 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter /** * A color to represent a datetime parameter */ - QColor getColor() const override { return QColor( 120, 100, 255 ); /* lavender blue */ }; + QColor getColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; /** * Returns the type name for the parameter class. diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index 8a96ae8cec2..69901edfa31 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -125,8 +125,8 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem color.setAlpha( 255 ); QLinearGradient gradient; - QPointF startPoint = path().pointAtPercent( 0.0 ); - QPointF endPoint = path().pointAtPercent( 1.0 ); + QPointF startPoint = path().pointAtPercent( 0.3 ); + QPointF endPoint = path().pointAtPercent( 0.7 ); gradient.setStart( startPoint ); gradient.setFinalStop( endPoint ); gradient.setColorAt( 0, color ); From 8a8c0f45014ef116a2059c7eea29167121e756c5 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Mon, 26 May 2025 16:54:50 +0200 Subject: [PATCH 23/42] make fields shorter --- .../models/qgsprocessingmodelchildparametersource.cpp | 4 ++-- src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp b/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp index e6c962ad4a0..085c516887d 100644 --- a/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp +++ b/src/core/processing/models/qgsprocessingmodelchildparametersource.cpp @@ -255,11 +255,11 @@ QString QgsProcessingModelChildParameterSource::friendlyIdentifier( QgsProcessin break; } } - return QObject::tr( "'%1' from algorithm '%2'" ).arg( outputName, alg.description() ); + return QObject::tr( "<%1>" ).arg( alg.description() ); } else { - return QObject::tr( "'%1' from algorithm '%2'" ).arg( mOutputName, mChildId ); + return QObject::tr( "<%1>" ).arg( mChildId ); } } diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index c2ff9ce065f..5b1363637af 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -1302,13 +1302,14 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind break; case Qgis::ProcessingModelChildParameterSource::ModelOutput: - paramValueAsStr = QStringLiteral( ": output from '%1'" ).arg( firstParamSource.friendlyIdentifier( const_cast( model() ) ) ); + paramValueAsStr = QStringLiteral( ": <%1>" ).arg( firstParamSource.friendlyIdentifier( const_cast( model() ) ) ); break; case Qgis::ProcessingModelChildParameterSource::ModelParameter: { QString friendlyName = firstParamSource.friendlyIdentifier( const_cast( model() ) ); - paramValueAsStr = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": value from '%1'" ).arg( friendlyName ); + // paramValueAsStr = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": value from '%1'" ).arg( friendlyName ); + paramValueAsStr = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": <%1>" ).arg( friendlyName ); break; } From 7ba380c8513e2db4396e6b76dd24864fd14671ef Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Fri, 13 Jun 2025 13:12:27 +0200 Subject: [PATCH 24/42] apply fixes --- .../auto_additions/qgsprocessingoutputs.py | 24 +-- .../auto_additions/qgsprocessingparameters.py | 66 +++---- .../processing/qgsprocessingoutputs.sip.in | 61 ++----- .../processing/qgsprocessingparameters.sip.in | 162 ++++-------------- .../auto_additions/qgsprocessingoutputs.py | 24 +-- .../auto_additions/qgsprocessingparameters.py | 66 +++---- .../processing/qgsprocessingoutputs.sip.in | 61 ++----- .../processing/qgsprocessingparameters.sip.in | 162 ++++-------------- src/core/processing/qgsprocessingoutputs.cpp | 24 +-- src/core/processing/qgsprocessingoutputs.h | 63 ++----- .../processing/qgsprocessingparameters.cpp | 2 +- src/core/processing/qgsprocessingparameters.h | 162 ++++-------------- .../models/qgsmodelcomponentgraphicitem.cpp | 6 +- 13 files changed, 251 insertions(+), 632 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py index cfc5f5a345f..57dedfd5741 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingoutputs.py @@ -1,19 +1,19 @@ # The following has been generated automatically from src/core/processing/qgsprocessingoutputs.h try: QgsProcessingOutputMapLayer.typeName = staticmethod(QgsProcessingOutputMapLayer.typeName) - QgsProcessingOutputMapLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputMapLayer.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName) - QgsProcessingOutputVectorLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputVectorLayer.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName) - QgsProcessingOutputRasterLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputRasterLayer.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -25,13 +25,13 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName) - QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'getColor', 'valueAsString'] + QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'modelColor', 'valueAsString'] QgsProcessingOutputMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName) - QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString'] + QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString'] QgsProcessingOutputHtml.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -43,31 +43,31 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName) - QgsProcessingOutputNumber.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputNumber.__overridden_methods__ = ['modelColor', 'type', 'valueAsString'] QgsProcessingOutputNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName) - QgsProcessingOutputString.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputString.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputString.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName) - QgsProcessingOutputBoolean.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputBoolean.__overridden_methods__ = ['modelColor', 'type', 'valueAsString'] QgsProcessingOutputBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName) - QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString'] + QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString'] QgsProcessingOutputFolder.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName) - QgsProcessingOutputFile.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString'] + QgsProcessingOutputFile.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString'] QgsProcessingOutputFile.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -79,12 +79,12 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName) - QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputDefinition.__virtual_methods__ = ['getColor', 'valueAsString', 'valueAsFormattedString'] + QgsProcessingOutputDefinition.__virtual_methods__ = ['modelColor', 'valueAsString', 'valueAsFormattedString'] QgsProcessingOutputDefinition.__abstract_methods__ = ['type'] QgsProcessingOutputDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py index 8341fd68105..fe4389e4dd3 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['modelColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['modelColor', 'clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,12 +378,12 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingParameterDefinition.__virtual_methods__ = ['getColor', 'getUserFriendlyValue', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] + QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'getUserFriendlyValue', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type'] QgsProcessingParameterDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 7effbc85743..218046cdb53 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -65,9 +65,11 @@ Constructor for QgsProcessingOutputDefinition. virtual ~QgsProcessingOutputDefinition(); - virtual QColor getColor() const; + virtual QColor modelColor() const; %Docstring -A fallback color to represent a processing output +Returns the color to use for the output in model designer windows. + +.. versionadded:: 3.44 %End virtual QString type() const = 0; @@ -194,11 +196,8 @@ raster), use :py:class:`QgsProcessingOutputVectorLayer` or Constructor for QgsProcessingOutputMapLayer. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a map layer ouput -%End static QString typeName(); %Docstring @@ -226,11 +225,8 @@ A vector layer output for processing algorithms. Constructor for QgsProcessingOutputVectorLayer. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a vector layer ouput -%End static QString typeName(); %Docstring @@ -275,11 +271,8 @@ Constructor for QgsProcessingOutputRasterLayer. Returns the type name for the output class. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a raster layer output -%End virtual QString type() const; }; @@ -340,11 +333,8 @@ Returns the type name for the output class. virtual QString type() const; - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a multiple layer output -%End virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const; }; @@ -371,11 +361,8 @@ Returns the type name for the output class. %End virtual QString type() const; - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent an HTML output -%End virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const; }; @@ -428,11 +415,8 @@ A numeric output for processing algorithms. Constructor for QgsProcessingOutputNumber. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a number output -%End static QString typeName(); %Docstring @@ -465,11 +449,8 @@ Constructor for QgsProcessingOutputString. Returns the type name for the output class. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a string output -%End virtual QString type() const; }; @@ -491,11 +472,8 @@ A boolean output for processing algorithms. Constructor for :py:class:`QgsProcessingOutputNumber`. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a boolean output -%End static QString typeName(); %Docstring @@ -529,11 +507,8 @@ Returns the type name for the output class. %End virtual QString type() const; - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a folder output -%End virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const; }; @@ -560,11 +535,8 @@ Returns the type name for the output class. %End virtual QString type() const; - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a file output -%End virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const; }; @@ -618,11 +590,8 @@ Constructor for QgsProcessingOutputVectorTileLayer. Returns the type name for the output class. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a vector tile layer output -%End virtual QString type() const; }; diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index e7ca6b693a7..80e18fc11a1 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -364,7 +364,7 @@ Constructor for QgsProcessingParameterDefinition. virtual ~QgsProcessingParameterDefinition(); - virtual QColor getColor() const; + virtual QColor modelColor() const; %Docstring A color to represent the default parameter %End @@ -1897,10 +1897,7 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End - virtual QColor getColor() const; -%Docstring -A color to represent a boolean parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1936,10 +1933,7 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QColor getColor() const; -%Docstring -A color to represent a crs parameter -%End + virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring @@ -1987,10 +1981,7 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End - virtual QColor getColor() const; -%Docstring -A color to represent an extent parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2032,10 +2023,7 @@ A point parameter for processing algorithms. Constructor for QgsProcessingParameterPoint. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring @@ -2079,10 +2067,7 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End - virtual QColor getColor() const; -%Docstring -A color to represent a geometry parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2165,10 +2150,7 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End - virtual QColor getColor() const; -%Docstring -A color to represent a file parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2287,10 +2269,7 @@ Constructor for QgsProcessingParameterMatrix. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a mtrix parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2385,10 +2364,7 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End - virtual QColor getColor() const; -%Docstring -A color to represent a multiple layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2492,10 +2468,7 @@ Constructor for QgsProcessingParameterNumber. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a number parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2604,10 +2577,7 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a color parameter -%End + virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; @@ -2872,10 +2842,7 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a duration parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDuration *clone() const /Factory/; @@ -2934,10 +2901,7 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a scale parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterScale *clone() const /Factory/; @@ -2977,10 +2941,7 @@ Constructor for QgsProcessingParameterRange. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a range parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -3034,10 +2995,7 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a raster layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3096,10 +3054,7 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QColor getColor() const; -%Docstring -A color to represent an enum parameter -%End + virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring @@ -3225,10 +3180,7 @@ accordingly.) Constructor for QgsProcessingParameterString. %End - virtual QColor getColor() const; -%Docstring -A color to represent a string parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3332,10 +3284,7 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End - virtual QColor getColor() const; -%Docstring -A color to represent an expression parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3457,10 +3406,7 @@ Consider using the more versatile Constructor for QgsProcessingParameterVectorLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring @@ -3515,10 +3461,7 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a mesh layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3561,10 +3504,7 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a map layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3745,10 +3685,7 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End - virtual QColor getColor() const; -%Docstring -A color to represent a feature source parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3925,10 +3862,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a feature sink parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4050,10 +3984,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4143,10 +4074,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a raster destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4220,10 +4148,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a file destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4294,10 +4219,7 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End - virtual QColor getColor() const; -%Docstring -A color to represent a folder destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4570,10 +4492,7 @@ varying color opacity. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a color parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -4830,10 +4749,7 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End - virtual QColor getColor() const; -%Docstring -A color to represent a datetime parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5213,10 +5129,7 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point cloud layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5261,10 +5174,7 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent an annotation layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5312,10 +5222,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point cloud destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5481,10 +5388,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector tile destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/python/core/auto_additions/qgsprocessingoutputs.py b/python/core/auto_additions/qgsprocessingoutputs.py index cfc5f5a345f..57dedfd5741 100644 --- a/python/core/auto_additions/qgsprocessingoutputs.py +++ b/python/core/auto_additions/qgsprocessingoutputs.py @@ -1,19 +1,19 @@ # The following has been generated automatically from src/core/processing/qgsprocessingoutputs.h try: QgsProcessingOutputMapLayer.typeName = staticmethod(QgsProcessingOutputMapLayer.typeName) - QgsProcessingOutputMapLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputMapLayer.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputVectorLayer.typeName = staticmethod(QgsProcessingOutputVectorLayer.typeName) - QgsProcessingOutputVectorLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputVectorLayer.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputRasterLayer.typeName = staticmethod(QgsProcessingOutputRasterLayer.typeName) - QgsProcessingOutputRasterLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputRasterLayer.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -25,13 +25,13 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputMultipleLayers.typeName = staticmethod(QgsProcessingOutputMultipleLayers.typeName) - QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'getColor', 'valueAsString'] + QgsProcessingOutputMultipleLayers.__overridden_methods__ = ['type', 'modelColor', 'valueAsString'] QgsProcessingOutputMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputHtml.typeName = staticmethod(QgsProcessingOutputHtml.typeName) - QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString'] + QgsProcessingOutputHtml.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString'] QgsProcessingOutputHtml.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -43,31 +43,31 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputNumber.typeName = staticmethod(QgsProcessingOutputNumber.typeName) - QgsProcessingOutputNumber.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputNumber.__overridden_methods__ = ['modelColor', 'type', 'valueAsString'] QgsProcessingOutputNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputString.typeName = staticmethod(QgsProcessingOutputString.typeName) - QgsProcessingOutputString.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputString.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputString.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputBoolean.typeName = staticmethod(QgsProcessingOutputBoolean.typeName) - QgsProcessingOutputBoolean.__overridden_methods__ = ['getColor', 'type', 'valueAsString'] + QgsProcessingOutputBoolean.__overridden_methods__ = ['modelColor', 'type', 'valueAsString'] QgsProcessingOutputBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputFolder.typeName = staticmethod(QgsProcessingOutputFolder.typeName) - QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString'] + QgsProcessingOutputFolder.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString'] QgsProcessingOutputFolder.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingOutputFile.typeName = staticmethod(QgsProcessingOutputFile.typeName) - QgsProcessingOutputFile.__overridden_methods__ = ['type', 'getColor', 'valueAsFormattedString'] + QgsProcessingOutputFile.__overridden_methods__ = ['type', 'modelColor', 'valueAsFormattedString'] QgsProcessingOutputFile.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -79,12 +79,12 @@ except (NameError, AttributeError): pass try: QgsProcessingOutputVectorTileLayer.typeName = staticmethod(QgsProcessingOutputVectorTileLayer.typeName) - QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['getColor', 'type'] + QgsProcessingOutputVectorTileLayer.__overridden_methods__ = ['modelColor', 'type'] QgsProcessingOutputVectorTileLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingOutputDefinition.__virtual_methods__ = ['getColor', 'valueAsString', 'valueAsFormattedString'] + QgsProcessingOutputDefinition.__virtual_methods__ = ['modelColor', 'valueAsString', 'valueAsFormattedString'] QgsProcessingOutputDefinition.__abstract_methods__ = ['type'] QgsProcessingOutputDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/core/auto_additions/qgsprocessingparameters.py b/python/core/auto_additions/qgsprocessingparameters.py index 8341fd68105..fe4389e4dd3 100644 --- a/python/core/auto_additions/qgsprocessingparameters.py +++ b/python/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['modelColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['getColor', 'clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['modelColor', 'clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['getColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['getColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,12 +378,12 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['getColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: - QgsProcessingParameterDefinition.__virtual_methods__ = ['getColor', 'getUserFriendlyValue', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] + QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'getUserFriendlyValue', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type'] QgsProcessingParameterDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 7effbc85743..218046cdb53 100644 --- a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -65,9 +65,11 @@ Constructor for QgsProcessingOutputDefinition. virtual ~QgsProcessingOutputDefinition(); - virtual QColor getColor() const; + virtual QColor modelColor() const; %Docstring -A fallback color to represent a processing output +Returns the color to use for the output in model designer windows. + +.. versionadded:: 3.44 %End virtual QString type() const = 0; @@ -194,11 +196,8 @@ raster), use :py:class:`QgsProcessingOutputVectorLayer` or Constructor for QgsProcessingOutputMapLayer. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a map layer ouput -%End static QString typeName(); %Docstring @@ -226,11 +225,8 @@ A vector layer output for processing algorithms. Constructor for QgsProcessingOutputVectorLayer. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a vector layer ouput -%End static QString typeName(); %Docstring @@ -275,11 +271,8 @@ Constructor for QgsProcessingOutputRasterLayer. Returns the type name for the output class. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a raster layer output -%End virtual QString type() const; }; @@ -340,11 +333,8 @@ Returns the type name for the output class. virtual QString type() const; - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a multiple layer output -%End virtual QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const; }; @@ -371,11 +361,8 @@ Returns the type name for the output class. %End virtual QString type() const; - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent an HTML output -%End virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const; }; @@ -428,11 +415,8 @@ A numeric output for processing algorithms. Constructor for QgsProcessingOutputNumber. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a number output -%End static QString typeName(); %Docstring @@ -465,11 +449,8 @@ Constructor for QgsProcessingOutputString. Returns the type name for the output class. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a string output -%End virtual QString type() const; }; @@ -491,11 +472,8 @@ A boolean output for processing algorithms. Constructor for :py:class:`QgsProcessingOutputNumber`. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a boolean output -%End static QString typeName(); %Docstring @@ -529,11 +507,8 @@ Returns the type name for the output class. %End virtual QString type() const; - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a folder output -%End virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const; }; @@ -560,11 +535,8 @@ Returns the type name for the output class. %End virtual QString type() const; - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a file output -%End virtual QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok /Out/ ) const; }; @@ -618,11 +590,8 @@ Constructor for QgsProcessingOutputVectorTileLayer. Returns the type name for the output class. %End - virtual QColor getColor() const; + virtual QColor modelColor() const; -%Docstring -A color to represent a vector tile layer output -%End virtual QString type() const; }; diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 0014b092103..3295ba0b057 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -364,7 +364,7 @@ Constructor for QgsProcessingParameterDefinition. virtual ~QgsProcessingParameterDefinition(); - virtual QColor getColor() const; + virtual QColor modelColor() const; %Docstring A color to represent the default parameter %End @@ -1897,10 +1897,7 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End - virtual QColor getColor() const; -%Docstring -A color to represent a boolean parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1936,10 +1933,7 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QColor getColor() const; -%Docstring -A color to represent a crs parameter -%End + virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring @@ -1987,10 +1981,7 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End - virtual QColor getColor() const; -%Docstring -A color to represent an extent parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2032,10 +2023,7 @@ A point parameter for processing algorithms. Constructor for QgsProcessingParameterPoint. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring @@ -2079,10 +2067,7 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End - virtual QColor getColor() const; -%Docstring -A color to represent a geometry parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2165,10 +2150,7 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End - virtual QColor getColor() const; -%Docstring -A color to represent a file parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2287,10 +2269,7 @@ Constructor for QgsProcessingParameterMatrix. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a mtrix parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2385,10 +2364,7 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End - virtual QColor getColor() const; -%Docstring -A color to represent a multiple layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2492,10 +2468,7 @@ Constructor for QgsProcessingParameterNumber. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a number parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2604,10 +2577,7 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a color parameter -%End + virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; @@ -2872,10 +2842,7 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a duration parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDuration *clone() const /Factory/; @@ -2934,10 +2901,7 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a scale parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterScale *clone() const /Factory/; @@ -2977,10 +2941,7 @@ Constructor for QgsProcessingParameterRange. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a range parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -3034,10 +2995,7 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a raster layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3096,10 +3054,7 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QColor getColor() const; -%Docstring -A color to represent an enum parameter -%End + virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring @@ -3225,10 +3180,7 @@ accordingly.) Constructor for QgsProcessingParameterString. %End - virtual QColor getColor() const; -%Docstring -A color to represent a string parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3332,10 +3284,7 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End - virtual QColor getColor() const; -%Docstring -A color to represent an expression parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3457,10 +3406,7 @@ Consider using the more versatile Constructor for QgsProcessingParameterVectorLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring @@ -3515,10 +3461,7 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a mesh layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3561,10 +3504,7 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a map layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3745,10 +3685,7 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End - virtual QColor getColor() const; -%Docstring -A color to represent a feature source parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3925,10 +3862,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a feature sink parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4050,10 +3984,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4143,10 +4074,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a raster destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4220,10 +4148,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a file destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4294,10 +4219,7 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End - virtual QColor getColor() const; -%Docstring -A color to represent a folder destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4570,10 +4492,7 @@ varying color opacity. Returns the type name for the parameter class. %End - virtual QColor getColor() const; -%Docstring -A color to represent a color parameter -%End + virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -4830,10 +4749,7 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End - virtual QColor getColor() const; -%Docstring -A color to represent a datetime parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5213,10 +5129,7 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point cloud layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5261,10 +5174,7 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End - virtual QColor getColor() const; -%Docstring -A color to represent an annotation layer parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5312,10 +5222,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a point cloud destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5481,10 +5388,7 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor getColor() const; -%Docstring -A color to represent a vector tile destination parameter -%End + virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/src/core/processing/qgsprocessingoutputs.cpp b/src/core/processing/qgsprocessingoutputs.cpp index 949763588c6..a349f1ae299 100644 --- a/src/core/processing/qgsprocessingoutputs.cpp +++ b/src/core/processing/qgsprocessingoutputs.cpp @@ -48,7 +48,7 @@ QString QgsProcessingOutputDefinition::valueAsFormattedString( const QVariant &v return valueAsString( value, context, ok ); } -QColor QgsProcessingOutputDefinition::getColor() const +QColor QgsProcessingOutputDefinition::modelColor() const { return QColor( 128, 128, 128 ); /* mid gray */ } @@ -68,7 +68,7 @@ void QgsProcessingOutputVectorLayer::setDataType( Qgis::ProcessingSourceType typ mDataType = type; } -QColor QgsProcessingOutputVectorLayer::getColor() const +QColor QgsProcessingOutputVectorLayer::modelColor() const { return QColor( 122, 0, 47 ); /* burgundy */ } @@ -77,7 +77,7 @@ QgsProcessingOutputRasterLayer::QgsProcessingOutputRasterLayer( const QString &n : QgsProcessingOutputDefinition( name, description ) {} -QColor QgsProcessingOutputRasterLayer::getColor() const +QColor QgsProcessingOutputRasterLayer::modelColor() const { return QColor( 0, 180, 180 ); /* turquoise */ } @@ -90,7 +90,7 @@ QgsProcessingOutputVectorTileLayer::QgsProcessingOutputVectorTileLayer( const QS : QgsProcessingOutputDefinition( name, description ) {} -QColor QgsProcessingOutputVectorTileLayer::getColor() const +QColor QgsProcessingOutputVectorTileLayer::modelColor() const { return QColor( 137, 150, 171 ); /* cold gray */ } @@ -110,7 +110,7 @@ QString QgsProcessingOutputHtml::valueAsFormattedString( const QVariant &value, return valueAsString( value, context, ok ); } -QColor QgsProcessingOutputHtml::getColor() const +QColor QgsProcessingOutputHtml::modelColor() const { return QColor( 255, 131, 23 ); /* orange */ } @@ -137,7 +137,7 @@ QString QgsProcessingOutputNumber::valueAsString( const QVariant &value, QgsProc return QgsProcessingOutputDefinition::valueAsString( value, context, ok ); } -QColor QgsProcessingOutputNumber::getColor() const +QColor QgsProcessingOutputNumber::modelColor() const { return QColor( 34, 157, 214 ); /* blue */ } @@ -146,7 +146,7 @@ QgsProcessingOutputString::QgsProcessingOutputString( const QString &name, const : QgsProcessingOutputDefinition( name, description ) {} -QColor QgsProcessingOutputString::getColor() const +QColor QgsProcessingOutputString::modelColor() const { return QColor( 255, 131, 23 ); /* orange */ } @@ -166,7 +166,7 @@ QString QgsProcessingOutputBoolean::valueAsString( const QVariant &value, QgsPro return QgsProcessingOutputDefinition::valueAsString( value, context, ok ); } -QColor QgsProcessingOutputBoolean::getColor() const +QColor QgsProcessingOutputBoolean::modelColor() const { return QColor( 51, 201, 28 ); /* green */ } @@ -186,7 +186,7 @@ QString QgsProcessingOutputFolder::valueAsFormattedString( const QVariant &value return valueAsString( value, context, ok ); } -QColor QgsProcessingOutputFolder::getColor() const +QColor QgsProcessingOutputFolder::modelColor() const { return QColor( 80, 80, 80 ); /* dark gray */ } @@ -206,7 +206,7 @@ QString QgsProcessingOutputFile::valueAsFormattedString( const QVariant &value, return valueAsString( value, context, ok ); } -QColor QgsProcessingOutputFile::getColor() const +QColor QgsProcessingOutputFile::modelColor() const { return QColor( 80, 80, 80 ); /* dark gray */ } @@ -220,7 +220,7 @@ QString QgsProcessingOutputMapLayer::type() const return typeName(); } -QColor QgsProcessingOutputMapLayer::getColor() const +QColor QgsProcessingOutputMapLayer::modelColor() const { return QColor( 137, 150, 171 ); /* cold gray */ } @@ -265,7 +265,7 @@ QString QgsProcessingOutputMultipleLayers::valueAsString( const QVariant &value, return QgsProcessingOutputDefinition::valueAsString( value, context, ok ); } -QColor QgsProcessingOutputMultipleLayers::getColor() const +QColor QgsProcessingOutputMultipleLayers::modelColor() const { return QColor( 137, 150, 171 ); /* cold gray */ } diff --git a/src/core/processing/qgsprocessingoutputs.h b/src/core/processing/qgsprocessingoutputs.h index 1a33bacc234..c88ac3ddc06 100644 --- a/src/core/processing/qgsprocessingoutputs.h +++ b/src/core/processing/qgsprocessingoutputs.h @@ -87,9 +87,11 @@ class CORE_EXPORT QgsProcessingOutputDefinition virtual ~QgsProcessingOutputDefinition() = default; /** - * A fallback color to represent a processing output - */ - virtual QColor getColor() const; + * Returns the color to use for the output in model designer windows. + * + * \since QGIS 3.44 + */ + virtual QColor modelColor() const; /** * Unique output type name. @@ -201,10 +203,7 @@ class CORE_EXPORT QgsProcessingOutputMapLayer : public QgsProcessingOutputDefini */ QgsProcessingOutputMapLayer( const QString &name, const QString &description = QString() ); - /** - * A color to represent a map layer ouput - */ - QColor getColor() const override; + QColor modelColor() const override; /** * Returns the type name for the output class. @@ -229,10 +228,7 @@ class CORE_EXPORT QgsProcessingOutputVectorLayer : public QgsProcessingOutputDef */ QgsProcessingOutputVectorLayer( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry ); - /** - * A color to represent a vector layer ouput - */ - QColor getColor() const override; + QColor modelColor() const override; /** * Returns the type name for the output class. @@ -276,10 +272,7 @@ class CORE_EXPORT QgsProcessingOutputRasterLayer : public QgsProcessingOutputDef */ static QString typeName() { return QStringLiteral( "outputRaster" ); } - /** - * A color to represent a raster layer output - */ - QColor getColor() const override; + QColor modelColor() const override; QString type() const override { return typeName(); } }; @@ -332,10 +325,7 @@ class CORE_EXPORT QgsProcessingOutputMultipleLayers : public QgsProcessingOutput static QString typeName() { return QStringLiteral( "outputMultilayer" ); } QString type() const override; - /** - * A color to represent a multiple layer output - */ - QColor getColor() const override; + QColor modelColor() const override; QString valueAsString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override; }; @@ -359,10 +349,7 @@ class CORE_EXPORT QgsProcessingOutputHtml : public QgsProcessingOutputDefinition static QString typeName() { return QStringLiteral( "outputHtml" ); } QString type() const override { return typeName(); } - /** - * A color to represent an HTML output - */ - QColor getColor() const override; + QColor modelColor() const override; QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override; }; @@ -406,10 +393,7 @@ class CORE_EXPORT QgsProcessingOutputNumber : public QgsProcessingOutputDefiniti */ QgsProcessingOutputNumber( const QString &name, const QString &description = QString() ); - /** - * A color to represent a number output - */ - QColor getColor() const override; + QColor modelColor() const override; /** * Returns the type name for the output class. @@ -439,10 +423,7 @@ class CORE_EXPORT QgsProcessingOutputString : public QgsProcessingOutputDefiniti */ static QString typeName() { return QStringLiteral( "outputString" ); } - /** - * A color to represent a string output - */ - QColor getColor() const override; + QColor modelColor() const override; QString type() const override { return typeName(); } }; @@ -461,10 +442,7 @@ class CORE_EXPORT QgsProcessingOutputBoolean : public QgsProcessingOutputDefinit */ QgsProcessingOutputBoolean( const QString &name, const QString &description = QString() ); - /** - * A color to represent a boolean output - */ - QColor getColor() const override ; + QColor modelColor() const override ; /** * Returns the type name for the output class. @@ -495,10 +473,7 @@ class CORE_EXPORT QgsProcessingOutputFolder : public QgsProcessingOutputDefiniti static QString typeName() { return QStringLiteral( "outputFolder" ); } QString type() const override { return typeName(); } - /** - * A color to represent a folder output - */ - QColor getColor() const override; + QColor modelColor() const override; QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override; }; @@ -522,10 +497,7 @@ class CORE_EXPORT QgsProcessingOutputFile : public QgsProcessingOutputDefinition static QString typeName() { return QStringLiteral( "outputFile" ); } QString type() const override { return typeName(); } - /** - * A color to represent a file output - */ - QColor getColor() const override; + QColor modelColor() const override; QString valueAsFormattedString( const QVariant &value, QgsProcessingContext &context, bool &ok SIP_OUT ) const override; }; @@ -572,10 +544,7 @@ class CORE_EXPORT QgsProcessingOutputVectorTileLayer : public QgsProcessingOutpu */ static QString typeName() { return QStringLiteral( "outputVectorTile" ); } - /** - * A color to represent a vector tile layer output - */ - QColor getColor() const override; + QColor modelColor() const override; QString type() const override { return typeName(); } }; diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 7a5678e27fe..62921543bbf 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3021,7 +3021,7 @@ QgsProcessingParameterDefinition *QgsProcessingParameterBoolean::clone() const return new QgsProcessingParameterBoolean( *this ); } -QColor QgsProcessingParameterDefinition::getColor() const +QColor QgsProcessingParameterDefinition::modelColor() const { return QColor( 128, 128, 128 ); /* mid gray */ } diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index 0eeb4f65d45..b707e453d05 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -464,7 +464,7 @@ class CORE_EXPORT QgsProcessingParameterDefinition /** * A color to represent the default parameter */ - virtual QColor getColor() const; + virtual QColor modelColor() const; /** * Get a user friendly string representation of the provided parameter value. @@ -1794,10 +1794,7 @@ class CORE_EXPORT QgsProcessingParameterBoolean : public QgsProcessingParameterD QgsProcessingParameterBoolean( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a boolean parameter - */ - QColor getColor() const override { return QColor( 51, 201, 28 ); /* green */ }; + QColor modelColor() const override { return QColor( 51, 201, 28 ); /* green */ }; /** * Returns the type name for the parameter class. @@ -1829,10 +1826,7 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a crs parameter - */ - QColor getColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; + QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; /** * Get a user friendly string representation of the provided parameter value. @@ -1872,10 +1866,7 @@ class CORE_EXPORT QgsProcessingParameterExtent : public QgsProcessingParameterDe QgsProcessingParameterExtent( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent an extent parameter - */ - QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; /** * Returns the type name for the parameter class. @@ -1920,10 +1911,7 @@ class CORE_EXPORT QgsProcessingParameterPoint : public QgsProcessingParameterDef QgsProcessingParameterPoint( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a point parameter - */ - QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** @@ -1961,10 +1949,7 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter */ QgsProcessingParameterGeometry( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false, const QList< int > &geometryTypes = QList< int >(), bool allowMultipart = true ); - /** - * A color to represent a geometry parameter - */ - QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** * Returns the type name for the parameter class. @@ -2036,10 +2021,7 @@ class CORE_EXPORT QgsProcessingParameterFile : public QgsProcessingParameterDefi QgsProcessingParameterFile( const QString &name, const QString &description = QString(), Qgis::ProcessingFileParameterBehavior behavior = Qgis::ProcessingFileParameterBehavior::File, const QString &extension = QString(), const QVariant &defaultValue = QVariant(), bool optional = false, const QString &fileFilter = QString() ); - /** - * A color to represent a file parameter - */ - QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -2140,10 +2122,7 @@ class CORE_EXPORT QgsProcessingParameterMatrix : public QgsProcessingParameterDe */ static QString typeName() { return QStringLiteral( "matrix" ); } - /** - * A color to represent a mtrix parameter - */ - QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } @@ -2225,10 +2204,7 @@ class CORE_EXPORT QgsProcessingParameterMultipleLayers : public QgsProcessingPar const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a multiple layer parameter - */ - QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -2322,10 +2298,7 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe */ static QString typeName() { return QStringLiteral( "number" ); } - /** - * A color to represent a number parameter - */ - QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } @@ -2425,10 +2398,7 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter */ static QString typeName() { return QStringLiteral( "distance" ); } // cppcheck-suppress duplInheritedMember - /** - * A color to represent a color parameter - */ - QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QString getUserFriendlyValue( QVariant paramValue ) const override; @@ -2669,10 +2639,7 @@ class CORE_EXPORT QgsProcessingParameterDuration : public QgsProcessingParameter */ static QString typeName() { return QStringLiteral( "duration" ); } // cppcheck-suppress duplInheritedMember - /** - * A color to represent a duration parameter - */ - QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDuration *clone() const override SIP_FACTORY; @@ -2728,10 +2695,7 @@ class CORE_EXPORT QgsProcessingParameterScale : public QgsProcessingParameterNum */ static QString typeName() { return QStringLiteral( "scale" ); } // cppcheck-suppress duplInheritedMember - /** - * A color to represent a scale parameter - */ - QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterScale *clone() const override SIP_FACTORY; @@ -2767,10 +2731,7 @@ class CORE_EXPORT QgsProcessingParameterRange : public QgsProcessingParameterDef */ static QString typeName() { return QStringLiteral( "range" ); } - /** - * A color to represent a range parameter - */ - QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } @@ -2818,10 +2779,7 @@ class CORE_EXPORT QgsProcessingParameterRasterLayer : public QgsProcessingParame QgsProcessingParameterRasterLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a raster layer parameter - */ - QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; + QColor modelColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; /** * Returns the type name for the parameter class. @@ -2872,10 +2830,7 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi bool optional = false, bool usesStaticStrings = false ); - /** - * A color to represent an enum parameter - */ - QColor getColor() const override { return QColor( 152, 68, 201 ); /* purple */ }; + QColor modelColor() const override { return QColor( 152, 68, 201 ); /* purple */ }; /** * Get a user friendly string representation of the provided parameter value. @@ -2986,10 +2941,7 @@ class CORE_EXPORT QgsProcessingParameterString : public QgsProcessingParameterDe bool multiLine = false, bool optional = false ); - /** - * A color to represent a string parameter - */ - QColor getColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; + QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; /** * Returns the type name for the parameter class. @@ -3082,10 +3034,7 @@ class CORE_EXPORT QgsProcessingParameterExpression : public QgsProcessingParamet const QString &parentLayerParameterName = QString(), bool optional = false, Qgis::ExpressionType type = Qgis::ExpressionType::Qgis ); - /** - * A color to represent an expression parameter - */ - QColor getColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; + QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; /** * Returns the type name for the parameter class. @@ -3192,10 +3141,7 @@ class CORE_EXPORT QgsProcessingParameterVectorLayer : public QgsProcessingParame const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a vector layer parameter - */ - QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** @@ -3239,10 +3185,7 @@ class CORE_EXPORT QgsProcessingParameterMeshLayer : public QgsProcessingParamete const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a mesh layer parameter - */ - QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -3278,10 +3221,7 @@ class CORE_EXPORT QgsProcessingParameterMapLayer : public QgsProcessingParameter bool optional = false, const QList< int > &types = QList< int >() ); - /** - * A color to represent a map layer parameter - */ - QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -3430,10 +3370,7 @@ class CORE_EXPORT QgsProcessingParameterFeatureSource : public QgsProcessingPara const QList< int > &types = QList< int >(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a feature source parameter - */ - QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** * Returns the type name for the parameter class. @@ -3599,10 +3536,7 @@ class CORE_EXPORT QgsProcessingParameterFeatureSink : public QgsProcessingDestin QgsProcessingParameterFeatureSink( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry, const QVariant &defaultValue = QVariant(), bool optional = false, bool createByDefault = true, bool supportsAppend = false ); - /** - * A color to represent a feature sink parameter - */ - QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** * Returns the type name for the parameter class. @@ -3701,10 +3635,7 @@ class CORE_EXPORT QgsProcessingParameterVectorDestination : public QgsProcessing QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry, const QVariant &defaultValue = QVariant(), bool optional = false, bool createByDefault = true ); - /** - * A color to represent a vector destination parameter - */ - QColor getColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; /** * Returns the type name for the parameter class. @@ -3780,10 +3711,7 @@ class CORE_EXPORT QgsProcessingParameterRasterDestination : public QgsProcessing bool optional = false, bool createByDefault = true ); - /** - * A color to represent a raster destination parameter - */ - QColor getColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; + QColor modelColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; /** * Returns the type name for the parameter class. @@ -3846,10 +3774,7 @@ class CORE_EXPORT QgsProcessingParameterFileDestination : public QgsProcessingDe bool optional = false, bool createByDefault = true ); - /** - * A color to represent a file destination parameter - */ - QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -3908,10 +3833,7 @@ class CORE_EXPORT QgsProcessingParameterFolderDestination : public QgsProcessing bool optional = false, bool createByDefault = true ); - /** - * A color to represent a folder destination parameter - */ - QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -4140,10 +4062,7 @@ class CORE_EXPORT QgsProcessingParameterColor : public QgsProcessingParameterDef */ static QString typeName() { return QStringLiteral( "color" ); } - /** - * A color to represent a color parameter - */ - QColor getColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } @@ -4359,10 +4278,7 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter const QDateTime &maxValue = QDateTime() ); - /** - * A color to represent a datetime parameter - */ - QColor getColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; + QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; /** * Returns the type name for the parameter class. @@ -4683,10 +4599,7 @@ class CORE_EXPORT QgsProcessingParameterPointCloudLayer : public QgsProcessingPa QgsProcessingParameterPointCloudLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent a point cloud layer parameter - */ - QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -4723,10 +4636,7 @@ class CORE_EXPORT QgsProcessingParameterAnnotationLayer : public QgsProcessingPa QgsProcessingParameterAnnotationLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * A color to represent an annotation layer parameter - */ - QColor getColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; /** * Returns the type name for the parameter class. @@ -4767,10 +4677,7 @@ class CORE_EXPORT QgsProcessingParameterPointCloudDestination : public QgsProces bool optional = false, bool createByDefault = true ); - /** - * A color to represent a point cloud destination parameter - */ - QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. @@ -4908,10 +4815,7 @@ class CORE_EXPORT QgsProcessingParameterVectorTileDestination : public QgsProces bool optional = false, bool createByDefault = true ); - /** - * A color to represent a vector tile destination parameter - */ - QColor getColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; /** * Returns the type name for the parameter class. diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 5b1363637af..596a1cbcb63 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -896,7 +896,7 @@ QColor QgsModelParameterGraphicItem::getLinkColor( Qt::Edge /* unused in this im if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) ) { - return this->model()->parameterDefinition( parameter->parameterName() )->getColor(); + return this->model()->parameterDefinition( parameter->parameterName() )->modelColor(); } return fallbackColor(); @@ -1197,7 +1197,7 @@ QColor QgsModelComponentGraphicItem::getLinkColor( Qt::Edge edge, int index ) { if ( index <= child->algorithm()->outputDefinitions().size() - 1 ) { - return child->algorithm()->outputDefinitions().at( index )->getColor(); + return child->algorithm()->outputDefinitions().at( index )->modelColor(); } return fallbackColor(); } @@ -1207,7 +1207,7 @@ QColor QgsModelComponentGraphicItem::getLinkColor( Qt::Edge edge, int index ) if ( index <= params.size() - 1 ) { - return params.at( index )->getColor(); + return params.at( index )->modelColor(); } return fallbackColor(); From 76ac2f916b41768663dfc1728e0ab5dc1a8f61f4 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Fri, 13 Jun 2025 15:16:20 +0200 Subject: [PATCH 25/42] moved param colors to types --- .../auto_additions/qgsprocessingparameters.py | 64 +++++++++--------- .../qgsprocessingparametertype.py | 3 +- .../processing/qgsprocessingparameters.sip.in | 34 ---------- .../qgsprocessingparametertype.sip.in | 7 ++ .../auto_additions/qgsprocessingparameters.py | 64 +++++++++--------- .../qgsprocessingparametertype.py | 3 +- .../processing/qgsprocessingparameters.sip.in | 34 ---------- .../qgsprocessingparametertype.sip.in | 7 ++ .../processing/qgsprocessingparameters.cpp | 8 ++- src/core/processing/qgsprocessingparameters.h | 66 ------------------- .../processing/qgsprocessingparametertype.cpp | 10 +++ .../processing/qgsprocessingparametertype.h | 7 ++ .../qgsprocessingparametertypeimpl.h | 64 ++++++++++++++++++ 13 files changed, 170 insertions(+), 201 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py index fe4389e4dd3..22e80f7084b 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['modelColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['modelColor', 'clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,7 +378,7 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass diff --git a/python/PyQt6/core/auto_additions/qgsprocessingparametertype.py b/python/PyQt6/core/auto_additions/qgsprocessingparametertype.py index 53f94267b63..5d82e6ae7bc 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingparametertype.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingparametertype.py @@ -1,6 +1,7 @@ # The following has been generated automatically from src/core/processing/qgsprocessingparametertype.h try: - QgsProcessingParameterType.__virtual_methods__ = ['pythonImportString', 'className', 'flags', 'metadata', 'acceptedPythonTypes', 'acceptedStringValues', 'acceptedDataTypes'] + QgsProcessingParameterType.defaultModelColor = staticmethod(QgsProcessingParameterType.defaultModelColor) + QgsProcessingParameterType.__virtual_methods__ = ['pythonImportString', 'className', 'flags', 'metadata', 'acceptedPythonTypes', 'acceptedStringValues', 'acceptedDataTypes', 'modelColor'] QgsProcessingParameterType.__abstract_methods__ = ['create', 'description', 'name', 'id', 'acceptedParameterTypes', 'acceptedOutputTypes'] QgsProcessingParameterType.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index 80e18fc11a1..33a5bf9b1d8 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -1897,7 +1897,6 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1933,7 +1932,6 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring @@ -1981,7 +1979,6 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2023,8 +2020,6 @@ A point parameter for processing algorithms. Constructor for QgsProcessingParameterPoint. %End - virtual QColor modelColor() const; - static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2067,7 +2062,6 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2150,7 +2144,6 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2269,7 +2262,6 @@ Constructor for QgsProcessingParameterMatrix. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2364,7 +2356,6 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2468,7 +2459,6 @@ Constructor for QgsProcessingParameterNumber. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2577,7 +2567,6 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; @@ -2842,7 +2831,6 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDuration *clone() const /Factory/; @@ -2901,7 +2889,6 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterScale *clone() const /Factory/; @@ -2941,7 +2928,6 @@ Constructor for QgsProcessingParameterRange. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2995,7 +2981,6 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3054,7 +3039,6 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring @@ -3180,7 +3164,6 @@ accordingly.) Constructor for QgsProcessingParameterString. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3284,7 +3267,6 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3406,8 +3388,6 @@ Consider using the more versatile Constructor for QgsProcessingParameterVectorLayer. %End - virtual QColor modelColor() const; - static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3461,7 +3441,6 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3504,7 +3483,6 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3685,7 +3663,6 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3862,7 +3839,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3984,7 +3960,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4074,7 +4049,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4148,7 +4122,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4219,7 +4192,6 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4492,7 +4464,6 @@ varying color opacity. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -4749,7 +4720,6 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5129,7 +5099,6 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5174,7 +5143,6 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5222,7 +5190,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5388,7 +5355,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in index b83bffed9dd..5b5fd267ea3 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in @@ -23,6 +23,8 @@ Makes metadata of processing parameters available. %End public: + static QColor defaultModelColor(); + virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/; %Docstring Creates a new parameter of this type. @@ -175,6 +177,11 @@ for the parameter. .. seealso:: :py:func:`acceptedOutputTypes` .. versionadded:: 3.44 +%End + + virtual QColor modelColor() const; +%Docstring +A color to represent the default parameter %End }; diff --git a/python/core/auto_additions/qgsprocessingparameters.py b/python/core/auto_additions/qgsprocessingparameters.py index fe4389e4dd3..22e80f7084b 100644 --- a/python/core/auto_additions/qgsprocessingparameters.py +++ b/python/core/auto_additions/qgsprocessingparameters.py @@ -69,69 +69,69 @@ except (NameError, AttributeError): try: QgsProcessingParameterBoolean.typeName = staticmethod(QgsProcessingParameterBoolean.typeName) QgsProcessingParameterBoolean.fromScriptCode = staticmethod(QgsProcessingParameterBoolean.fromScriptCode) - QgsProcessingParameterBoolean.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode'] + QgsProcessingParameterBoolean.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode'] QgsProcessingParameterBoolean.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterExtent.typeName = staticmethod(QgsProcessingParameterExtent.typeName) QgsProcessingParameterExtent.fromScriptCode = staticmethod(QgsProcessingParameterExtent.fromScriptCode) - QgsProcessingParameterExtent.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterExtent.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterExtent.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterPoint.typeName = staticmethod(QgsProcessingParameterPoint.typeName) QgsProcessingParameterPoint.fromScriptCode = staticmethod(QgsProcessingParameterPoint.fromScriptCode) - QgsProcessingParameterPoint.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] + QgsProcessingParameterPoint.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString'] QgsProcessingParameterPoint.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFile.typeName = staticmethod(QgsProcessingParameterFile.typeName) QgsProcessingParameterFile.fromScriptCode = staticmethod(QgsProcessingParameterFile.fromScriptCode) - QgsProcessingParameterFile.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFile.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFile.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMatrix.typeName = staticmethod(QgsProcessingParameterMatrix.typeName) QgsProcessingParameterMatrix.fromScriptCode = staticmethod(QgsProcessingParameterMatrix.fromScriptCode) - QgsProcessingParameterMatrix.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMatrix.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMatrix.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMultipleLayers.typeName = staticmethod(QgsProcessingParameterMultipleLayers.typeName) QgsProcessingParameterMultipleLayers.fromScriptCode = staticmethod(QgsProcessingParameterMultipleLayers.fromScriptCode) - QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMultipleLayers.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMultipleLayers.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterNumber.typeName = staticmethod(QgsProcessingParameterNumber.typeName) QgsProcessingParameterNumber.fromScriptCode = staticmethod(QgsProcessingParameterNumber.fromScriptCode) - QgsProcessingParameterNumber.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterNumber.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterNumber.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -149,42 +149,42 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['modelColor', 'clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterScale.typeName = staticmethod(QgsProcessingParameterScale.typeName) QgsProcessingParameterScale.fromScriptCode = staticmethod(QgsProcessingParameterScale.fromScriptCode) - QgsProcessingParameterScale.__overridden_methods__ = ['modelColor', 'clone', 'type', 'asPythonString'] + QgsProcessingParameterScale.__overridden_methods__ = ['clone', 'type', 'asPythonString'] QgsProcessingParameterScale.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRange.typeName = staticmethod(QgsProcessingParameterRange.typeName) QgsProcessingParameterRange.fromScriptCode = staticmethod(QgsProcessingParameterRange.fromScriptCode) - QgsProcessingParameterRange.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterRange.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterRange.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterRasterLayer.typeName = staticmethod(QgsProcessingParameterRasterLayer.typeName) QgsProcessingParameterRasterLayer.fromScriptCode = staticmethod(QgsProcessingParameterRasterLayer.fromScriptCode) - QgsProcessingParameterRasterLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterRasterLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterRasterLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['modelColor', 'getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterString.typeName = staticmethod(QgsProcessingParameterString.typeName) QgsProcessingParameterString.fromScriptCode = staticmethod(QgsProcessingParameterString.fromScriptCode) - QgsProcessingParameterString.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterString.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterString.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -198,28 +198,28 @@ except (NameError, AttributeError): try: QgsProcessingParameterExpression.typeName = staticmethod(QgsProcessingParameterExpression.typeName) QgsProcessingParameterExpression.fromScriptCode = staticmethod(QgsProcessingParameterExpression.fromScriptCode) - QgsProcessingParameterExpression.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterExpression.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterExpression.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVectorLayer.typeName = staticmethod(QgsProcessingParameterVectorLayer.typeName) QgsProcessingParameterVectorLayer.fromScriptCode = staticmethod(QgsProcessingParameterVectorLayer.fromScriptCode) - QgsProcessingParameterVectorLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMeshLayer.typeName = staticmethod(QgsProcessingParameterMeshLayer.typeName) QgsProcessingParameterMeshLayer.fromScriptCode = staticmethod(QgsProcessingParameterMeshLayer.fromScriptCode) - QgsProcessingParameterMeshLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterMeshLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterMeshLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterMapLayer.typeName = staticmethod(QgsProcessingParameterMapLayer.typeName) QgsProcessingParameterMapLayer.fromScriptCode = staticmethod(QgsProcessingParameterMapLayer.fromScriptCode) - QgsProcessingParameterMapLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterMapLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterMapLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -233,7 +233,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterFeatureSource.typeName = staticmethod(QgsProcessingParameterFeatureSource.typeName) QgsProcessingParameterFeatureSource.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSource.fromScriptCode) - QgsProcessingParameterFeatureSource.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFeatureSource.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'asScriptCode', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFeatureSource.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -241,7 +241,7 @@ try: QgsProcessingParameterFeatureSink.typeName = staticmethod(QgsProcessingParameterFeatureSink.typeName) QgsProcessingParameterFeatureSink.fromScriptCode = staticmethod(QgsProcessingParameterFeatureSink.fromScriptCode) QgsProcessingParameterFeatureSink.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterFeatureSink.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] + QgsProcessingParameterFeatureSink.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap', 'generateTemporaryDestination'] QgsProcessingParameterFeatureSink.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -249,7 +249,7 @@ try: QgsProcessingParameterVectorDestination.typeName = staticmethod(QgsProcessingParameterVectorDestination.typeName) QgsProcessingParameterVectorDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorDestination.fromScriptCode) QgsProcessingParameterVectorDestination.__virtual_methods__ = ['supportedOutputVectorLayerExtensions'] - QgsProcessingParameterVectorDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVectorDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterVectorDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -257,21 +257,21 @@ try: QgsProcessingParameterRasterDestination.typeName = staticmethod(QgsProcessingParameterRasterDestination.typeName) QgsProcessingParameterRasterDestination.fromScriptCode = staticmethod(QgsProcessingParameterRasterDestination.fromScriptCode) QgsProcessingParameterRasterDestination.__virtual_methods__ = ['supportedOutputRasterLayerExtensions'] - QgsProcessingParameterRasterDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterRasterDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterRasterDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFileDestination.typeName = staticmethod(QgsProcessingParameterFileDestination.typeName) QgsProcessingParameterFileDestination.fromScriptCode = staticmethod(QgsProcessingParameterFileDestination.fromScriptCode) - QgsProcessingParameterFileDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterFileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'asPythonString', 'createFileFilter', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterFileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterFolderDestination.typeName = staticmethod(QgsProcessingParameterFolderDestination.typeName) QgsProcessingParameterFolderDestination.fromScriptCode = staticmethod(QgsProcessingParameterFolderDestination.fromScriptCode) - QgsProcessingParameterFolderDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] + QgsProcessingParameterFolderDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'toOutputDefinition', 'defaultFileExtension'] QgsProcessingParameterFolderDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -299,7 +299,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterColor.typeName = staticmethod(QgsProcessingParameterColor.typeName) QgsProcessingParameterColor.fromScriptCode = staticmethod(QgsProcessingParameterColor.fromScriptCode) - QgsProcessingParameterColor.__overridden_methods__ = ['modelColor', 'clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterColor.__overridden_methods__ = ['clone', 'type', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'checkValueIsAcceptable', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterColor.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -348,14 +348,14 @@ except (NameError, AttributeError): try: QgsProcessingParameterPointCloudLayer.typeName = staticmethod(QgsProcessingParameterPointCloudLayer.typeName) QgsProcessingParameterPointCloudLayer.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudLayer.fromScriptCode) - QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] + QgsProcessingParameterPointCloudLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject', 'createFileFilter'] QgsProcessingParameterPointCloudLayer.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterAnnotationLayer.typeName = staticmethod(QgsProcessingParameterAnnotationLayer.typeName) QgsProcessingParameterAnnotationLayer.fromScriptCode = staticmethod(QgsProcessingParameterAnnotationLayer.fromScriptCode) - QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterAnnotationLayer.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterAnnotationLayer.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -363,7 +363,7 @@ try: QgsProcessingParameterPointCloudDestination.typeName = staticmethod(QgsProcessingParameterPointCloudDestination.typeName) QgsProcessingParameterPointCloudDestination.fromScriptCode = staticmethod(QgsProcessingParameterPointCloudDestination.fromScriptCode) QgsProcessingParameterPointCloudDestination.__virtual_methods__ = ['supportedOutputPointCloudLayerExtensions'] - QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterPointCloudDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterPointCloudDestination.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -378,7 +378,7 @@ try: QgsProcessingParameterVectorTileDestination.typeName = staticmethod(QgsProcessingParameterVectorTileDestination.typeName) QgsProcessingParameterVectorTileDestination.fromScriptCode = staticmethod(QgsProcessingParameterVectorTileDestination.fromScriptCode) QgsProcessingParameterVectorTileDestination.__virtual_methods__ = ['supportedOutputVectorTileLayerExtensions'] - QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['modelColor', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] + QgsProcessingParameterVectorTileDestination.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toOutputDefinition', 'defaultFileExtension', 'createFileFilter'] QgsProcessingParameterVectorTileDestination.__group__ = ['processing'] except (NameError, AttributeError): pass diff --git a/python/core/auto_additions/qgsprocessingparametertype.py b/python/core/auto_additions/qgsprocessingparametertype.py index 53f94267b63..5d82e6ae7bc 100644 --- a/python/core/auto_additions/qgsprocessingparametertype.py +++ b/python/core/auto_additions/qgsprocessingparametertype.py @@ -1,6 +1,7 @@ # The following has been generated automatically from src/core/processing/qgsprocessingparametertype.h try: - QgsProcessingParameterType.__virtual_methods__ = ['pythonImportString', 'className', 'flags', 'metadata', 'acceptedPythonTypes', 'acceptedStringValues', 'acceptedDataTypes'] + QgsProcessingParameterType.defaultModelColor = staticmethod(QgsProcessingParameterType.defaultModelColor) + QgsProcessingParameterType.__virtual_methods__ = ['pythonImportString', 'className', 'flags', 'metadata', 'acceptedPythonTypes', 'acceptedStringValues', 'acceptedDataTypes', 'modelColor'] QgsProcessingParameterType.__abstract_methods__ = ['create', 'description', 'name', 'id', 'acceptedParameterTypes', 'acceptedOutputTypes'] QgsProcessingParameterType.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 3295ba0b057..55b931eac30 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -1897,7 +1897,6 @@ A boolean parameter for processing algorithms. Constructor for QgsProcessingParameterBoolean. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -1933,7 +1932,6 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring @@ -1981,7 +1979,6 @@ A rectangular map extent parameter for processing algorithms. Constructor for QgsProcessingParameterExtent. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2023,8 +2020,6 @@ A point parameter for processing algorithms. Constructor for QgsProcessingParameterPoint. %End - virtual QColor modelColor() const; - static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2067,7 +2062,6 @@ Passing a empty list will allow for any type of geometry. The ``allowMultiPart`` argument allows specifying a multi part geometry %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2150,7 +2144,6 @@ one of ``extension`` or ``fileFilter`` should be specified, if both are specified then ``fileFilter`` takes precedence. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2269,7 +2262,6 @@ Constructor for QgsProcessingParameterMatrix. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2364,7 +2356,6 @@ A parameter for processing algorithms which accepts multiple map layers. Constructor for QgsProcessingParameterMultipleLayers. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -2468,7 +2459,6 @@ Constructor for QgsProcessingParameterNumber. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2577,7 +2567,6 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; @@ -2842,7 +2831,6 @@ Constructor for QgsProcessingParameterDuration. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDuration *clone() const /Factory/; @@ -2901,7 +2889,6 @@ Constructor for QgsProcessingParameterScale. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterScale *clone() const /Factory/; @@ -2941,7 +2928,6 @@ Constructor for QgsProcessingParameterRange. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -2995,7 +2981,6 @@ A raster layer parameter for processing algorithms. Constructor for QgsProcessingParameterRasterLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3054,7 +3039,6 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QColor modelColor() const; virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring @@ -3180,7 +3164,6 @@ accordingly.) Constructor for QgsProcessingParameterString. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3284,7 +3267,6 @@ An expression parameter for processing algorithms. Constructor for QgsProcessingParameterExpression. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3406,8 +3388,6 @@ Consider using the more versatile Constructor for QgsProcessingParameterVectorLayer. %End - virtual QColor modelColor() const; - static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3461,7 +3441,6 @@ A mesh layer parameter for processing algorithms. Constructor for QgsProcessingParameterMeshLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3504,7 +3483,6 @@ A map layer parameter for processing algorithms. Constructor for QgsProcessingParameterMapLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3685,7 +3663,6 @@ algorithms. Constructor for QgsProcessingParameterFeatureSource. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3862,7 +3839,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -3984,7 +3960,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4074,7 +4049,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4148,7 +4122,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4219,7 +4192,6 @@ the algorithm. Constructor for QgsProcessingParameterFolderDestination. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -4492,7 +4464,6 @@ varying color opacity. Returns the type name for the parameter class. %End - virtual QColor modelColor() const; virtual QgsProcessingParameterDefinition *clone() const /Factory/; virtual QString type() const; @@ -4749,7 +4720,6 @@ will return a date time value. Constructor for QgsProcessingParameterDateTime. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5129,7 +5099,6 @@ A point cloud layer parameter for processing algorithms. Constructor for QgsProcessingParameterPointCloudLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5174,7 +5143,6 @@ An annotation layer parameter for processing algorithms. Constructor for QgsProcessingParameterAnnotationLayer. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5222,7 +5190,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. @@ -5388,7 +5355,6 @@ If ``createByDefault`` is ``False`` and the parameter is ``optional``, then this destination output will not be created by default. %End - virtual QColor modelColor() const; static QString typeName(); %Docstring Returns the type name for the parameter class. diff --git a/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in b/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in index b83bffed9dd..5b5fd267ea3 100644 --- a/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in @@ -23,6 +23,8 @@ Makes metadata of processing parameters available. %End public: + static QColor defaultModelColor(); + virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/; %Docstring Creates a new parameter of this type. @@ -175,6 +177,11 @@ for the parameter. .. seealso:: :py:func:`acceptedOutputTypes` .. versionadded:: 3.44 +%End + + virtual QColor modelColor() const; +%Docstring +A color to represent the default parameter %End }; diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 62921543bbf..5163e183a66 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3023,7 +3023,13 @@ QgsProcessingParameterDefinition *QgsProcessingParameterBoolean::clone() const QColor QgsProcessingParameterDefinition::modelColor() const { - return QColor( 128, 128, 128 ); /* mid gray */ + QgsProcessingParameterType *paramType = QgsApplication::processingRegistry()->parameterType( type() ); + if ( paramType ) + { + return paramType->modelColor(); + } + + return QgsProcessingParameterType::defaultModelColor(); } QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramValue ) const diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index b707e453d05..e49aa7a1bd5 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -1794,8 +1794,6 @@ class CORE_EXPORT QgsProcessingParameterBoolean : public QgsProcessingParameterD QgsProcessingParameterBoolean( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 51, 201, 28 ); /* green */ }; - /** * Returns the type name for the parameter class. */ @@ -1826,8 +1824,6 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; - /** * Get a user friendly string representation of the provided parameter value. */ @@ -1866,8 +1862,6 @@ class CORE_EXPORT QgsProcessingParameterExtent : public QgsProcessingParameterDe QgsProcessingParameterExtent( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; - /** * Returns the type name for the parameter class. */ @@ -1911,9 +1905,6 @@ class CORE_EXPORT QgsProcessingParameterPoint : public QgsProcessingParameterDef QgsProcessingParameterPoint( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; - - /** * Returns the type name for the parameter class. */ @@ -1949,8 +1940,6 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter */ QgsProcessingParameterGeometry( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false, const QList< int > &geometryTypes = QList< int >(), bool allowMultipart = true ); - QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; - /** * Returns the type name for the parameter class. */ @@ -2021,8 +2010,6 @@ class CORE_EXPORT QgsProcessingParameterFile : public QgsProcessingParameterDefi QgsProcessingParameterFile( const QString &name, const QString &description = QString(), Qgis::ProcessingFileParameterBehavior behavior = Qgis::ProcessingFileParameterBehavior::File, const QString &extension = QString(), const QVariant &defaultValue = QVariant(), bool optional = false, const QString &fileFilter = QString() ); - QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; - /** * Returns the type name for the parameter class. */ @@ -2122,8 +2109,6 @@ class CORE_EXPORT QgsProcessingParameterMatrix : public QgsProcessingParameterDe */ static QString typeName() { return QStringLiteral( "matrix" ); } - QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; - QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override; @@ -2204,8 +2189,6 @@ class CORE_EXPORT QgsProcessingParameterMultipleLayers : public QgsProcessingPar const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; - /** * Returns the type name for the parameter class. */ @@ -2298,8 +2281,6 @@ class CORE_EXPORT QgsProcessingParameterNumber : public QgsProcessingParameterDe */ static QString typeName() { return QStringLiteral( "number" ); } - QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; - QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override; @@ -2398,8 +2379,6 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter */ static QString typeName() { return QStringLiteral( "distance" ); } // cppcheck-suppress duplInheritedMember - QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; - QString getUserFriendlyValue( QVariant paramValue ) const override; QgsProcessingParameterDistance *clone() const override SIP_FACTORY; @@ -2639,8 +2618,6 @@ class CORE_EXPORT QgsProcessingParameterDuration : public QgsProcessingParameter */ static QString typeName() { return QStringLiteral( "duration" ); } // cppcheck-suppress duplInheritedMember - QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; - QgsProcessingParameterDuration *clone() const override SIP_FACTORY; QString type() const override; @@ -2695,8 +2672,6 @@ class CORE_EXPORT QgsProcessingParameterScale : public QgsProcessingParameterNum */ static QString typeName() { return QStringLiteral( "scale" ); } // cppcheck-suppress duplInheritedMember - QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; - QgsProcessingParameterScale *clone() const override SIP_FACTORY; QString type() const override; @@ -2731,8 +2706,6 @@ class CORE_EXPORT QgsProcessingParameterRange : public QgsProcessingParameterDef */ static QString typeName() { return QStringLiteral( "range" ); } - QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; - QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } bool checkValueIsAcceptable( const QVariant &input, QgsProcessingContext *context = nullptr ) const override; @@ -2779,8 +2752,6 @@ class CORE_EXPORT QgsProcessingParameterRasterLayer : public QgsProcessingParame QgsProcessingParameterRasterLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; - /** * Returns the type name for the parameter class. */ @@ -2830,8 +2801,6 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi bool optional = false, bool usesStaticStrings = false ); - QColor modelColor() const override { return QColor( 152, 68, 201 ); /* purple */ }; - /** * Get a user friendly string representation of the provided parameter value. */ @@ -2941,8 +2910,6 @@ class CORE_EXPORT QgsProcessingParameterString : public QgsProcessingParameterDe bool multiLine = false, bool optional = false ); - QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; - /** * Returns the type name for the parameter class. */ @@ -3034,8 +3001,6 @@ class CORE_EXPORT QgsProcessingParameterExpression : public QgsProcessingParamet const QString &parentLayerParameterName = QString(), bool optional = false, Qgis::ExpressionType type = Qgis::ExpressionType::Qgis ); - QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; - /** * Returns the type name for the parameter class. */ @@ -3141,9 +3106,6 @@ class CORE_EXPORT QgsProcessingParameterVectorLayer : public QgsProcessingParame const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; - - /** * Returns the type name for the parameter class. */ @@ -3185,8 +3147,6 @@ class CORE_EXPORT QgsProcessingParameterMeshLayer : public QgsProcessingParamete const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; - /** * Returns the type name for the parameter class. */ @@ -3221,8 +3181,6 @@ class CORE_EXPORT QgsProcessingParameterMapLayer : public QgsProcessingParameter bool optional = false, const QList< int > &types = QList< int >() ); - QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; - /** * Returns the type name for the parameter class. */ @@ -3370,8 +3328,6 @@ class CORE_EXPORT QgsProcessingParameterFeatureSource : public QgsProcessingPara const QList< int > &types = QList< int >(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; - /** * Returns the type name for the parameter class. */ @@ -3536,8 +3492,6 @@ class CORE_EXPORT QgsProcessingParameterFeatureSink : public QgsProcessingDestin QgsProcessingParameterFeatureSink( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry, const QVariant &defaultValue = QVariant(), bool optional = false, bool createByDefault = true, bool supportsAppend = false ); - QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; - /** * Returns the type name for the parameter class. */ @@ -3635,8 +3589,6 @@ class CORE_EXPORT QgsProcessingParameterVectorDestination : public QgsProcessing QgsProcessingParameterVectorDestination( const QString &name, const QString &description = QString(), Qgis::ProcessingSourceType type = Qgis::ProcessingSourceType::VectorAnyGeometry, const QVariant &defaultValue = QVariant(), bool optional = false, bool createByDefault = true ); - QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; - /** * Returns the type name for the parameter class. */ @@ -3711,8 +3663,6 @@ class CORE_EXPORT QgsProcessingParameterRasterDestination : public QgsProcessing bool optional = false, bool createByDefault = true ); - QColor modelColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; - /** * Returns the type name for the parameter class. */ @@ -3774,8 +3724,6 @@ class CORE_EXPORT QgsProcessingParameterFileDestination : public QgsProcessingDe bool optional = false, bool createByDefault = true ); - QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; - /** * Returns the type name for the parameter class. */ @@ -3833,8 +3781,6 @@ class CORE_EXPORT QgsProcessingParameterFolderDestination : public QgsProcessing bool optional = false, bool createByDefault = true ); - QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; - /** * Returns the type name for the parameter class. */ @@ -4062,8 +4008,6 @@ class CORE_EXPORT QgsProcessingParameterColor : public QgsProcessingParameterDef */ static QString typeName() { return QStringLiteral( "color" ); } - QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; - QgsProcessingParameterDefinition *clone() const override SIP_FACTORY; QString type() const override { return typeName(); } QString valueAsPythonString( const QVariant &value, QgsProcessingContext &context ) const override; @@ -4278,8 +4222,6 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter const QDateTime &maxValue = QDateTime() ); - QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; - /** * Returns the type name for the parameter class. */ @@ -4599,8 +4541,6 @@ class CORE_EXPORT QgsProcessingParameterPointCloudLayer : public QgsProcessingPa QgsProcessingParameterPointCloudLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; - /** * Returns the type name for the parameter class. */ @@ -4636,8 +4576,6 @@ class CORE_EXPORT QgsProcessingParameterAnnotationLayer : public QgsProcessingPa QgsProcessingParameterAnnotationLayer( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; - /** * Returns the type name for the parameter class. */ @@ -4677,8 +4615,6 @@ class CORE_EXPORT QgsProcessingParameterPointCloudDestination : public QgsProces bool optional = false, bool createByDefault = true ); - QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; - /** * Returns the type name for the parameter class. */ @@ -4815,8 +4751,6 @@ class CORE_EXPORT QgsProcessingParameterVectorTileDestination : public QgsProces bool optional = false, bool createByDefault = true ); - QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; - /** * Returns the type name for the parameter class. */ diff --git a/src/core/processing/qgsprocessingparametertype.cpp b/src/core/processing/qgsprocessingparametertype.cpp index f8d1fb4ab5e..0326c8c4492 100644 --- a/src/core/processing/qgsprocessingparametertype.cpp +++ b/src/core/processing/qgsprocessingparametertype.cpp @@ -17,6 +17,11 @@ #include "qgsprocessingparametertype.h" +QColor QgsProcessingParameterType::defaultModelColor() +{ + return QColor( 128, 128, 128 ); /* mid gray */ +} + Qgis::ProcessingParameterTypeFlags QgsProcessingParameterType::flags() const { return Qgis::ProcessingParameterTypeFlag::ExposeToModeler; @@ -51,3 +56,8 @@ QList QgsProcessingParameterType::acceptedDataTypes( const QgsProcessingPar { return QList(); } + +QColor QgsProcessingParameterType::modelColor() const +{ + return QColor( 128, 128, 128 ); /* mid gray */ +} diff --git a/src/core/processing/qgsprocessingparametertype.h b/src/core/processing/qgsprocessingparametertype.h index 3c11bc86530..8ffb037cfb0 100644 --- a/src/core/processing/qgsprocessingparametertype.h +++ b/src/core/processing/qgsprocessingparametertype.h @@ -34,6 +34,8 @@ class CORE_EXPORT QgsProcessingParameterType { public: + static QColor defaultModelColor(); + /** * Creates a new parameter of this type. */ @@ -171,6 +173,11 @@ class CORE_EXPORT QgsProcessingParameterType */ virtual QList acceptedDataTypes( const QgsProcessingParameterDefinition *parameter ) const; + /** + * A color to represent the default parameter + */ + virtual QColor modelColor() const; + }; #endif // QGSPROCESSINGPARAMETERTYPE_H diff --git a/src/core/processing/qgsprocessingparametertypeimpl.h b/src/core/processing/qgsprocessingparametertypeimpl.h index c143742e228..02beae85983 100644 --- a/src/core/processing/qgsprocessingparametertypeimpl.h +++ b/src/core/processing/qgsprocessingparametertypeimpl.h @@ -96,6 +96,8 @@ class CORE_EXPORT QgsProcessingParameterTypeRasterLayer : public QgsProcessingPa << QgsProcessingOutputFile::typeName() << QgsProcessingOutputFolder::typeName(); } + + QColor modelColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; }; /** @@ -168,6 +170,8 @@ class CORE_EXPORT QgsProcessingParameterTypeMeshLayer : public QgsProcessingPara << QgsProcessingOutputFile::typeName() << QgsProcessingOutputFolder::typeName(); } + + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; }; /** @@ -249,6 +253,8 @@ class CORE_EXPORT QgsProcessingParameterTypeVectorLayer : public QgsProcessingPa else return QList(); } + + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; }; /** @@ -329,6 +335,8 @@ class CORE_EXPORT QgsProcessingParameterTypeMapLayer : public QgsProcessingParam << QgsProcessingOutputFile::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; }; /** @@ -420,6 +428,8 @@ class CORE_EXPORT QgsProcessingParameterTypeBoolean : public QgsProcessingParame << QgsProcessingOutputVariant::typeName() << QgsProcessingOutputBoolean::typeName(); } + + QColor modelColor() const override { return QColor( 51, 201, 28 ); /* green */ }; }; /** @@ -492,6 +502,8 @@ class CORE_EXPORT QgsProcessingParameterTypeExpression : public QgsProcessingPar << QgsProcessingOutputNumber::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; }; /** @@ -579,6 +591,8 @@ class CORE_EXPORT QgsProcessingParameterTypeCrs : public QgsProcessingParameterT << QgsProcessingOutputString::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; }; /** @@ -645,6 +659,8 @@ class CORE_EXPORT QgsProcessingParameterTypeRange : public QgsProcessingParamete return QStringList() << QgsProcessingOutputString::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; }; /** @@ -713,6 +729,8 @@ class CORE_EXPORT QgsProcessingParameterTypePoint : public QgsProcessingParamete << QgsProcessingOutputString::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; }; /** @@ -781,6 +799,8 @@ class CORE_EXPORT QgsProcessingParameterTypeGeometry : public QgsProcessingParam << QgsProcessingOutputString::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; }; /** @@ -850,6 +870,8 @@ class CORE_EXPORT QgsProcessingParameterTypeEnum : public QgsProcessingParameter << QgsProcessingOutputVariant::typeName() << QgsProcessingOutputNumber::typeName(); } + + QColor modelColor() const override { return QColor( 152, 68, 201 ); /* purple */ }; }; /** @@ -934,6 +956,8 @@ class CORE_EXPORT QgsProcessingParameterTypeExtent : public QgsProcessingParamet << QgsProcessingOutputMapLayer::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; }; /** @@ -997,6 +1021,8 @@ class CORE_EXPORT QgsProcessingParameterTypeMatrix : public QgsProcessingParamet { return QStringList(); } + + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; }; /** @@ -1066,6 +1092,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFile : public QgsProcessingParameter << QgsProcessingOutputVectorLayer::typeName() << QgsProcessingOutputMapLayer::typeName(); } + + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; /** @@ -1223,6 +1251,8 @@ class CORE_EXPORT QgsProcessingParameterTypeVectorDestination : public QgsProces { return QStringList() << QObject::tr( "Path for new vector layer" ); } + + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; }; /** @@ -1299,6 +1329,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFileDestination : public QgsProcessi << QgsProcessingOutputVectorLayer::typeName() << QgsProcessingOutputMapLayer::typeName(); } + + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; /** @@ -1374,6 +1406,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFolderDestination : public QgsProces << QgsProcessingOutputString::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; /** @@ -1434,6 +1468,8 @@ class CORE_EXPORT QgsProcessingParameterTypeRasterDestination : public QgsProces { return QStringList() << QObject::tr( "Path for new raster layer" ); } + + QColor modelColor() const override { return QColor( 0, 180, 180 ); /* turquoise */ }; }; /** @@ -1514,6 +1550,8 @@ class CORE_EXPORT QgsProcessingParameterTypeString : public QgsProcessingParamet << QgsProcessingOutputFolder::typeName() << QgsProcessingOutputString::typeName(); } + + QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; }; /** @@ -1651,6 +1689,8 @@ class CORE_EXPORT QgsProcessingParameterTypeMultipleLayers : public QgsProcessin << QgsProcessingOutputString::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; }; /** @@ -1734,6 +1774,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFeatureSource : public QgsProcessing else return QList(); } + + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; }; /** @@ -1806,6 +1848,8 @@ class CORE_EXPORT QgsProcessingParameterTypeNumber : public QgsProcessingParamet << QgsProcessingOutputVariant::typeName() << QgsProcessingOutputString::typeName(); } + + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; }; /** @@ -1860,6 +1904,8 @@ class CORE_EXPORT QgsProcessingParameterTypeDistance : public QgsProcessingParam << QObject::tr( "field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field" ) << QObject::tr( "expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression" ); } + + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; }; @@ -2026,6 +2072,8 @@ class CORE_EXPORT QgsProcessingParameterTypeDuration : public QgsProcessingParam << QObject::tr( "field:FIELD_NAME to use a data defined value taken from the FIELD_NAME field" ) << QObject::tr( "expression:SOME EXPRESSION to use a data defined value calculated using a custom QGIS expression" ); } + + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; }; /** @@ -2078,6 +2126,8 @@ class CORE_EXPORT QgsProcessingParameterTypeScale : public QgsProcessingParamete { return QStringList() << QObject::tr( "A numeric value representing the scale denominator" ); } + + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; }; /** @@ -2204,6 +2254,8 @@ class CORE_EXPORT QgsProcessingParameterTypeFeatureSink : public QgsProcessingPa { return QStringList() << QObject::tr( "Path for new vector layer" ); } + + QColor modelColor() const override { return QColor( 122, 0, 47 ); /* burgundy */ }; }; /** @@ -2403,6 +2455,8 @@ class CORE_EXPORT QgsProcessingParameterTypeColor : public QgsProcessingParamete << QgsProcessingOutputString::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 34, 157, 214 ); /* blue */ }; }; /** @@ -2602,6 +2656,8 @@ class CORE_EXPORT QgsProcessingParameterTypeDateTime : public QgsProcessingParam << QgsProcessingOutputString::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 255, 131, 23 ); /* orange */ }; }; /** @@ -2872,6 +2928,8 @@ class CORE_EXPORT QgsProcessingParameterTypePointCloudLayer : public QgsProcessi << QgsProcessingOutputFile::typeName() << QgsProcessingOutputFolder::typeName(); } + + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; }; /** @@ -2942,6 +3000,8 @@ class CORE_EXPORT QgsProcessingParameterTypeAnnotationLayer : public QgsProcessi << QgsProcessingOutputMapLayer::typeName() << QgsProcessingOutputVariant::typeName(); } + + QColor modelColor() const override { return QColor( 137, 150, 171 ); /* cold gray */ }; }; /** @@ -3002,6 +3062,8 @@ class CORE_EXPORT QgsProcessingParameterTypePointCloudDestination : public QgsPr { return QStringList() << QObject::tr( "Path for new point cloud layer" ); } + + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; /** @@ -3128,6 +3190,8 @@ class CORE_EXPORT QgsProcessingParameterTypeVectorTileDestination : public QgsPr { return QStringList() << QObject::tr( "Path for new vector tile layer" ); } + + QColor modelColor() const override { return QColor( 80, 80, 80 ); /* dark gray */ }; }; #endif // QGSPROCESSINGPARAMETERTYPEIMPL_H From b29f446c7c476b8244aa9a5dc9c40b5655b3a181 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 10:31:25 +0200 Subject: [PATCH 26/42] add geometry type name getter --- .../PyQt6/core/auto_additions/qgsgeometry.py | 1 + .../geometry/qgsgeometry.sip.in | 10 ++++++++ .../processing/qgsprocessingparameters.sip.in | 10 +++++--- python/core/auto_additions/qgsgeometry.py | 1 + .../geometry/qgsgeometry.sip.in | 10 ++++++++ .../processing/qgsprocessingparameters.sip.in | 10 +++++--- src/core/geometry/qgsgeometry.cpp | 23 +++++++++++++++++++ src/core/geometry/qgsgeometry.h | 10 ++++++++ .../processing/qgsprocessingparameters.cpp | 22 +++++------------- src/core/processing/qgsprocessingparameters.h | 6 +++-- 10 files changed, 79 insertions(+), 24 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsgeometry.py b/python/PyQt6/core/auto_additions/qgsgeometry.py index c8dc6afb58e..3af46379076 100644 --- a/python/PyQt6/core/auto_additions/qgsgeometry.py +++ b/python/PyQt6/core/auto_additions/qgsgeometry.py @@ -14,6 +14,7 @@ try: QgsGeometry.collectGeometry = staticmethod(QgsGeometry.collectGeometry) QgsGeometry.createWedgeBuffer = staticmethod(QgsGeometry.createWedgeBuffer) QgsGeometry.createWedgeBufferFromAngles = staticmethod(QgsGeometry.createWedgeBufferFromAngles) + QgsGeometry.name = staticmethod(QgsGeometry.name) QgsGeometry.unaryUnion = staticmethod(QgsGeometry.unaryUnion) QgsGeometry.polygonize = staticmethod(QgsGeometry.polygonize) QgsGeometry.fromQPointF = staticmethod(QgsGeometry.fromQPointF) diff --git a/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in b/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in index b3e0deda411..dca59333944 100644 --- a/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in +++ b/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in @@ -327,6 +327,11 @@ Polygon geometry. .. versionadded:: 3.40 %End + static QString name( Qgis::GeometryType type ); +%Docstring +Returns a user friendly name as a string out of the type +%End + void fromWkb( const QByteArray &wkb ); %Docstring @@ -346,6 +351,11 @@ etc.) Returns type of the geometry as a :py:class:`Qgis`.GeometryType .. seealso:: :py:func:`wkbType` +%End + + QString typeName() const /HoldGIL/; +%Docstring +Returns the type name as a string %End bool isEmpty() const /HoldGIL/; diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index 33a5bf9b1d8..e1e8f7c5149 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -371,9 +371,13 @@ A color to represent the default parameter virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring -Get a user friendly string representation of the provided parameter -value. (Meant to be override by child classes to adapt to specific param -types) +Returns a user-friendly string representation of the provided parameter +``value``. + +The returned string is to be used for display purposes only, and should +be translated as required. + +.. versionadded:: 3.44 %End virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/; diff --git a/python/core/auto_additions/qgsgeometry.py b/python/core/auto_additions/qgsgeometry.py index c8dc6afb58e..3af46379076 100644 --- a/python/core/auto_additions/qgsgeometry.py +++ b/python/core/auto_additions/qgsgeometry.py @@ -14,6 +14,7 @@ try: QgsGeometry.collectGeometry = staticmethod(QgsGeometry.collectGeometry) QgsGeometry.createWedgeBuffer = staticmethod(QgsGeometry.createWedgeBuffer) QgsGeometry.createWedgeBufferFromAngles = staticmethod(QgsGeometry.createWedgeBufferFromAngles) + QgsGeometry.name = staticmethod(QgsGeometry.name) QgsGeometry.unaryUnion = staticmethod(QgsGeometry.unaryUnion) QgsGeometry.polygonize = staticmethod(QgsGeometry.polygonize) QgsGeometry.fromQPointF = staticmethod(QgsGeometry.fromQPointF) diff --git a/python/core/auto_generated/geometry/qgsgeometry.sip.in b/python/core/auto_generated/geometry/qgsgeometry.sip.in index 7246d322268..898e4d56f7b 100644 --- a/python/core/auto_generated/geometry/qgsgeometry.sip.in +++ b/python/core/auto_generated/geometry/qgsgeometry.sip.in @@ -327,6 +327,11 @@ Polygon geometry. .. versionadded:: 3.40 %End + static QString name( Qgis::GeometryType type ); +%Docstring +Returns a user friendly name as a string out of the type +%End + void fromWkb( const QByteArray &wkb ); %Docstring @@ -346,6 +351,11 @@ etc.) Returns type of the geometry as a :py:class:`Qgis`.GeometryType .. seealso:: :py:func:`wkbType` +%End + + QString typeName() const /HoldGIL/; +%Docstring +Returns the type name as a string %End bool isEmpty() const /HoldGIL/; diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 55b931eac30..ea656bb9a80 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -371,9 +371,13 @@ A color to represent the default parameter virtual QString getUserFriendlyValue( QVariant paramValue ) const; %Docstring -Get a user friendly string representation of the provided parameter -value. (Meant to be override by child classes to adapt to specific param -types) +Returns a user-friendly string representation of the provided parameter +``value``. + +The returned string is to be used for display purposes only, and should +be translated as required. + +.. versionadded:: 3.44 %End virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/; diff --git a/src/core/geometry/qgsgeometry.cpp b/src/core/geometry/qgsgeometry.cpp index c6b0f1cf3d9..d23e0720fe8 100644 --- a/src/core/geometry/qgsgeometry.cpp +++ b/src/core/geometry/qgsgeometry.cpp @@ -476,6 +476,19 @@ QgsGeometry QgsGeometry::createWedgeBufferFromAngles( const QgsPoint ¢er, do return QgsGeometry( std::move( cp ) ); } +QString QgsGeometry::name( Qgis::GeometryType type ) +{ + switch ( type ) + { + case Qgis::GeometryType::Line: return QString( "Line" ); + case Qgis::GeometryType::Point: return QString( "Point" ); + case Qgis::GeometryType::Polygon: return QString( "Polygon" ); + case Qgis::GeometryType::Null: return QString( "Null" ); + case Qgis::GeometryType::Unknown: + default: return QString( "Unknown" ); + } +} + void QgsGeometry::fromWkb( unsigned char *wkb, int length ) { QgsConstWkbPtr ptr( wkb, length ); @@ -510,6 +523,16 @@ Qgis::GeometryType QgsGeometry::type() const return QgsWkbTypes::geometryType( d->geometry->wkbType() ); } +QString QgsGeometry::typeName() const +{ + if ( !d->geometry ) + { + return QgsGeometry::name( Qgis::GeometryType::Null ); + } + + return QgsGeometry::name( type() ); +} + bool QgsGeometry::isEmpty() const { if ( !d->geometry ) diff --git a/src/core/geometry/qgsgeometry.h b/src/core/geometry/qgsgeometry.h index 9b2826c4530..2ca2df13542 100644 --- a/src/core/geometry/qgsgeometry.h +++ b/src/core/geometry/qgsgeometry.h @@ -363,6 +363,11 @@ class CORE_EXPORT QgsGeometry static QgsGeometry createWedgeBufferFromAngles( const QgsPoint ¢er, double startAngle, double endAngle, double outerRadius, double innerRadius = 0 ); + /** + * Returns a user friendly name as a string out of the type + */ + static QString name( Qgis::GeometryType type ); + /** * Set the geometry, feeding in the buffer containing OGC Well-Known Binary and the buffer's length. * This class will take ownership of the buffer. @@ -387,6 +392,11 @@ class CORE_EXPORT QgsGeometry */ Qgis::GeometryType type() const SIP_HOLDGIL; + /** + * Returns the type name as a QString + */ + QString typeName() const SIP_HOLDGIL; + /** * Returns TRUE if the geometry is empty (eg a linestring with no vertices, * or a collection with no geometries). A null geometry will always diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 5163e183a66..abc85334d32 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3054,12 +3054,7 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa else if ( paramValue.userType() == qMetaTypeId< QgsGeometry>() ) { const QgsGeometry g = paramValue.value(); - if ( !g.isNull() ) - { - const QString wkt = g.asWkt(); - return QStringLiteral( "wkt(%1)" ).arg( wkt ); - } - return QStringLiteral( "wkt(null)" ); + return g.typeName(); } else if ( paramValue.userType() == qMetaTypeId() ) @@ -3068,20 +3063,15 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa if ( !g.isNull() ) { const QString wkt = g.asWkt(); - return QStringLiteral( "[%1] wkt(%2)" ).arg( g.crs().authid(), wkt ); + return QStringLiteral( "[%1] %2" ).arg( g.crs().authid(), g.typeName() ); } - return QStringLiteral( "wkt(null)" ); + return g.typeName(); } if ( paramValue.userType() == qMetaTypeId() ) { const QgsGeometry g = QgsGeometry::fromRect( paramValue.value() ); - if ( !g.isNull() ) - { - const QString wkt = g.asWkt(); - return QStringLiteral( "wkt(%1)" ).arg( wkt ); - } - return QStringLiteral( "wkt(null)" ); + return g.typeName(); } else if ( paramValue.userType() == qMetaTypeId() ) @@ -3090,9 +3080,9 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa if ( !g.isNull() ) { const QString wkt = g.asWkt(); - return QStringLiteral( "[%1] wkt(%2)" ).arg( g.crs().authid(), wkt ); + return QStringLiteral( "[%1] %2" ).arg( g.crs().authid(), g.typeName() ); } - return QStringLiteral( "wkt(null)" ); + return g.typeName(); } else if ( paramValue.userType() == qMetaTypeId() ) diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index e49aa7a1bd5..aa0f6d9eb0e 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -467,8 +467,10 @@ class CORE_EXPORT QgsProcessingParameterDefinition virtual QColor modelColor() const; /** - * Get a user friendly string representation of the provided parameter value. - * (Meant to be override by child classes to adapt to specific param types) + * Returns a user-friendly string representation of the provided parameter \a value. + * + * The returned string is to be used for display purposes only, and should be translated as required. + * \since QGIS 3.44 */ virtual QString getUserFriendlyValue( QVariant paramValue ) const; From 17b26806d645cb79928e6926c67822c6afe8acf0 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 13:29:31 +0200 Subject: [PATCH 27/42] wkt encoded geometries now display geom type in graphic item --- .../auto_additions/qgsprocessingparameters.py | 8 +-- .../processing/qgsprocessingparameters.sip.in | 18 ++--- .../auto_additions/qgsprocessingparameters.py | 8 +-- .../processing/qgsprocessingparameters.sip.in | 18 ++--- .../processing/qgsprocessingparameters.cpp | 69 +++++++++++-------- src/core/processing/qgsprocessingparameters.h | 16 ++--- .../models/qgsmodelcomponentgraphicitem.cpp | 7 +- 7 files changed, 64 insertions(+), 80 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py index 22e80f7084b..76b3e836223 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py @@ -76,7 +76,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -131,7 +131,7 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -177,7 +177,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -383,7 +383,7 @@ try: except (NameError, AttributeError): pass try: - QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'getUserFriendlyValue', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] + QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'userFriendlyString', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type'] QgsProcessingParameterDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index e1e8f7c5149..79aa152505e 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -369,7 +369,7 @@ Constructor for QgsProcessingParameterDefinition. A color to represent the default parameter %End - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; %Docstring Returns a user-friendly string representation of the provided parameter ``value``. @@ -377,7 +377,7 @@ Returns a user-friendly string representation of the provided parameter The returned string is to be used for display purposes only, and should be translated as required. -.. versionadded:: 3.44 +.. versionadded:: 4.0 %End virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/; @@ -1936,12 +1936,8 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; -%Docstring -Get a user friendly string representation of the provided parameter -value. -%End static QString typeName(); %Docstring @@ -2571,7 +2567,7 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; virtual QgsProcessingParameterDistance *clone() const /Factory/; @@ -3043,12 +3039,8 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; -%Docstring -Get a user friendly string representation of the provided parameter -value. -%End static QString typeName(); %Docstring diff --git a/python/core/auto_additions/qgsprocessingparameters.py b/python/core/auto_additions/qgsprocessingparameters.py index 22e80f7084b..76b3e836223 100644 --- a/python/core/auto_additions/qgsprocessingparameters.py +++ b/python/core/auto_additions/qgsprocessingparameters.py @@ -76,7 +76,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterCrs.typeName = staticmethod(QgsProcessingParameterCrs.typeName) QgsProcessingParameterCrs.fromScriptCode = staticmethod(QgsProcessingParameterCrs.fromScriptCode) - QgsProcessingParameterCrs.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] + QgsProcessingParameterCrs.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsString', 'valueAsJsonObject'] QgsProcessingParameterCrs.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -131,7 +131,7 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterDistance.typeName = staticmethod(QgsProcessingParameterDistance.typeName) - QgsProcessingParameterDistance.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDistance.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterDistance.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -177,7 +177,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterEnum.typeName = staticmethod(QgsProcessingParameterEnum.typeName) QgsProcessingParameterEnum.fromScriptCode = staticmethod(QgsProcessingParameterEnum.fromScriptCode) - QgsProcessingParameterEnum.__overridden_methods__ = ['getUserFriendlyValue', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterEnum.__overridden_methods__ = ['userFriendlyString', 'clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] QgsProcessingParameterEnum.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -383,7 +383,7 @@ try: except (NameError, AttributeError): pass try: - QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'getUserFriendlyValue', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] + QgsProcessingParameterDefinition.__virtual_methods__ = ['modelColor', 'userFriendlyString', 'isDestination', 'checkValueIsAcceptable', 'valueAsPythonString', 'valueAsJsonObject', 'valueAsString', 'valueAsStringList', 'valueAsPythonComment', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'dependsOnOtherParameters', 'toolTip'] QgsProcessingParameterDefinition.__abstract_methods__ = ['clone', 'type'] QgsProcessingParameterDefinition.__group__ = ['processing'] except (NameError, AttributeError): diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index ea656bb9a80..1b06ebc0392 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -369,7 +369,7 @@ Constructor for QgsProcessingParameterDefinition. A color to represent the default parameter %End - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; %Docstring Returns a user-friendly string representation of the provided parameter ``value``. @@ -377,7 +377,7 @@ Returns a user-friendly string representation of the provided parameter The returned string is to be used for display purposes only, and should be translated as required. -.. versionadded:: 3.44 +.. versionadded:: 4.0 %End virtual QgsProcessingParameterDefinition *clone() const = 0 /Factory/; @@ -1936,12 +1936,8 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; -%Docstring -Get a user friendly string representation of the provided parameter -value. -%End static QString typeName(); %Docstring @@ -2571,7 +2567,7 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; virtual QgsProcessingParameterDistance *clone() const /Factory/; @@ -3043,12 +3039,8 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; -%Docstring -Get a user friendly string representation of the provided parameter -value. -%End static QString typeName(); %Docstring diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index abc85334d32..00e2e2f5a43 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3032,18 +3032,18 @@ QColor QgsProcessingParameterDefinition::modelColor() const return QgsProcessingParameterType::defaultModelColor(); } -QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramValue ) const +QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) const { - if ( paramValue.userType() == qMetaTypeId() ) + if ( value.userType() == qMetaTypeId() ) { - const QgsPointXY r = paramValue.value(); + const QgsPointXY r = value.value(); return QStringLiteral( "%1, %2" ).arg( qgsDoubleToString( r.x(), 4 ), qgsDoubleToString( r.y(), 4 ) ); } - else if ( paramValue.userType() == qMetaTypeId() ) + else if ( value.userType() == qMetaTypeId() ) { - const QgsReferencedPointXY r = paramValue.value(); + const QgsReferencedPointXY r = value.value(); return QStringLiteral( "[%1] %1, %3" ).arg( r.crs().authid(), qgsDoubleToString( r.x() ), @@ -3051,43 +3051,41 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa ); } - else if ( paramValue.userType() == qMetaTypeId< QgsGeometry>() ) + else if ( value.userType() == qMetaTypeId< QgsGeometry>() ) { - const QgsGeometry g = paramValue.value(); + const QgsGeometry g = value.value(); return g.typeName(); } - else if ( paramValue.userType() == qMetaTypeId() ) + else if ( value.userType() == qMetaTypeId() ) { - const QgsReferencedGeometry g = paramValue.value(); + const QgsReferencedGeometry g = value.value(); if ( !g.isNull() ) { - const QString wkt = g.asWkt(); return QStringLiteral( "[%1] %2" ).arg( g.crs().authid(), g.typeName() ); } return g.typeName(); } - if ( paramValue.userType() == qMetaTypeId() ) + if ( value.userType() == qMetaTypeId() ) { - const QgsGeometry g = QgsGeometry::fromRect( paramValue.value() ); + const QgsGeometry g = QgsGeometry::fromRect( value.value() ); return g.typeName(); } - else if ( paramValue.userType() == qMetaTypeId() ) + else if ( value.userType() == qMetaTypeId() ) { - const QgsReferencedGeometry g = QgsReferencedGeometry::fromReferencedRect( paramValue.value() ); + const QgsReferencedGeometry g = QgsReferencedGeometry::fromReferencedRect( value.value() ); if ( !g.isNull() ) { - const QString wkt = g.asWkt(); return QStringLiteral( "[%1] %2" ).arg( g.crs().authid(), g.typeName() ); } return g.typeName(); } - else if ( paramValue.userType() == qMetaTypeId() ) + else if ( value.userType() == qMetaTypeId() ) { - const QgsProcessingOutputLayerDefinition fromVar = qvariant_cast( paramValue ); + const QgsProcessingOutputLayerDefinition fromVar = qvariant_cast( value ); if ( fromVar.sink.propertyType() == Qgis::PropertyType::Static ) { return fromVar.sink.staticValue().toString(); @@ -3097,9 +3095,9 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa return fromVar.sink.asExpression(); } } - else if ( paramValue.userType() == QMetaType::Type::QDateTime ) + else if ( value.userType() == QMetaType::Type::QDateTime ) { - const QDateTime dt = paramValue.toDateTime(); + const QDateTime dt = value.toDateTime(); if ( !dt.isValid() ) return QStringLiteral( "invalid datetime" ); else @@ -3112,9 +3110,9 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa .arg( dt.time().second() ); } - else if ( paramValue.userType() == QMetaType::Type::QDate ) + else if ( value.userType() == QMetaType::Type::QDate ) { - const QDate dt = paramValue.toDate(); + const QDate dt = value.toDate(); if ( !dt.isValid() ) return QStringLiteral( "invalid date" ); else @@ -3124,9 +3122,9 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa .arg( dt.day() ); } - else if ( paramValue.userType() == QMetaType::Type::QTime ) + else if ( value.userType() == QMetaType::Type::QTime ) { - const QTime dt = paramValue.toTime(); + const QTime dt = value.toTime(); if ( !dt.isValid() ) return QStringLiteral( "invalid time" ); else @@ -3136,7 +3134,18 @@ QString QgsProcessingParameterDefinition::getUserFriendlyValue( QVariant paramVa .arg( dt.second() ); } - return paramValue.toString(); + else if ( value.userType() == QMetaType::QString ) + { + // In the case of a WKT-(string) encoded geometry, the type of geometry is going to be displayed + // rather than the possibly very long WKT payload + QgsGeometry g = QgsGeometry::fromWkt( value.toString() ); + if ( !g.isNull() ) + { + return g.typeName(); + } + } + + return value.toString(); } QString QgsProcessingParameterBoolean::valueAsPythonString( const QVariant &val, QgsProcessingContext & ) const @@ -3298,9 +3307,9 @@ QgsProcessingParameterCrs *QgsProcessingParameterCrs::fromScriptCode( const QStr return new QgsProcessingParameterCrs( name, description, definition.compare( QLatin1String( "none" ), Qt::CaseInsensitive ) == 0 ? QVariant() : definition, isOptional ); } -QString QgsProcessingParameterCrs::getUserFriendlyValue( QVariant paramValue ) const +QString QgsProcessingParameterCrs::userFriendlyString( QVariant &value ) const { - return paramValue.value().authid(); + return value.value().authid(); } QgsProcessingParameterMapLayer::QgsProcessingParameterMapLayer( const QString &name, const QString &description, const QVariant &defaultValue, bool optional, const QList &types ) @@ -5391,9 +5400,9 @@ QString QgsProcessingParameterEnum::asPythonString( const QgsProcessing::PythonO return QString(); } -QString QgsProcessingParameterEnum::getUserFriendlyValue( QVariant paramValue ) const +QString QgsProcessingParameterEnum::userFriendlyString( QVariant &value ) const { - return options().at( paramValue.toInt() ); + return options().at( value.toInt() ); } QStringList QgsProcessingParameterEnum::options() const @@ -7858,9 +7867,9 @@ bool QgsProcessingParameterDistance::fromVariantMap( const QVariantMap &map ) } -QString QgsProcessingParameterDistance::getUserFriendlyValue( QVariant paramValue ) const +QString QgsProcessingParameterDistance::userFriendlyString( QVariant &value ) const { - return QStringLiteral( "%1 %2" ).arg( paramValue.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); + return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); } diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index aa0f6d9eb0e..87b3b37fb65 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -470,9 +470,9 @@ class CORE_EXPORT QgsProcessingParameterDefinition * Returns a user-friendly string representation of the provided parameter \a value. * * The returned string is to be used for display purposes only, and should be translated as required. - * \since QGIS 3.44 + * \since QGIS 4.0 */ - virtual QString getUserFriendlyValue( QVariant paramValue ) const; + virtual QString userFriendlyString( QVariant &value ) const; /** * Creates a clone of the parameter definition. @@ -1826,10 +1826,7 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - /** - * Get a user friendly string representation of the provided parameter value. - */ - QString getUserFriendlyValue( QVariant paramValue ) const override; + QString userFriendlyString( QVariant &value ) const override; /** * Returns the type name for the parameter class. @@ -2381,7 +2378,7 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter */ static QString typeName() { return QStringLiteral( "distance" ); } // cppcheck-suppress duplInheritedMember - QString getUserFriendlyValue( QVariant paramValue ) const override; + QString userFriendlyString( QVariant &value ) const override; QgsProcessingParameterDistance *clone() const override SIP_FACTORY; @@ -2803,10 +2800,7 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi bool optional = false, bool usesStaticStrings = false ); - /** - * Get a user friendly string representation of the provided parameter value. - */ - QString getUserFriendlyValue( QVariant paramValue ) const override; + QString userFriendlyString( QVariant &value ) const override; /** * Returns the type name for the parameter class. diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 596a1cbcb63..f26b81f7527 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -847,7 +847,6 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const return QString(); } - if ( const QgsProcessingModelParameter *parameter = dynamic_cast< const QgsProcessingModelParameter * >( component() ) ) { QString text = this->model()->parameterDefinition( parameter->parameterName() )->type(); @@ -859,14 +858,12 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const if ( paramValue.isValid() ) { - text += ": " + paramDef->getUserFriendlyValue( paramValue ); + text += ": " + paramDef->userFriendlyString( paramValue ); } } - return truncatedTextForItem( text ); } - return QString(); } @@ -1316,7 +1313,7 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind case Qgis::ProcessingModelChildParameterSource::StaticValue: default: QVariant paramValue = paramSources[0].staticValue(); - paramValueAsStr = QStringLiteral( ": %1" ).arg( param->getUserFriendlyValue( paramValue ) ); + paramValueAsStr = QStringLiteral( ": %1" ).arg( param->userFriendlyString( paramValue ) ); } title += paramValueAsStr; } From 8bd12426d7862354b84a9e007d484e0178f1bf9f Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 14:23:09 +0200 Subject: [PATCH 28/42] add translations for invalid data time --- src/core/processing/qgsprocessingparameters.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 00e2e2f5a43..167fe13c9f5 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3062,7 +3062,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) const QgsReferencedGeometry g = value.value(); if ( !g.isNull() ) { - return QStringLiteral( "[%1] %2" ).arg( g.crs().authid(), g.typeName() ); + return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), g.typeName() ); } return g.typeName(); } @@ -3078,7 +3078,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) const QgsReferencedGeometry g = QgsReferencedGeometry::fromReferencedRect( value.value() ); if ( !g.isNull() ) { - return QStringLiteral( "[%1] %2" ).arg( g.crs().authid(), g.typeName() ); + return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), g.typeName() ); } return g.typeName(); } @@ -3099,7 +3099,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) { const QDateTime dt = value.toDateTime(); if ( !dt.isValid() ) - return QStringLiteral( "invalid datetime" ); + return QObject::tr( "Invalid datetime" ); else return QStringLiteral( "%1-%2-%3T%4:%5:%6" ) .arg( dt.date().year() ) @@ -3114,7 +3114,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) { const QDate dt = value.toDate(); if ( !dt.isValid() ) - return QStringLiteral( "invalid date" ); + return QObject::tr( "Invalid date" ); else return QStringLiteral( "%1-%2-%3" ) .arg( dt.year() ) @@ -3126,7 +3126,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) { const QTime dt = value.toTime(); if ( !dt.isValid() ) - return QStringLiteral( "invalid time" ); + return QObject::tr( "Invalid time" ); else return QStringLiteral( "%4:%5:%6" ) .arg( dt.hour() ) @@ -3145,6 +3145,8 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) } } + qDebug() << value ; + return value.toString(); } From 293be699031f9df67cfb1d9297046f7a5820ecae Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 14:29:43 +0200 Subject: [PATCH 29/42] better crs string --- src/core/processing/qgsprocessingparameters.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 167fe13c9f5..dec0833e048 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3727,7 +3727,7 @@ QString QgsProcessingParameterExtent::valueAsPythonString( const QVariant &value qgsDoubleToString( r.yMinimum() ), qgsDoubleToString( r.xMaximum() ), qgsDoubleToString( r.yMaximum() ), - r.crs().authid() ); + r.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ); } else if ( value.userType() == qMetaTypeId< QgsGeometry>() ) { From 9c1035e773fb79faa95dc87b63436dcb09fd7810 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 14:54:48 +0200 Subject: [PATCH 30/42] rename method to socketColor --- .../processing/models/qgsmodelgraphicitem.sip.in | 12 ++++++++---- .../processing/models/qgsmodelgraphicitem.sip.in | 12 ++++++++---- src/core/processing/qgsprocessingparameters.cpp | 2 -- src/gui/processing/models/qgsmodelgraphicitem.cpp | 10 +++++----- src/gui/processing/models/qgsmodelgraphicitem.h | 14 ++++++++++---- 5 files changed, 31 insertions(+), 19 deletions(-) diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in index 4606554205b..bc35554cf6e 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in @@ -179,15 +179,19 @@ Return the component associated to the socket */ %Docstring Return the parent graphic item associated to the socket */ %End - QColor getColor(); + QColor socketColor() const; %Docstring Returns the color of the socket based on the type of data the param -corresponds to */ +corresponds to. + +.. versionadded:: 4.0 %End - bool isDefaultParamValue(); + bool isDefaultParameterValue() const; %Docstring -Returns whether the param value bear the default param value */ +Returns ``True`` if the parameter is set to the default parameter value. + +.. versionadded:: 4.0 %End signals: diff --git a/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in index 4606554205b..bc35554cf6e 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in @@ -179,15 +179,19 @@ Return the component associated to the socket */ %Docstring Return the parent graphic item associated to the socket */ %End - QColor getColor(); + QColor socketColor() const; %Docstring Returns the color of the socket based on the type of data the param -corresponds to */ +corresponds to. + +.. versionadded:: 4.0 %End - bool isDefaultParamValue(); + bool isDefaultParameterValue() const; %Docstring -Returns whether the param value bear the default param value */ +Returns ``True`` if the parameter is set to the default parameter value. + +.. versionadded:: 4.0 %End signals: diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index dec0833e048..415ce2ad47f 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3145,8 +3145,6 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) } } - qDebug() << value ; - return value.toString(); } diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index dc68d8eefb0..724797304d4 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -185,12 +185,12 @@ QgsModelDesignerSocketGraphicItem::QgsModelDesignerSocketGraphicItem( QgsModelCo void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * ) { - QColor outlineColor = getColor(); + QColor outlineColor = socketColor(); QColor fillColor = QColor( outlineColor ); if ( isInput() ) { - fillColor.setAlpha( isDefaultParamValue() ? 30 : 255 ); + fillColor.setAlpha( isDefaultParameterValue() ? 30 : 255 ); } else { @@ -222,13 +222,13 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp } -QColor QgsModelDesignerSocketGraphicItem::getColor() +QColor QgsModelDesignerSocketGraphicItem::socketColor() const { - return componentItem()->getLinkColor( mEdge, mIndex ); + return mComponentItem->getLinkColor( mEdge, mIndex ); } -bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() +bool QgsModelDesignerSocketGraphicItem::isDefaultParameterValue() const { if ( !mComponent ) { diff --git a/src/gui/processing/models/qgsmodelgraphicitem.h b/src/gui/processing/models/qgsmodelgraphicitem.h index 3bbbc619631..a62805cfa8f 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.h +++ b/src/gui/processing/models/qgsmodelgraphicitem.h @@ -195,11 +195,17 @@ class GUI_EXPORT QgsModelDesignerSocketGraphicItem : public QgsModelDesignerFlat /** Return the parent graphic item associated to the socket */ QgsModelComponentGraphicItem *componentItem() { return mComponentItem; }; - /* Returns the color of the socket based on the type of data the param corresponds to */ - QColor getColor(); + /* + * Returns the color of the socket based on the type of data the param corresponds to. + * \since QGIS 4.0 + */ + QColor socketColor() const; - /* Returns whether the param value bear the default param value */ - bool isDefaultParamValue(); + /* + * Returns TRUE if the parameter is set to the default parameter value. + * \since QGIS 4.0 + */ + bool isDefaultParameterValue() const; signals: From 3f5c2a7a1b7bdfd3976ab68ae2e8a7d24dccc57b Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 14:56:50 +0200 Subject: [PATCH 31/42] avoid abbreviations --- src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index f26b81f7527..d670bc3ffc7 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -572,8 +572,8 @@ void QgsModelComponentGraphicItem::fold( Qt::Edge edge, bool folded ) } else if ( QgsProcessingModelParameter *param = dynamic_cast( mComponent.get() ) ) { - QgsProcessingModelParameter paramComp = mModel->parameterComponent( param->parameterName() ); - paramComp.setLinksCollapsed( edge, folded ); + QgsProcessingModelParameter parameterComponent = mModel->parameterComponent( param->parameterName() ); + parameterComponent.setLinksCollapsed( edge, folded ); } else if ( QgsProcessingModelOutput *output = dynamic_cast( mComponent.get() ) ) { From 93dd35920ad79900ceceaef10baa4c0e72905dc5 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 14:57:20 +0200 Subject: [PATCH 32/42] avoid abbreviations 2 --- src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index d670bc3ffc7..e59fb698657 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -765,8 +765,8 @@ QgsModelParameterGraphicItem::QgsModelParameterGraphicItem( QgsProcessingModelPa svg.render( &painter ); painter.end(); - if ( const QgsProcessingParameterDefinition *paramDef = model->parameterDefinition( parameter->parameterName() ) ) - setLabel( paramDef->description() ); + if ( const QgsProcessingParameterDefinition *parameterDefinition = model->parameterDefinition( parameter->parameterName() ) ) + setLabel( parameterDefinition->description() ); else setLabel( QObject::tr( "Error (%1)" ).arg( parameter->parameterName() ) ); } From 2743ea2fa70d8b6454296a7e5519f7e283d35420 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 15:03:18 +0200 Subject: [PATCH 33/42] avoid abbreviations 3 --- .../models/qgsmodelcomponentgraphicitem.cpp | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index e59fb698657..40df6e4475a 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -1276,46 +1276,45 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name ); - QString paramValueAsStr = ""; + QString parameterValueAsString; if ( paramSources.size() > 0 ) { - QgsProcessingModelChildParameterSource firstParamSource = paramSources[0]; + QgsProcessingModelChildParameterSource firstParameterSource = paramSources[0]; - switch ( firstParamSource.source() ) + switch ( firstParameterSource.source() ) { case Qgis::ProcessingModelChildParameterSource::ChildOutput: - paramValueAsStr = QStringLiteral( ": %1" ).arg( - firstParamSource.friendlyIdentifier( const_cast( model() ) ) + parameterValueAsString = QStringLiteral( ": %1" ).arg( + firstParameterSource.friendlyIdentifier( const_cast( model() ) ) ); break; case Qgis::ProcessingModelChildParameterSource::Expression: - paramValueAsStr = QStringLiteral( ": %1" ).arg( firstParamSource.expression() ); + parameterValueAsString = QStringLiteral( ": %1" ).arg( firstParameterSource.expression() ); break; case Qgis::ProcessingModelChildParameterSource::ExpressionText: - paramValueAsStr = QStringLiteral( ": %1" ).arg( firstParamSource.expressionText() ); + parameterValueAsString = QStringLiteral( ": %1" ).arg( firstParameterSource.expressionText() ); break; case Qgis::ProcessingModelChildParameterSource::ModelOutput: - paramValueAsStr = QStringLiteral( ": <%1>" ).arg( firstParamSource.friendlyIdentifier( const_cast( model() ) ) ); + parameterValueAsString = QStringLiteral( ": <%1>" ).arg( firstParameterSource.friendlyIdentifier( const_cast( model() ) ) ); break; case Qgis::ProcessingModelChildParameterSource::ModelParameter: { - QString friendlyName = firstParamSource.friendlyIdentifier( const_cast( model() ) ); - // paramValueAsStr = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": value from '%1'" ).arg( friendlyName ); - paramValueAsStr = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": <%1>" ).arg( friendlyName ); + const QString friendlyName = firstParameterSource.friendlyIdentifier( const_cast( model() ) ); + parameterValueAsString = friendlyName.isEmpty() ? QStringLiteral( ":" ) : QStringLiteral( ": <%1>" ).arg( friendlyName ); break; } case Qgis::ProcessingModelChildParameterSource::StaticValue: default: QVariant paramValue = paramSources[0].staticValue(); - paramValueAsStr = QStringLiteral( ": %1" ).arg( param->userFriendlyString( paramValue ) ); + parameterValueAsString = QStringLiteral( ": %1" ).arg( param->userFriendlyString( paramValue ) ); } - title += paramValueAsStr; + title += parameterValueAsString; } return truncatedTextForItem( title ); From 16cdae82cee19f253de3ed778e7f82d53e6096e9 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 15:27:19 +0200 Subject: [PATCH 34/42] Better function naming --- .../gui/auto_additions/qgsmodelcomponentgraphicitem.py | 4 ++-- .../models/qgsmodelcomponentgraphicitem.sip.in | 10 +++++----- .../gui/auto_additions/qgsmodelcomponentgraphicitem.py | 4 ++-- .../models/qgsmodelcomponentgraphicitem.sip.in | 10 +++++----- src/gui/processing/models/qgsmodelarrowitem.cpp | 4 ++-- .../processing/models/qgsmodelcomponentgraphicitem.cpp | 8 ++++---- .../processing/models/qgsmodelcomponentgraphicitem.h | 10 +++++----- src/gui/processing/models/qgsmodelgraphicitem.cpp | 2 +- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py b/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py index 378eac4ebf9..98d15dc082a 100644 --- a/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py +++ b/python/PyQt6/gui/auto_additions/qgsmodelcomponentgraphicitem.py @@ -16,7 +16,7 @@ QgsModelComponentGraphicItem.Flag.__and__ = lambda flag1, flag2: _force_int(flag QgsModelComponentGraphicItem.Flag.__or__ = lambda flag1, flag2: QgsModelComponentGraphicItem.Flag(_force_int(flag1) | _force_int(flag2)) try: QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"} - QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] + QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'linkedParameterDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition'] QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint'] QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']} @@ -30,7 +30,7 @@ try: except (NameError, AttributeError): pass try: - QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'getLinkedParamDataType', 'getLinkColor', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] + QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'linkedParameterDataType', 'linkColor', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] QgsModelParameterGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): pass diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index b5a5aa98b92..cc9eb8d90ad 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -112,7 +112,7 @@ Shows a preview of moving the item from its stored position by ``dx``, Sets a new scene ``rect`` for the item. %End - virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QString linkedParameterDataType( Qt::Edge edge, int index ) const; virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); @@ -328,8 +328,8 @@ Updates the item's button positions, based on the current item rect. QColor fallbackColor() const; %Docstring -Get the fallback color if parameter or output do not have a specific -color +Returns the fallback color if the parameter or output does not have a +specific color. %End }; QFlags operator|(QgsModelComponentGraphicItem::Flag f1, QFlags f2); @@ -369,10 +369,10 @@ Ownership of ``parameter`` is transferred to the item. virtual bool canDeleteComponent(); - virtual QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ); + virtual QString linkedParameterDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const; - virtual QColor getLinkColor( Qt::Edge edge, int index ); + virtual QColor linkColor( Qt::Edge edge, int index ) const; protected: diff --git a/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py b/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py index 9bb04b28e64..321027e2a08 100644 --- a/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py +++ b/python/gui/auto_additions/qgsmodelcomponentgraphicitem.py @@ -1,7 +1,7 @@ # The following has been generated automatically from src/gui/processing/models/qgsmodelcomponentgraphicitem.h try: QgsModelComponentGraphicItem.__attribute_docs__ = {'requestModelRepaint': 'Emitted by the item to request a repaint of the parent model scene.\n', 'aboutToChange': 'Emitted when the definition of the associated component is about to be\nchanged by the item.\n\nThe ``text`` argument gives the translated text describing the change\nabout to occur, and the optional ``id`` can be used to group the\nassociated undo commands.\n', 'changed': 'Emitted when the definition of the associated component is changed by\nthe item.\n', 'repaintArrows': 'Emitted when item requests that all connected arrows are repainted.\n', 'updateArrowPaths': 'Emitted when item requires that all connected arrow paths are\nrecalculated.\n', 'sizePositionChanged': "Emitted when the item's size or position changes.\n"} - QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'getLinkedParamDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] + QgsModelComponentGraphicItem.__virtual_methods__ = ['flags', 'linkedParameterDataType', 'linkPointCount', 'linkPointText', 'editComment', 'canDeleteComponent', 'deleteComponent', 'editComponent', 'strokeStyle', 'titleAlignment', 'iconPicture', 'iconPixmap'] QgsModelComponentGraphicItem.__abstract_methods__ = ['fillColor', 'strokeColor', 'textColor', 'updateStoredComponentPosition'] QgsModelComponentGraphicItem.__overridden_methods__ = ['mouseDoubleClickEvent', 'hoverEnterEvent', 'hoverMoveEvent', 'hoverLeaveEvent', 'itemChange', 'boundingRect', 'contains', 'paint'] QgsModelComponentGraphicItem.__signal_arguments__ = {'aboutToChange': ['text: str', 'id: int = 0']} @@ -15,7 +15,7 @@ try: except (NameError, AttributeError): pass try: - QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'getLinkedParamDataType', 'getLinkColor', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] + QgsModelParameterGraphicItem.__overridden_methods__ = ['contextMenuEvent', 'canDeleteComponent', 'linkedParameterDataType', 'linkColor', 'fillColor', 'strokeColor', 'textColor', 'iconPicture', 'linkPointCount', 'linkPointText', 'updateStoredComponentPosition', 'deleteComponent'] QgsModelParameterGraphicItem.__group__ = ['processing', 'models'] except (NameError, AttributeError): pass diff --git a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index 8f91044f5dc..98c093529d2 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -112,7 +112,7 @@ Shows a preview of moving the item from its stored position by ``dx``, Sets a new scene ``rect`` for the item. %End - virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QString linkedParameterDataType( Qt::Edge edge, int index ) const; virtual void mouseDoubleClickEvent( QGraphicsSceneMouseEvent *event ); @@ -328,8 +328,8 @@ Updates the item's button positions, based on the current item rect. QColor fallbackColor() const; %Docstring -Get the fallback color if parameter or output do not have a specific -color +Returns the fallback color if the parameter or output does not have a +specific color. %End }; QFlags operator|(QgsModelComponentGraphicItem::Flag f1, QFlags f2); @@ -369,10 +369,10 @@ Ownership of ``parameter`` is transferred to the item. virtual bool canDeleteComponent(); - virtual QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ); + virtual QString linkedParameterDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const; - virtual QColor getLinkColor( Qt::Edge edge, int index ); + virtual QColor linkColor( Qt::Edge edge, int index ) const; protected: diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index 69901edfa31..12e2102bb4c 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -73,7 +73,7 @@ QgsModelArrowItem::QgsModelArrowItem( QgsModelComponentGraphicItem *startItem, M void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * ) { - QColor color = mStartItem->getLinkColor( mStartEdge, mStartIndex ); + QColor color = mStartItem->linkColor( mStartEdge, mStartIndex ); if ( mStartItem->state() == QgsModelComponentGraphicItem::Selected || mEndItem->state() == QgsModelComponentGraphicItem::Selected ) color.setAlpha( 220 ); @@ -121,7 +121,7 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem // Set the painter back to regular stroke thickness p = pen(); - QColor endColor = mEndItem->getLinkColor( mEndEdge, mEndIndex ); + QColor endColor = mEndItem->linkColor( mEndEdge, mEndIndex ); color.setAlpha( 255 ); QLinearGradient gradient; diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 40df6e4475a..919d4e0df1a 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -868,7 +868,7 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const } -QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) +QString QgsModelParameterGraphicItem::linkedParameterDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const { if ( index < 0 ) { @@ -884,7 +884,7 @@ QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge /* unused } -QColor QgsModelParameterGraphicItem::getLinkColor( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) +QColor QgsModelParameterGraphicItem::linkColor( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const { if ( index < 0 ) { @@ -1139,7 +1139,7 @@ int QgsModelChildAlgorithmGraphicItem::linkPointCount( Qt::Edge edge ) const } -QString QgsModelComponentGraphicItem::getLinkedParamDataType( Qt::Edge edge, int index ) +QString QgsModelComponentGraphicItem::linkedParameterDataType( Qt::Edge edge, int index ) const { if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast( component() ) ) { @@ -1179,7 +1179,7 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType( Qt::Edge edge, int return QString(); } -QColor QgsModelComponentGraphicItem::getLinkColor( Qt::Edge edge, int index ) +QColor QgsModelComponentGraphicItem::linkColor( Qt::Edge edge, int index ) const { if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast( component() ) ) { diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h index d3dad54fe1d..41614df81ee 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h @@ -137,11 +137,11 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject */ void setItemRect( QRectF rect ); - virtual QString getLinkedParamDataType( Qt::Edge edge, int index ); + virtual QString linkedParameterDataType( Qt::Edge edge, int index ) const; #ifndef SIP_RUN - virtual QColor getLinkColor( Qt::Edge edge, int index ); + virtual QColor linkColor( Qt::Edge edge, int index ) const; /** * Shows a preview of setting a new \a rect for the item. @@ -368,7 +368,7 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject void updateButtonPositions(); /** - * Get the fallback color if parameter or output do not have a specific color + * Returns the fallback color if the parameter or output does not have a specific color. */ QColor fallbackColor() const { return mFallbackColor; }; @@ -437,9 +437,9 @@ class GUI_EXPORT QgsModelParameterGraphicItem : public QgsModelComponentGraphicI void contextMenuEvent( QGraphicsSceneContextMenuEvent *event ) override; bool canDeleteComponent() override; - QString getLinkedParamDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) override; + QString linkedParameterDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const override; - QColor getLinkColor( Qt::Edge edge, int index ) override; + QColor linkColor( Qt::Edge edge, int index ) const override; protected: QColor fillColor( State state ) const override; diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index 724797304d4..a1484b62709 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -224,7 +224,7 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp QColor QgsModelDesignerSocketGraphicItem::socketColor() const { - return mComponentItem->getLinkColor( mEdge, mIndex ); + return mComponentItem->linkColor( mEdge, mIndex ); } From 939fcf9ea2f3d410529eeaf38936a460c617e159 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 19 Jun 2025 15:32:10 +0200 Subject: [PATCH 35/42] using static default color --- .../processing/qgsprocessingparametertype.sip.in | 12 +++++++++++- .../processing/qgsprocessingparametertype.sip.in | 12 +++++++++++- src/core/processing/qgsprocessingparametertype.cpp | 2 +- src/core/processing/qgsprocessingparametertype.h | 11 ++++++++++- 4 files changed, 33 insertions(+), 4 deletions(-) diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in index 5b5fd267ea3..18ee600dbd3 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in @@ -24,6 +24,11 @@ Makes metadata of processing parameters available. public: static QColor defaultModelColor(); +%Docstring +Returns the default color for a processing parameter. + +.. versionadded:: 4.0 +%End virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/; %Docstring @@ -181,7 +186,12 @@ for the parameter. virtual QColor modelColor() const; %Docstring -A color to represent the default parameter +Returns the color to use for the parameter in model designer windows. + +The default implementation retrieves the color from the parameter type, +see :py:func:`QgsProcessingParameterType.modelColor()`. + +.. versionadded:: 4.0 %End }; diff --git a/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in b/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in index 5b5fd267ea3..18ee600dbd3 100644 --- a/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in @@ -24,6 +24,11 @@ Makes metadata of processing parameters available. public: static QColor defaultModelColor(); +%Docstring +Returns the default color for a processing parameter. + +.. versionadded:: 4.0 +%End virtual QgsProcessingParameterDefinition *create( const QString &name ) const = 0 /Factory/; %Docstring @@ -181,7 +186,12 @@ for the parameter. virtual QColor modelColor() const; %Docstring -A color to represent the default parameter +Returns the color to use for the parameter in model designer windows. + +The default implementation retrieves the color from the parameter type, +see :py:func:`QgsProcessingParameterType.modelColor()`. + +.. versionadded:: 4.0 %End }; diff --git a/src/core/processing/qgsprocessingparametertype.cpp b/src/core/processing/qgsprocessingparametertype.cpp index 0326c8c4492..105a3675270 100644 --- a/src/core/processing/qgsprocessingparametertype.cpp +++ b/src/core/processing/qgsprocessingparametertype.cpp @@ -59,5 +59,5 @@ QList QgsProcessingParameterType::acceptedDataTypes( const QgsProcessingPar QColor QgsProcessingParameterType::modelColor() const { - return QColor( 128, 128, 128 ); /* mid gray */ + return defaultModelColor(); } diff --git a/src/core/processing/qgsprocessingparametertype.h b/src/core/processing/qgsprocessingparametertype.h index 8ffb037cfb0..45f20572aa8 100644 --- a/src/core/processing/qgsprocessingparametertype.h +++ b/src/core/processing/qgsprocessingparametertype.h @@ -34,6 +34,11 @@ class CORE_EXPORT QgsProcessingParameterType { public: + /** + * Returns the default color for a processing parameter. + * + * \since QGIS 4.0 + */ static QColor defaultModelColor(); /** @@ -174,7 +179,11 @@ class CORE_EXPORT QgsProcessingParameterType virtual QList acceptedDataTypes( const QgsProcessingParameterDefinition *parameter ) const; /** - * A color to represent the default parameter + * Returns the color to use for the parameter in model designer windows. + * + * The default implementation retrieves the color from the parameter type, see QgsProcessingParameterType::modelColor(). + * + * \since QGIS 4.0 */ virtual QColor modelColor() const; From b1fcfad0fab4c1b0491f48ee21139bdaa3281ade Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Fri, 20 Jun 2025 10:24:06 +0200 Subject: [PATCH 36/42] updating comments --- .../auto_generated/processing/qgsprocessingparameters.sip.in | 5 ++++- .../auto_generated/processing/qgsprocessingparameters.sip.in | 5 ++++- src/core/processing/qgsprocessingparameters.h | 4 +++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index 79aa152505e..cf6e86ccce6 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -366,7 +366,10 @@ Constructor for QgsProcessingParameterDefinition. virtual QColor modelColor() const; %Docstring -A color to represent the default parameter +Returns the color to use for the parameter type in model designer +windows. + +.. versionadded:: 4.0 %End virtual QString userFriendlyString( QVariant &value ) const; diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 1b06ebc0392..71bc68f893f 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -366,7 +366,10 @@ Constructor for QgsProcessingParameterDefinition. virtual QColor modelColor() const; %Docstring -A color to represent the default parameter +Returns the color to use for the parameter type in model designer +windows. + +.. versionadded:: 4.0 %End virtual QString userFriendlyString( QVariant &value ) const; diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index 87b3b37fb65..8031fcf2ac7 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -462,7 +462,9 @@ class CORE_EXPORT QgsProcessingParameterDefinition virtual ~QgsProcessingParameterDefinition() = default; /** - * A color to represent the default parameter + * Returns the color to use for the parameter type in model designer windows. + * + * \since QGIS 4.0 */ virtual QColor modelColor() const; From 40b7b183588c0b74a28f0ffd21545c9e5ba01bdb Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Mon, 23 Jun 2025 17:35:03 +0200 Subject: [PATCH 37/42] WIP userFriendlString testing --- .../processing/qgsprocessingparameters.sip.in | 10 +-- .../processing/qgsprocessingparameters.sip.in | 10 +-- .../processing/qgsprocessingparameters.cpp | 62 ++++++++++++++----- src/core/processing/qgsprocessingparameters.h | 10 +-- .../models/qgsmodelcomponentgraphicitem.cpp | 4 +- tests/src/analysis/testqgsprocessing.cpp | 9 +++ 6 files changed, 72 insertions(+), 33 deletions(-) diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index cf6e86ccce6..730a1049f87 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -372,7 +372,7 @@ windows. .. versionadded:: 4.0 %End - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; %Docstring Returns a user-friendly string representation of the provided parameter ``value``. @@ -1939,7 +1939,7 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; static QString typeName(); @@ -2115,7 +2115,7 @@ Sets the allow multipart geometries .. seealso:: :py:func:`allowMultipart` %End - + QString userFriendlyString( const QVariant &value ) const; static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/; %Docstring @@ -2570,7 +2570,7 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; virtual QgsProcessingParameterDistance *clone() const /Factory/; @@ -3042,7 +3042,7 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; static QString typeName(); diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 71bc68f893f..794799d0673 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -372,7 +372,7 @@ windows. .. versionadded:: 4.0 %End - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; %Docstring Returns a user-friendly string representation of the provided parameter ``value``. @@ -1939,7 +1939,7 @@ A coordinate reference system parameter for processing algorithms. Constructor for QgsProcessingParameterCrs. %End - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; static QString typeName(); @@ -2115,7 +2115,7 @@ Sets the allow multipart geometries .. seealso:: :py:func:`allowMultipart` %End - + QString userFriendlyString( const QVariant &value ) const; static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/; %Docstring @@ -2570,7 +2570,7 @@ Constructor for QgsProcessingParameterDistance. Returns the type name for the parameter class. %End - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; virtual QgsProcessingParameterDistance *clone() const /Factory/; @@ -3042,7 +3042,7 @@ values. Constructor for QgsProcessingParameterEnum. %End - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; static QString typeName(); diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 415ce2ad47f..8a7721162cf 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3032,7 +3032,7 @@ QColor QgsProcessingParameterDefinition::modelColor() const return QgsProcessingParameterType::defaultModelColor(); } -QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) const +QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &value ) const { if ( value.userType() == qMetaTypeId() ) { @@ -3134,20 +3134,26 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value ) .arg( dt.second() ); } - else if ( value.userType() == QMetaType::QString ) - { - // In the case of a WKT-(string) encoded geometry, the type of geometry is going to be displayed - // rather than the possibly very long WKT payload - QgsGeometry g = QgsGeometry::fromWkt( value.toString() ); - if ( !g.isNull() ) - { - return g.typeName(); - } - } + // else if ( value.userType() == QMetaType::QString ) + // { + // // In the case of a WKT-(string) encoded geometry, the type of geometry is going to be displayed + // // rather than the possibly very long WKT payload + // QgsGeometry g = QgsGeometry::fromWkt( value.toString() ); + // if ( !g.isNull() ) + // { + // return g.typeName(); + // } + // } - return value.toString(); + // return value.toString(); + return QStringLiteral( "%1 :: %2" ) + .arg( value.userType() ) + .arg( value.toString() ); + + // return value.userType() } + QString QgsProcessingParameterBoolean::valueAsPythonString( const QVariant &val, QgsProcessingContext & ) const { if ( !val.isValid() ) @@ -3307,11 +3313,18 @@ QgsProcessingParameterCrs *QgsProcessingParameterCrs::fromScriptCode( const QStr return new QgsProcessingParameterCrs( name, description, definition.compare( QLatin1String( "none" ), Qt::CaseInsensitive ) == 0 ? QVariant() : definition, isOptional ); } -QString QgsProcessingParameterCrs::userFriendlyString( QVariant &value ) const + +QString QgsProcessingParameterCrs::userFriendlyString( const QVariant &value ) const { - return value.value().authid(); + QgsCoordinateReferenceSystem crs( value.toString() ); + if ( crs.isValid() ) + return crs.userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ); + + return QObject::tr( "Invalid CRS" ); } + + QgsProcessingParameterMapLayer::QgsProcessingParameterMapLayer( const QString &name, const QString &description, const QVariant &defaultValue, bool optional, const QList &types ) : QgsProcessingParameterDefinition( name, description, defaultValue, optional ) , QgsProcessingParameterLimitedDataTypes( types ) @@ -3875,6 +3888,7 @@ QgsProcessingParameterPoint *QgsProcessingParameterPoint::fromScriptCode( const return new QgsProcessingParameterPoint( name, description, definition, isOptional ); } + QgsProcessingParameterGeometry::QgsProcessingParameterGeometry( const QString &name, const QString &description, const QVariant &defaultValue, bool optional, const QList &geometryTypes, bool allowMultipart ) : QgsProcessingParameterDefinition( name, description, defaultValue, optional ), @@ -4146,6 +4160,22 @@ QgsProcessingParameterGeometry *QgsProcessingParameterGeometry::fromScriptCode( return new QgsProcessingParameterGeometry( name, description, definition, isOptional ); } +QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &value ) const +{ + if ( value.isValid() && value.userType() == QMetaType::QString ) + { + // In the case of a WKT-(string) encoded geometry, the type of geometry is going to be displayed + // rather than the possibly very long WKT payload + QgsGeometry g = QgsGeometry::fromWkt( value.toString() ); + if ( !g.isNull() ) + { + return g.typeName(); + } + } + + return QObject::tr( "Invalid geometry" ); +} + QgsProcessingParameterFile::QgsProcessingParameterFile( const QString &name, const QString &description, Qgis::ProcessingFileParameterBehavior behavior, const QString &extension, const QVariant &defaultValue, bool optional, const QString &fileFilter ) : QgsProcessingParameterDefinition( name, description, defaultValue, optional ) , mBehavior( behavior ) @@ -5400,7 +5430,7 @@ QString QgsProcessingParameterEnum::asPythonString( const QgsProcessing::PythonO return QString(); } -QString QgsProcessingParameterEnum::userFriendlyString( QVariant &value ) const +QString QgsProcessingParameterEnum::userFriendlyString( const QVariant &value ) const { return options().at( value.toInt() ); } @@ -7867,7 +7897,7 @@ bool QgsProcessingParameterDistance::fromVariantMap( const QVariantMap &map ) } -QString QgsProcessingParameterDistance::userFriendlyString( QVariant &value ) const +QString QgsProcessingParameterDistance::userFriendlyString( const QVariant &value ) const { return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); } diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index 8031fcf2ac7..b5f89d4a9b2 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -474,7 +474,7 @@ class CORE_EXPORT QgsProcessingParameterDefinition * The returned string is to be used for display purposes only, and should be translated as required. * \since QGIS 4.0 */ - virtual QString userFriendlyString( QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; /** * Creates a clone of the parameter definition. @@ -1828,7 +1828,7 @@ class CORE_EXPORT QgsProcessingParameterCrs : public QgsProcessingParameterDefin QgsProcessingParameterCrs( const QString &name, const QString &description = QString(), const QVariant &defaultValue = QVariant(), bool optional = false ); - QString userFriendlyString( QVariant &value ) const override; + QString userFriendlyString( const QVariant &value ) const override; /** * Returns the type name for the parameter class. @@ -1978,7 +1978,7 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter */ void setAllowMultipart( bool allowMultipart ) { mAllowMultipart = allowMultipart; } - + QString userFriendlyString( const QVariant &value ) const; /** * Creates a new parameter using the definition from a script code. @@ -2380,7 +2380,7 @@ class CORE_EXPORT QgsProcessingParameterDistance : public QgsProcessingParameter */ static QString typeName() { return QStringLiteral( "distance" ); } // cppcheck-suppress duplInheritedMember - QString userFriendlyString( QVariant &value ) const override; + QString userFriendlyString( const QVariant &value ) const override; QgsProcessingParameterDistance *clone() const override SIP_FACTORY; @@ -2802,7 +2802,7 @@ class CORE_EXPORT QgsProcessingParameterEnum : public QgsProcessingParameterDefi bool optional = false, bool usesStaticStrings = false ); - QString userFriendlyString( QVariant &value ) const override; + QString userFriendlyString( const QVariant &value ) const override; /** * Returns the type name for the parameter class. diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index 919d4e0df1a..474a2dde9ab 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -854,7 +854,7 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const // Getting the default value to append to the box name if ( const QgsProcessingParameterDefinition *paramDef = this->model()->parameterDefinition( parameter->parameterName() ) ) { - QVariant paramValue = paramDef->defaultValue(); + const QVariant paramValue = paramDef->defaultValue(); if ( paramValue.isValid() ) { @@ -1311,7 +1311,7 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind case Qgis::ProcessingModelChildParameterSource::StaticValue: default: - QVariant paramValue = paramSources[0].staticValue(); + const QVariant paramValue = paramSources[0].staticValue(); parameterValueAsString = QStringLiteral( ": %1" ).arg( param->userFriendlyString( paramValue ) ); } title += parameterValueAsString; diff --git a/tests/src/analysis/testqgsprocessing.cpp b/tests/src/analysis/testqgsprocessing.cpp index 1068f150afa..d56f2672eee 100644 --- a/tests/src/analysis/testqgsprocessing.cpp +++ b/tests/src/analysis/testqgsprocessing.cpp @@ -2995,6 +2995,9 @@ void TestQgsProcessing::parameterBoolean() QCOMPARE( def->valueAsPythonString( QVariant(), context ), QStringLiteral( "None" ) ); QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) ); + QCOMPARE( def->userFriendlyString( QVariant( true ) ), QString( "true" ) ); + QCOMPARE( def->userFriendlyString( QVariant( false ) ), QString( "false" ) ); + QString pythonCode = def->asPythonString(); QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterBoolean('non_optional_default_false', '', defaultValue=None)" ) ); @@ -3210,6 +3213,8 @@ void TestQgsProcessing::parameterCrs() QVERIFY( def->checkValueIsAcceptable( QgsProcessingFeatureSourceDefinition( QgsProperty::fromValue( QVariant::fromValue( r1 ) ) ) ) ); QVERIFY( def->checkValueIsAcceptable( QgsProcessingOutputLayerDefinition( r1->id() ) ) ); + QCOMPARE( def->userFriendlyString( QVariant( "EPSG:3857" ) ), QgsCoordinateReferenceSystem( QVariant( "EPSG:3857" ).toString() ).userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ); + // using map layer QVariantMap params; params.insert( "non_optional", v1->id() ); @@ -6394,6 +6399,10 @@ void TestQgsProcessing::parameterEnum() QCOMPARE( def->valueAsPythonComment( QVariantList() << 1 << 2, context ), QStringLiteral( "B,C" ) ); QCOMPARE( def->valueAsPythonComment( QStringLiteral( "1,2" ), context ), QStringLiteral( "B,C" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 0 ) ), QString( "A" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 1 ) ), QString( "B" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 2 ) ), QString( "C" ) ); + pythonCode = def->asPythonString(); QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterEnum('non_optional', '', options=['A','B','C'], allowMultiple=True, usesStaticStrings=False, defaultValue=5)" ) ); From e30a729a28134f69a9a4388f5ec37feedd5e5adc Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 3 Jul 2025 11:54:34 +0200 Subject: [PATCH 38/42] fix friendly string for point, add UT --- src/core/processing/qgsprocessingparameters.cpp | 16 +++++++++------- tests/src/analysis/testqgsprocessing.cpp | 10 ++++++++++ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 8a7721162cf..a17fe94d572 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3044,10 +3044,10 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va else if ( value.userType() == qMetaTypeId() ) { const QgsReferencedPointXY r = value.value(); - return QStringLiteral( "[%1] %1, %3" ).arg( + return QStringLiteral( "[%1] %2, %3" ).arg( r.crs().authid(), - qgsDoubleToString( r.x() ), - qgsDoubleToString( r.y() ) + qgsDoubleToString( r.x(), 4 ), + qgsDoubleToString( r.y(), 4 ) ); } @@ -3078,6 +3078,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va const QgsReferencedGeometry g = QgsReferencedGeometry::fromReferencedRect( value.value() ); if ( !g.isNull() ) { + return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), g.typeName() ); } return g.typeName(); @@ -3145,10 +3146,11 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va // } // } - // return value.toString(); - return QStringLiteral( "%1 :: %2" ) - .arg( value.userType() ) - .arg( value.toString() ); + return value.toString(); + + // return QStringLiteral( "%1 :: %2" ) + // .arg( value.userType() ) + // .arg( value.toString() ); // return value.userType() } diff --git a/tests/src/analysis/testqgsprocessing.cpp b/tests/src/analysis/testqgsprocessing.cpp index d56f2672eee..07aa3751b71 100644 --- a/tests/src/analysis/testqgsprocessing.cpp +++ b/tests/src/analysis/testqgsprocessing.cpp @@ -3874,6 +3874,10 @@ void TestQgsProcessing::parameterExtent() QCOMPARE( def->valueAsJsonObject( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QVariant( QStringLiteral( "c:\\test\\new data\\test.dat" ) ) ); QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) ); + QCOMPARE( def->userFriendlyString( QgsReferencedRectangle( QgsRectangle( 11, 12, 13, 14 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ) ), QStringLiteral( "[EPSG:4326] Polygon" ) ); + QCOMPARE( def->userFriendlyString( QgsRectangle( 11, 12, 13, 14 ) ), QStringLiteral( "Polygon" ) ); + QCOMPARE( def->userFriendlyString( QVariant( "1,2,3,4" ) ), QStringLiteral( "1,2,3,4" ) ); + bool ok = false; QCOMPARE( def->valueAsString( QVariant(), context, ok ), QString() ); QVERIFY( ok ); @@ -4115,6 +4119,12 @@ void TestQgsProcessing::parameterPoint() QCOMPARE( def->valueAsJsonObject( QgsReferencedPointXY( QgsPointXY( 11, 12 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ), context ), QVariant( QStringLiteral( "11,12 [EPSG:4326]" ) ) ); QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) ); + QCOMPARE( def->userFriendlyString( QgsReferencedPointXY( QgsPointXY( 11, 12 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ) ), QStringLiteral( "[EPSG:4326] 11, 12" ) ); + QCOMPARE( def->userFriendlyString( QgsPointXY( 11, 12 ) ), QStringLiteral( "11, 12" ) ); + + QCOMPARE( def->userFriendlyString( QgsReferencedPointXY( QgsPointXY( 11.1, 12.2 ), QgsCoordinateReferenceSystem( "epsg:4326" ) ) ), QStringLiteral( "[EPSG:4326] 11.1, 12.2" ) ); + QCOMPARE( def->userFriendlyString( QgsPointXY( 11.1, 12.2 ) ), QStringLiteral( "11.1, 12.2" ) ); + bool ok = false; QCOMPARE( def->valueAsString( QVariant(), context, ok ), QString() ); QVERIFY( ok ); From 64bef5c2905ec460e4101b7383cb8f5bacd936f2 Mon Sep 17 00:00:00 2001 From: jonathanlurie Date: Thu, 3 Jul 2025 16:38:43 +0200 Subject: [PATCH 39/42] adding some more UT --- .../auto_additions/qgsprocessingparameters.py | 10 +- .../processing/qgsprocessingparameters.sip.in | 11 +- .../auto_additions/qgsprocessingparameters.py | 10 +- .../processing/qgsprocessingparameters.sip.in | 11 +- .../processing/qgsprocessingparameters.cpp | 161 +++++++++--------- src/core/processing/qgsprocessingparameters.h | 6 +- tests/src/analysis/testqgsprocessing.cpp | 24 +++ 7 files changed, 142 insertions(+), 91 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py index 76b3e836223..4f1fad6548f 100644 --- a/python/PyQt6/core/auto_additions/qgsprocessingparameters.py +++ b/python/PyQt6/core/auto_additions/qgsprocessingparameters.py @@ -97,7 +97,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -137,19 +137,19 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterArea.typeName = staticmethod(QgsProcessingParameterArea.typeName) - QgsProcessingParameterArea.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterArea.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterArea.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVolume.typeName = staticmethod(QgsProcessingParameterVolume.typeName) - QgsProcessingParameterVolume.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVolume.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterVolume.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index 730a1049f87..07cea353250 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -2115,7 +2115,8 @@ Sets the allow multipart geometries .. seealso:: :py:func:`allowMultipart` %End - QString userFriendlyString( const QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; + static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/; %Docstring @@ -2711,6 +2712,8 @@ Sets the default area ``unit`` for the parameter. virtual bool fromVariantMap( const QVariantMap &map ); + virtual QString userFriendlyString( const QVariant &value ) const; + }; @@ -2801,6 +2804,8 @@ Sets the default volume ``unit`` for the parameter. virtual bool fromVariantMap( const QVariantMap &map ); + virtual QString userFriendlyString( const QVariant &value ) const; + }; @@ -2860,6 +2865,8 @@ Sets the default duration ``unit`` for the parameter. virtual bool fromVariantMap( const QVariantMap &map ); + virtual QString userFriendlyString( const QVariant &value ) const; + }; @@ -4801,6 +4808,8 @@ Sets the acceptable data ``type`` for the parameter. virtual bool fromVariantMap( const QVariantMap &map ); + virtual QString userFriendlyString( const QVariant &value ) const; + static QgsProcessingParameterDateTime *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/; %Docstring diff --git a/python/core/auto_additions/qgsprocessingparameters.py b/python/core/auto_additions/qgsprocessingparameters.py index 76b3e836223..4f1fad6548f 100644 --- a/python/core/auto_additions/qgsprocessingparameters.py +++ b/python/core/auto_additions/qgsprocessingparameters.py @@ -97,7 +97,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterGeometry.typeName = staticmethod(QgsProcessingParameterGeometry.typeName) QgsProcessingParameterGeometry.fromScriptCode = staticmethod(QgsProcessingParameterGeometry.fromScriptCode) - QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterGeometry.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'asScriptCode', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterGeometry.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -137,19 +137,19 @@ except (NameError, AttributeError): pass try: QgsProcessingParameterArea.typeName = staticmethod(QgsProcessingParameterArea.typeName) - QgsProcessingParameterArea.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterArea.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterArea.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterVolume.typeName = staticmethod(QgsProcessingParameterVolume.typeName) - QgsProcessingParameterVolume.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterVolume.__overridden_methods__ = ['clone', 'type', 'dependsOnOtherParameters', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterVolume.__group__ = ['processing'] except (NameError, AttributeError): pass try: QgsProcessingParameterDuration.typeName = staticmethod(QgsProcessingParameterDuration.typeName) - QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDuration.__overridden_methods__ = ['clone', 'type', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterDuration.__group__ = ['processing'] except (NameError, AttributeError): pass @@ -320,7 +320,7 @@ except (NameError, AttributeError): try: QgsProcessingParameterDateTime.typeName = staticmethod(QgsProcessingParameterDateTime.typeName) QgsProcessingParameterDateTime.fromScriptCode = staticmethod(QgsProcessingParameterDateTime.fromScriptCode) - QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap'] + QgsProcessingParameterDateTime.__overridden_methods__ = ['clone', 'type', 'checkValueIsAcceptable', 'valueAsPythonString', 'toolTip', 'asPythonString', 'toVariantMap', 'fromVariantMap', 'userFriendlyString'] QgsProcessingParameterDateTime.__group__ = ['processing'] except (NameError, AttributeError): pass diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 794799d0673..7bf4918ae9a 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -2115,7 +2115,8 @@ Sets the allow multipart geometries .. seealso:: :py:func:`allowMultipart` %End - QString userFriendlyString( const QVariant &value ) const; + virtual QString userFriendlyString( const QVariant &value ) const; + static QgsProcessingParameterGeometry *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/; %Docstring @@ -2711,6 +2712,8 @@ Sets the default area ``unit`` for the parameter. virtual bool fromVariantMap( const QVariantMap &map ); + virtual QString userFriendlyString( const QVariant &value ) const; + }; @@ -2801,6 +2804,8 @@ Sets the default volume ``unit`` for the parameter. virtual bool fromVariantMap( const QVariantMap &map ); + virtual QString userFriendlyString( const QVariant &value ) const; + }; @@ -2860,6 +2865,8 @@ Sets the default duration ``unit`` for the parameter. virtual bool fromVariantMap( const QVariantMap &map ); + virtual QString userFriendlyString( const QVariant &value ) const; + }; @@ -4801,6 +4808,8 @@ Sets the acceptable data ``type`` for the parameter. virtual bool fromVariantMap( const QVariantMap &map ); + virtual QString userFriendlyString( const QVariant &value ) const; + static QgsProcessingParameterDateTime *fromScriptCode( const QString &name, const QString &description, bool isOptional, const QString &definition ) /Factory/; %Docstring diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index a17fe94d572..a96e3f053c3 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3051,23 +3051,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va ); } - else if ( value.userType() == qMetaTypeId< QgsGeometry>() ) - { - const QgsGeometry g = value.value(); - return g.typeName(); - } - - else if ( value.userType() == qMetaTypeId() ) - { - const QgsReferencedGeometry g = value.value(); - if ( !g.isNull() ) - { - return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), g.typeName() ); - } - return g.typeName(); - } - - if ( value.userType() == qMetaTypeId() ) + else if ( value.userType() == qMetaTypeId() ) { const QgsGeometry g = QgsGeometry::fromRect( value.value() ); return g.typeName(); @@ -3096,63 +3080,8 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va return fromVar.sink.asExpression(); } } - else if ( value.userType() == QMetaType::Type::QDateTime ) - { - const QDateTime dt = value.toDateTime(); - if ( !dt.isValid() ) - return QObject::tr( "Invalid datetime" ); - else - return QStringLiteral( "%1-%2-%3T%4:%5:%6" ) - .arg( dt.date().year() ) - .arg( dt.date().month() ) - .arg( dt.date().day() ) - .arg( dt.time().hour() ) - .arg( dt.time().minute() ) - .arg( dt.time().second() ); - } - - else if ( value.userType() == QMetaType::Type::QDate ) - { - const QDate dt = value.toDate(); - if ( !dt.isValid() ) - return QObject::tr( "Invalid date" ); - else - return QStringLiteral( "%1-%2-%3" ) - .arg( dt.year() ) - .arg( dt.month() ) - .arg( dt.day() ); - } - - else if ( value.userType() == QMetaType::Type::QTime ) - { - const QTime dt = value.toTime(); - if ( !dt.isValid() ) - return QObject::tr( "Invalid time" ); - else - return QStringLiteral( "%4:%5:%6" ) - .arg( dt.hour() ) - .arg( dt.minute() ) - .arg( dt.second() ); - } - - // else if ( value.userType() == QMetaType::QString ) - // { - // // In the case of a WKT-(string) encoded geometry, the type of geometry is going to be displayed - // // rather than the possibly very long WKT payload - // QgsGeometry g = QgsGeometry::fromWkt( value.toString() ); - // if ( !g.isNull() ) - // { - // return g.typeName(); - // } - // } return value.toString(); - - // return QStringLiteral( "%1 :: %2" ) - // .arg( value.userType() ) - // .arg( value.toString() ); - - // return value.userType() } @@ -4164,15 +4093,35 @@ QgsProcessingParameterGeometry *QgsProcessingParameterGeometry::fromScriptCode( QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &value ) const { - if ( value.isValid() && value.userType() == QMetaType::QString ) + if ( value.isValid() ) { - // In the case of a WKT-(string) encoded geometry, the type of geometry is going to be displayed - // rather than the possibly very long WKT payload - QgsGeometry g = QgsGeometry::fromWkt( value.toString() ); - if ( !g.isNull() ) + + if ( value.userType() == qMetaTypeId< QgsGeometry>() ) { + const QgsGeometry g = value.value(); return g.typeName(); } + + else if ( value.userType() == qMetaTypeId() ) + { + const QgsReferencedGeometry g = value.value(); + if ( !g.isNull() ) + { + return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), g.typeName() ); + } + return g.typeName(); + } + + else if ( value.userType() == QMetaType::QString ) + { + // In the case of a WKT-(string) encoded geometry, the type of geometry is going to be displayed + // rather than the possibly very long WKT payload + QgsGeometry g = QgsGeometry::fromWkt( value.toString() ); + if ( !g.isNull() ) + { + return g.typeName(); + } + } } return QObject::tr( "Invalid geometry" ); @@ -7905,7 +7854,6 @@ QString QgsProcessingParameterDistance::userFriendlyString( const QVariant &valu } - // // QgsProcessingParameterArea // @@ -7987,6 +7935,11 @@ bool QgsProcessingParameterArea::fromVariantMap( const QVariantMap &map ) } +QString QgsProcessingParameterArea::userFriendlyString( const QVariant &value ) const +{ + return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toString( defaultUnit() ) ); +} + // // QgsProcessingParameterVolume @@ -8068,6 +8021,10 @@ bool QgsProcessingParameterVolume::fromVariantMap( const QVariantMap &map ) return true; } +QString QgsProcessingParameterVolume::userFriendlyString( const QVariant &value ) const +{ + return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toString( defaultUnit() ) ); +} // // QgsProcessingParameterDuration @@ -8125,6 +8082,11 @@ bool QgsProcessingParameterDuration::fromVariantMap( const QVariantMap &map ) return true; } +QString QgsProcessingParameterDuration::userFriendlyString( const QVariant &value ) const +{ + return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); +} + // // QgsProcessingParameterScale @@ -8982,6 +8944,49 @@ QgsProcessingParameterDateTime *QgsProcessingParameterDateTime::fromScriptCode( } +QString QgsProcessingParameterDateTime:: userFriendlyString( const QVariant &value ) const +{ + if ( value.userType() == QMetaType::Type::QDateTime ) + { + const QDateTime dt = value.toDateTime(); + if ( !dt.isValid() ) + return QObject::tr( "Invalid datetime" ); + else + return QStringLiteral( "%1-%2-%3T%4:%5:%6" ) + .arg( dt.date().year() ) + .arg( dt.date().month() ) + .arg( dt.date().day() ) + .arg( dt.time().hour() ) + .arg( dt.time().minute() ) + .arg( dt.time().second() ); + } + + else if ( value.userType() == QMetaType::Type::QDate ) + { + const QDate dt = value.toDate(); + if ( !dt.isValid() ) + return QObject::tr( "Invalid date" ); + else + return QStringLiteral( "%1-%2-%3" ) + .arg( dt.year() ) + .arg( dt.month() ) + .arg( dt.day() ); + } + + else if ( value.userType() == QMetaType::Type::QTime ) + { + const QTime dt = value.toTime(); + if ( !dt.isValid() ) + return QObject::tr( "Invalid time" ); + else + return QStringLiteral( "%4:%5:%6" ) + .arg( dt.hour() ) + .arg( dt.minute() ) + .arg( dt.second() ); + } + + return value.toString(); +} // // QgsProcessingParameterProviderConnection diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index b5f89d4a9b2..b7c764de946 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -1978,7 +1978,7 @@ class CORE_EXPORT QgsProcessingParameterGeometry : public QgsProcessingParameter */ void setAllowMultipart( bool allowMultipart ) { mAllowMultipart = allowMultipart; } - QString userFriendlyString( const QVariant &value ) const; + QString userFriendlyString( const QVariant &value ) const override; /** * Creates a new parameter using the definition from a script code. @@ -2501,6 +2501,7 @@ class CORE_EXPORT QgsProcessingParameterArea : public QgsProcessingParameterNumb QVariantMap toVariantMap() const override; bool fromVariantMap( const QVariantMap &map ) override; + QString userFriendlyString( const QVariant &value ) const override; private: @@ -2584,6 +2585,7 @@ class CORE_EXPORT QgsProcessingParameterVolume : public QgsProcessingParameterNu QVariantMap toVariantMap() const override; bool fromVariantMap( const QVariantMap &map ) override; + QString userFriendlyString( const QVariant &value ) const override; private: @@ -2640,6 +2642,7 @@ class CORE_EXPORT QgsProcessingParameterDuration : public QgsProcessingParameter QVariantMap toVariantMap() const override; bool fromVariantMap( const QVariantMap &map ) override; + QString userFriendlyString( const QVariant &value ) const override; private: @@ -4289,6 +4292,7 @@ class CORE_EXPORT QgsProcessingParameterDateTime : public QgsProcessingParameter QVariantMap toVariantMap() const override; bool fromVariantMap( const QVariantMap &map ) override; + QString userFriendlyString( const QVariant &value ) const override; /** * Creates a new parameter using the definition from a script code. diff --git a/tests/src/analysis/testqgsprocessing.cpp b/tests/src/analysis/testqgsprocessing.cpp index 07aa3751b71..17931ab94fe 100644 --- a/tests/src/analysis/testqgsprocessing.cpp +++ b/tests/src/analysis/testqgsprocessing.cpp @@ -4340,6 +4340,10 @@ void TestQgsProcessing::parameterGeometry() // With Srid as string QCOMPARE( def->valueAsPythonString( QgsReferencedGeometry( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), QgsCoordinateReferenceSystem( "EPSG:4326" ) ), context ), QStringLiteral( "'CRS=EPSG:4326;LineString (10 10, 20 20)'" ) ); + QCOMPARE( def->userFriendlyString( QgsGeometry::fromWkt( QStringLiteral( "Polygon ((11.1 12.2, 13.3 12.2, 13.3 14.4, 11.1 14.4, 11.1 12.2))" ) ) ), QStringLiteral( "Polygon" ) ); + QCOMPARE( def->userFriendlyString( QgsReferencedGeometry( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), QgsCoordinateReferenceSystem( "EPSG:4326" ) ) ), QStringLiteral( "[EPSG:4326] Line" ) ); + QCOMPARE( def->userFriendlyString( QStringLiteral( "Polygon ((11.1 12.2, 13.3 12.2, 13.3 14.4, 11.1 14.4, 11.1 12.2))" ) ), QStringLiteral( "Polygon" ) ); + QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( "LineString( 10 10, 20 20)", context ), QVariant( QStringLiteral( "LineString( 10 10, 20 20)" ) ) ); QCOMPARE( def->valueAsJsonObject( QgsGeometry::fromWkt( QStringLiteral( "LineString( 10 10, 20 20)" ) ), context ), QVariant( QStringLiteral( "LineString (10 10, 20 20)" ) ) ); @@ -4519,6 +4523,8 @@ void TestQgsProcessing::parameterFile() QCOMPARE( def->valueAsJsonObject( "uri='complex' username=\"complex\"", context ), QVariant( QStringLiteral( "uri='complex' username=\"complex\"" ) ) ); QCOMPARE( def->valueAsJsonObject( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QVariant( QStringLiteral( "c:\\test\\new data\\test.dat" ) ) ); + QCOMPARE( def->userFriendlyString( "bricks.bmp" ), QStringLiteral( "bricks.bmp" ) ); + const QString testDataDir = QStringLiteral( TEST_DATA_DIR ) + '/'; //defined in CmakeLists.txt // ensure valueAsJsonObject doesn't try to load a file path as a layer QCOMPARE( context.temporaryLayerStore()->count(), 0 ); @@ -5270,6 +5276,8 @@ void TestQgsProcessing::parameterDistance() QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) ); QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5 ft" ) ); + QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) ); QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) ); @@ -5385,6 +5393,7 @@ void TestQgsProcessing::parameterArea() QCOMPARE( def->valueAsPythonString( 5, context ), QStringLiteral( "5" ) ); QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) ); QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5 square feet" ) ); QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) ); @@ -5501,6 +5510,7 @@ void TestQgsProcessing::parameterVolume() QCOMPARE( def->valueAsPythonString( 5, context ), QStringLiteral( "5" ) ); QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) ); QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5 cubic feet" ) ); QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) ); @@ -5614,6 +5624,8 @@ void TestQgsProcessing::parameterDuration() QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) ); QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5 d" ) ); + QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) ); QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) ); @@ -5717,6 +5729,8 @@ void TestQgsProcessing::parameterScale() QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) ); QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5" ) ); + QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( "5" ) ); QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) ); @@ -5836,6 +5850,8 @@ void TestQgsProcessing::parameterNumber() QCOMPARE( def->valueAsPythonString( QStringLiteral( "1.1" ), context ), QStringLiteral( "1.1" ) ); QCOMPARE( def->valueAsPythonString( QVariant::fromValue( QgsProperty::fromExpression( "\"a\"=1" ) ), context ), QStringLiteral( "QgsProperty.fromExpression('\"a\"=1')" ) ); + QCOMPARE( def->userFriendlyString( QVariant( 5 ) ), QStringLiteral( "5" ) ); + QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( "5" ) ); QCOMPARE( def->valueAsJsonObject( QStringLiteral( "1.1" ), context ), QVariant( QStringLiteral( "1.1" ) ) ); @@ -6664,6 +6680,8 @@ void TestQgsProcessing::parameterString() QCOMPARE( def->valueAsPythonString( "uri='complex' username=\"complex\"", context ), QStringLiteral( "'uri=\\'complex\\' username=\"complex\"'" ) ); QCOMPARE( def->valueAsPythonString( QStringLiteral( "c:\\test\\new data\\test.dat" ), context ), QStringLiteral( "'c:\\\\test\\\\new data\\\\test.dat'" ) ); + QCOMPARE( def->userFriendlyString( QVariant( "Hello" ) ), QStringLiteral( "Hello" ) ); + QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( 5, context ), QVariant( 5 ) ); QCOMPARE( def->valueAsJsonObject( QStringLiteral( "abc" ), context ), QVariant( QStringLiteral( "abc" ) ) ); @@ -9681,6 +9699,8 @@ void TestQgsProcessing::parameterColor() QCOMPARE( def->valueAsPythonString( QColor( 255, 0, 0 ), context ), QStringLiteral( "QColor(255, 0, 0)" ) ); QCOMPARE( def->valueAsPythonString( QColor( 255, 0, 0, 100 ), context ), QStringLiteral( "QColor(255, 0, 0, 100)" ) ); + QCOMPARE( def->userFriendlyString( QColor( 255, 0, 0 ) ), QStringLiteral( "#ff0000" ) ); + QCOMPARE( def->valueAsJsonObject( QVariant(), context ), QVariant() ); QCOMPARE( def->valueAsJsonObject( QStringLiteral( "#ff0000" ), context ), QVariant( QStringLiteral( "#ff0000" ) ) ); QCOMPARE( def->valueAsJsonObject( QColor(), context ), QVariant( QString() ) ); @@ -11144,6 +11164,10 @@ void TestQgsProcessing::parameterDateTime() QCOMPARE( def->valueAsString( QDate( 2014, 12, 31 ), context, ok ), QStringLiteral( "2014-12-31" ) ); QVERIFY( ok ); + QCOMPARE( def->userFriendlyString( QDate( 2014, 12, 31 ) ), QStringLiteral( "2014-12-31" ) ); + QCOMPARE( def->userFriendlyString( QTime( 12, 11, 10 ) ), QStringLiteral( "12:11:10" ) ); + QCOMPARE( def->userFriendlyString( QDateTime( QDate( 2014, 12, 31 ), QTime( 12, 11, 10 ) ) ), QStringLiteral( "2014-12-31T12:11:10" ) ); + pythonCode = def->asPythonString(); QCOMPARE( pythonCode, QStringLiteral( "QgsProcessingParameterDateTime('non_optional', '', type=QgsProcessingParameterDateTime.Date, minValue=QDateTime(QDate(2015, 1, 1), QTime(0, 0, 0)), maxValue=QDateTime(QDate(2015, 12, 31), QTime(0, 0, 0)), defaultValue=QDate(2010, 4, 3))" ) ); From e6efa0a5c609fe2a52593f8251231a09f5da6f0d Mon Sep 17 00:00:00 2001 From: Jonathan Lurie Date: Thu, 4 Sep 2025 13:32:32 +0200 Subject: [PATCH 40/42] fix after review --- .../PyQt6/core/auto_additions/qgsgeometry.py | 1 - .../geometry/qgsgeometry.sip.in | 10 -------- .../processing/qgsprocessingoutputs.sip.in | 2 +- .../processing/qgsprocessingparameters.sip.in | 6 +++-- .../qgsprocessingparametertype.sip.in | 4 ++-- .../qgsmodelcomponentgraphicitem.sip.in | 2 ++ .../models/qgsmodelgraphicitem.sip.in | 2 -- python/core/auto_additions/qgsgeometry.py | 1 - .../geometry/qgsgeometry.sip.in | 10 -------- .../processing/qgsprocessingoutputs.sip.in | 2 +- .../processing/qgsprocessingparameters.sip.in | 6 +++-- .../qgsprocessingparametertype.sip.in | 4 ++-- .../qgsmodelcomponentgraphicitem.sip.in | 2 ++ .../models/qgsmodelgraphicitem.sip.in | 1 - src/core/geometry/qgsgeometry.cpp | 23 ------------------- src/core/geometry/qgsgeometry.h | 10 -------- src/core/processing/qgsprocessingoutputs.h | 2 +- .../processing/qgsprocessingparameters.cpp | 14 +++++------ src/core/processing/qgsprocessingparameters.h | 4 +++- .../processing/qgsprocessingparametertype.h | 2 +- .../processing/models/qgsmodelarrowitem.cpp | 2 +- .../models/qgsmodelcomponentgraphicitem.cpp | 6 ++--- .../models/qgsmodelcomponentgraphicitem.h | 2 ++ 23 files changed, 35 insertions(+), 83 deletions(-) diff --git a/python/PyQt6/core/auto_additions/qgsgeometry.py b/python/PyQt6/core/auto_additions/qgsgeometry.py index 3af46379076..c8dc6afb58e 100644 --- a/python/PyQt6/core/auto_additions/qgsgeometry.py +++ b/python/PyQt6/core/auto_additions/qgsgeometry.py @@ -14,7 +14,6 @@ try: QgsGeometry.collectGeometry = staticmethod(QgsGeometry.collectGeometry) QgsGeometry.createWedgeBuffer = staticmethod(QgsGeometry.createWedgeBuffer) QgsGeometry.createWedgeBufferFromAngles = staticmethod(QgsGeometry.createWedgeBufferFromAngles) - QgsGeometry.name = staticmethod(QgsGeometry.name) QgsGeometry.unaryUnion = staticmethod(QgsGeometry.unaryUnion) QgsGeometry.polygonize = staticmethod(QgsGeometry.polygonize) QgsGeometry.fromQPointF = staticmethod(QgsGeometry.fromQPointF) diff --git a/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in b/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in index a1ec175e5d0..931d6ce6911 100644 --- a/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in +++ b/python/PyQt6/core/auto_generated/geometry/qgsgeometry.sip.in @@ -329,11 +329,6 @@ Polygon geometry. .. versionadded:: 3.40 %End - static QString name( Qgis::GeometryType type ); -%Docstring -Returns a user friendly name as a string out of the type -%End - void fromWkb( const QByteArray &wkb ); %Docstring @@ -353,11 +348,6 @@ etc.) Returns type of the geometry as a :py:class:`Qgis`.GeometryType .. seealso:: :py:func:`wkbType` -%End - - QString typeName() const /HoldGIL/; -%Docstring -Returns the type name as a string %End bool isEmpty() const /HoldGIL/; diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 218046cdb53..5bb1fff8e14 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -69,7 +69,7 @@ Constructor for QgsProcessingOutputDefinition. %Docstring Returns the color to use for the output in model designer windows. -.. versionadded:: 3.44 +.. versionadded:: 4.0 %End virtual QString type() const = 0; diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in index 07cea353250..6d3495e57d1 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -366,8 +366,10 @@ Constructor for QgsProcessingParameterDefinition. virtual QColor modelColor() const; %Docstring -Returns the color to use for the parameter type in model designer -windows. +Returns the color to use for the parameter in model designer windows. + +The default implementation retrieves the color from the parameter type, +see :py:func:`QgsProcessingParameterType.modelColor()`. .. versionadded:: 4.0 %End diff --git a/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in b/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in index 18ee600dbd3..6e61be5eaed 100644 --- a/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in +++ b/python/PyQt6/core/auto_generated/processing/qgsprocessingparametertype.sip.in @@ -188,8 +188,8 @@ for the parameter. %Docstring Returns the color to use for the parameter in model designer windows. -The default implementation retrieves the color from the parameter type, -see :py:func:`QgsProcessingParameterType.modelColor()`. +The default implementation returns +:py:func:`~QgsProcessingParameterType.defaultModelColor`. .. versionadded:: 4.0 %End diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index cc9eb8d90ad..8f164be25ba 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -330,6 +330,8 @@ Updates the item's button positions, based on the current item rect. %Docstring Returns the fallback color if the parameter or output does not have a specific color. + +.. versionadded:: 4.0 %End }; QFlags operator|(QgsModelComponentGraphicItem::Flag f1, QFlags f2); diff --git a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in index a01a8afbc65..81eb8a98cc2 100644 --- a/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in +++ b/python/PyQt6/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in @@ -182,7 +182,6 @@ Return the component associated to the socket. %Docstring Return the parent graphic item associated to the socket. %End - QColor socketColor() const; %Docstring Returns the color of the socket based on the type of data the param @@ -200,7 +199,6 @@ Returns ``True`` if the parameter is set to the default parameter value. signals: - }; diff --git a/python/core/auto_additions/qgsgeometry.py b/python/core/auto_additions/qgsgeometry.py index 3af46379076..c8dc6afb58e 100644 --- a/python/core/auto_additions/qgsgeometry.py +++ b/python/core/auto_additions/qgsgeometry.py @@ -14,7 +14,6 @@ try: QgsGeometry.collectGeometry = staticmethod(QgsGeometry.collectGeometry) QgsGeometry.createWedgeBuffer = staticmethod(QgsGeometry.createWedgeBuffer) QgsGeometry.createWedgeBufferFromAngles = staticmethod(QgsGeometry.createWedgeBufferFromAngles) - QgsGeometry.name = staticmethod(QgsGeometry.name) QgsGeometry.unaryUnion = staticmethod(QgsGeometry.unaryUnion) QgsGeometry.polygonize = staticmethod(QgsGeometry.polygonize) QgsGeometry.fromQPointF = staticmethod(QgsGeometry.fromQPointF) diff --git a/python/core/auto_generated/geometry/qgsgeometry.sip.in b/python/core/auto_generated/geometry/qgsgeometry.sip.in index 59eb8bed271..8e46bfa96b0 100644 --- a/python/core/auto_generated/geometry/qgsgeometry.sip.in +++ b/python/core/auto_generated/geometry/qgsgeometry.sip.in @@ -329,11 +329,6 @@ Polygon geometry. .. versionadded:: 3.40 %End - static QString name( Qgis::GeometryType type ); -%Docstring -Returns a user friendly name as a string out of the type -%End - void fromWkb( const QByteArray &wkb ); %Docstring @@ -353,11 +348,6 @@ etc.) Returns type of the geometry as a :py:class:`Qgis`.GeometryType .. seealso:: :py:func:`wkbType` -%End - - QString typeName() const /HoldGIL/; -%Docstring -Returns the type name as a string %End bool isEmpty() const /HoldGIL/; diff --git a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in index 218046cdb53..5bb1fff8e14 100644 --- a/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingoutputs.sip.in @@ -69,7 +69,7 @@ Constructor for QgsProcessingOutputDefinition. %Docstring Returns the color to use for the output in model designer windows. -.. versionadded:: 3.44 +.. versionadded:: 4.0 %End virtual QString type() const = 0; diff --git a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in index 7bf4918ae9a..04c22c6dfda 100644 --- a/python/core/auto_generated/processing/qgsprocessingparameters.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparameters.sip.in @@ -366,8 +366,10 @@ Constructor for QgsProcessingParameterDefinition. virtual QColor modelColor() const; %Docstring -Returns the color to use for the parameter type in model designer -windows. +Returns the color to use for the parameter in model designer windows. + +The default implementation retrieves the color from the parameter type, +see :py:func:`QgsProcessingParameterType.modelColor()`. .. versionadded:: 4.0 %End diff --git a/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in b/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in index 18ee600dbd3..6e61be5eaed 100644 --- a/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in +++ b/python/core/auto_generated/processing/qgsprocessingparametertype.sip.in @@ -188,8 +188,8 @@ for the parameter. %Docstring Returns the color to use for the parameter in model designer windows. -The default implementation retrieves the color from the parameter type, -see :py:func:`QgsProcessingParameterType.modelColor()`. +The default implementation returns +:py:func:`~QgsProcessingParameterType.defaultModelColor`. .. versionadded:: 4.0 %End diff --git a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in index 98c093529d2..12ef46f9744 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelcomponentgraphicitem.sip.in @@ -330,6 +330,8 @@ Updates the item's button positions, based on the current item rect. %Docstring Returns the fallback color if the parameter or output does not have a specific color. + +.. versionadded:: 4.0 %End }; QFlags operator|(QgsModelComponentGraphicItem::Flag f1, QFlags f2); diff --git a/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in b/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in index 62ae740f428..81eb8a98cc2 100644 --- a/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in +++ b/python/gui/auto_generated/processing/models/qgsmodelgraphicitem.sip.in @@ -199,7 +199,6 @@ Returns ``True`` if the parameter is set to the default parameter value. signals: - }; diff --git a/src/core/geometry/qgsgeometry.cpp b/src/core/geometry/qgsgeometry.cpp index 0c4d559b7b5..462434076f4 100644 --- a/src/core/geometry/qgsgeometry.cpp +++ b/src/core/geometry/qgsgeometry.cpp @@ -476,19 +476,6 @@ QgsGeometry QgsGeometry::createWedgeBufferFromAngles( const QgsPoint ¢er, do return QgsGeometry( std::move( cp ) ); } -QString QgsGeometry::name( Qgis::GeometryType type ) -{ - switch ( type ) - { - case Qgis::GeometryType::Line: return QString( "Line" ); - case Qgis::GeometryType::Point: return QString( "Point" ); - case Qgis::GeometryType::Polygon: return QString( "Polygon" ); - case Qgis::GeometryType::Null: return QString( "Null" ); - case Qgis::GeometryType::Unknown: - default: return QString( "Unknown" ); - } -} - void QgsGeometry::fromWkb( unsigned char *wkb, int length ) { QgsConstWkbPtr ptr( wkb, length ); @@ -523,16 +510,6 @@ Qgis::GeometryType QgsGeometry::type() const return QgsWkbTypes::geometryType( d->geometry->wkbType() ); } -QString QgsGeometry::typeName() const -{ - if ( !d->geometry ) - { - return QgsGeometry::name( Qgis::GeometryType::Null ); - } - - return QgsGeometry::name( type() ); -} - bool QgsGeometry::isEmpty() const { if ( !d->geometry ) diff --git a/src/core/geometry/qgsgeometry.h b/src/core/geometry/qgsgeometry.h index 2a73977475b..8b87e5969a3 100644 --- a/src/core/geometry/qgsgeometry.h +++ b/src/core/geometry/qgsgeometry.h @@ -380,11 +380,6 @@ class CORE_EXPORT QgsGeometry static QgsGeometry createWedgeBufferFromAngles( const QgsPoint ¢er, double startAngle, double endAngle, double outerRadius, double innerRadius = 0 ); - /** - * Returns a user friendly name as a string out of the type - */ - static QString name( Qgis::GeometryType type ); - /** * Set the geometry, feeding in the buffer containing OGC Well-Known Binary and the buffer's length. * This class will take ownership of the buffer. @@ -409,11 +404,6 @@ class CORE_EXPORT QgsGeometry */ Qgis::GeometryType type() const SIP_HOLDGIL; - /** - * Returns the type name as a QString - */ - QString typeName() const SIP_HOLDGIL; - /** * Returns TRUE if the geometry is empty (eg a linestring with no vertices, * or a collection with no geometries). A null geometry will always diff --git a/src/core/processing/qgsprocessingoutputs.h b/src/core/processing/qgsprocessingoutputs.h index c88ac3ddc06..fcfec462a41 100644 --- a/src/core/processing/qgsprocessingoutputs.h +++ b/src/core/processing/qgsprocessingoutputs.h @@ -89,7 +89,7 @@ class CORE_EXPORT QgsProcessingOutputDefinition /** * Returns the color to use for the output in model designer windows. * - * \since QGIS 3.44 + * \since QGIS 4.0 */ virtual QColor modelColor() const; diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index a96e3f053c3..6674079c06d 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3054,7 +3054,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va else if ( value.userType() == qMetaTypeId() ) { const QgsGeometry g = QgsGeometry::fromRect( value.value() ); - return g.typeName(); + return QgsWkbTypes::geometryDisplayString( g.type() ); } else if ( value.userType() == qMetaTypeId() ) @@ -3063,9 +3063,9 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va if ( !g.isNull() ) { - return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), g.typeName() ); + return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), QgsWkbTypes::geometryDisplayString( g.type() ) ); } - return g.typeName(); + return QgsWkbTypes::geometryDisplayString( g.type() ); } else if ( value.userType() == qMetaTypeId() ) @@ -4099,7 +4099,7 @@ QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &valu if ( value.userType() == qMetaTypeId< QgsGeometry>() ) { const QgsGeometry g = value.value(); - return g.typeName(); + return QgsWkbTypes::geometryDisplayString( g.type() ); } else if ( value.userType() == qMetaTypeId() ) @@ -4107,9 +4107,9 @@ QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &valu const QgsReferencedGeometry g = value.value(); if ( !g.isNull() ) { - return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), g.typeName() ); + return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), QgsWkbTypes::geometryDisplayString( g.type() ) ); } - return g.typeName(); + return QgsWkbTypes::geometryDisplayString( g.type() ); } else if ( value.userType() == QMetaType::QString ) @@ -4119,7 +4119,7 @@ QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &valu QgsGeometry g = QgsGeometry::fromWkt( value.toString() ); if ( !g.isNull() ) { - return g.typeName(); + return QgsWkbTypes::geometryDisplayString( g.type() ); } } } diff --git a/src/core/processing/qgsprocessingparameters.h b/src/core/processing/qgsprocessingparameters.h index b7c764de946..beee17a2ab3 100644 --- a/src/core/processing/qgsprocessingparameters.h +++ b/src/core/processing/qgsprocessingparameters.h @@ -462,7 +462,9 @@ class CORE_EXPORT QgsProcessingParameterDefinition virtual ~QgsProcessingParameterDefinition() = default; /** - * Returns the color to use for the parameter type in model designer windows. + * Returns the color to use for the parameter in model designer windows. + * + * The default implementation retrieves the color from the parameter type, see QgsProcessingParameterType::modelColor(). * * \since QGIS 4.0 */ diff --git a/src/core/processing/qgsprocessingparametertype.h b/src/core/processing/qgsprocessingparametertype.h index 45f20572aa8..71c52f0ef0c 100644 --- a/src/core/processing/qgsprocessingparametertype.h +++ b/src/core/processing/qgsprocessingparametertype.h @@ -181,7 +181,7 @@ class CORE_EXPORT QgsProcessingParameterType /** * Returns the color to use for the parameter in model designer windows. * - * The default implementation retrieves the color from the parameter type, see QgsProcessingParameterType::modelColor(). + * The default implementation returns defaultModelColor(). * * \since QGIS 4.0 */ diff --git a/src/gui/processing/models/qgsmodelarrowitem.cpp b/src/gui/processing/models/qgsmodelarrowitem.cpp index 73f6defb2f5..8d794b203f7 100644 --- a/src/gui/processing/models/qgsmodelarrowitem.cpp +++ b/src/gui/processing/models/qgsmodelarrowitem.cpp @@ -106,7 +106,7 @@ void QgsModelArrowItem::paint( QPainter *painter, const QStyleOptionGraphicsItem switch ( mEndMarker ) { case Marker::Circle: - painter->drawEllipse( mEndPoint, 3, 3 ); + painter->drawEllipse( mEndPoint, 3.0, 3.0 ); break; case Marker::ArrowHead: drawArrowHead( painter, mEndPoint, path().pointAtPercent( 1.0 ) - path().pointAtPercent( 0.95 ) ); diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index be36aa92898..ce96c9ae637 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -572,8 +572,7 @@ void QgsModelComponentGraphicItem::fold( Qt::Edge edge, bool folded ) } else if ( QgsProcessingModelParameter *param = dynamic_cast( mComponent.get() ) ) { - QgsProcessingModelParameter parameterComponent = mModel->parameterComponent( param->parameterName() ); - parameterComponent.setLinksCollapsed( edge, folded ); + mModel->parameterComponent( param->parameterName() ).setLinksCollapsed( edge, folded ); } else if ( QgsProcessingModelOutput *output = dynamic_cast( mComponent.get() ) ) { @@ -1274,11 +1273,10 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind QString name = param->name(); QString title = param->description(); - QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name ); QString parameterValueAsString; - if ( paramSources.size() > 0 ) + if ( paramSources.empty() ) { QgsProcessingModelChildParameterSource firstParameterSource = paramSources[0]; diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h index 41614df81ee..7a9162da161 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h @@ -369,6 +369,8 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject /** * Returns the fallback color if the parameter or output does not have a specific color. + * + * \since QGIS 4.0 */ QColor fallbackColor() const { return mFallbackColor; }; From eca451bf4a70e5e2231ee97dd59f313154de957a Mon Sep 17 00:00:00 2001 From: Jonathan Lurie Date: Mon, 8 Sep 2025 11:39:44 +0200 Subject: [PATCH 41/42] addresing review --- .../processing/qgsprocessingparameters.cpp | 61 ++++++++++++------- .../models/qgsmodelcomponentgraphicitem.h | 12 +++- .../processing/models/qgsmodelgraphicitem.cpp | 20 +++--- tests/src/analysis/testqgsprocessing.cpp | 2 +- 4 files changed, 60 insertions(+), 35 deletions(-) diff --git a/src/core/processing/qgsprocessingparameters.cpp b/src/core/processing/qgsprocessingparameters.cpp index 6674079c06d..1194c756832 100644 --- a/src/core/processing/qgsprocessingparameters.cpp +++ b/src/core/processing/qgsprocessingparameters.cpp @@ -3034,6 +3034,9 @@ QColor QgsProcessingParameterDefinition::modelColor() const QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &value ) const { + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + if ( value.userType() == qMetaTypeId() ) { const QgsPointXY r = value.value(); @@ -3044,10 +3047,10 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va else if ( value.userType() == qMetaTypeId() ) { const QgsReferencedPointXY r = value.value(); - return QStringLiteral( "[%1] %2, %3" ).arg( - r.crs().authid(), + return QStringLiteral( "%1, %2 [%3]" ).arg( qgsDoubleToString( r.x(), 4 ), - qgsDoubleToString( r.y(), 4 ) + qgsDoubleToString( r.y(), 4 ), + r.crs().authid() ); } @@ -3063,7 +3066,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va if ( !g.isNull() ) { - return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), QgsWkbTypes::geometryDisplayString( g.type() ) ); + return QStringLiteral( "%1 [%2]" ).arg( QgsWkbTypes::geometryDisplayString( g.type() ), g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ); } return QgsWkbTypes::geometryDisplayString( g.type() ); } @@ -3247,6 +3250,9 @@ QgsProcessingParameterCrs *QgsProcessingParameterCrs::fromScriptCode( const QStr QString QgsProcessingParameterCrs::userFriendlyString( const QVariant &value ) const { + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + QgsCoordinateReferenceSystem crs( value.toString() ); if ( crs.isValid() ) return crs.userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ); @@ -3669,7 +3675,7 @@ QString QgsProcessingParameterExtent::valueAsPythonString( const QVariant &value qgsDoubleToString( r.yMinimum() ), qgsDoubleToString( r.xMaximum() ), qgsDoubleToString( r.yMaximum() ), - r.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ); + r.crs().authid() ); } else if ( value.userType() == qMetaTypeId< QgsGeometry>() ) { @@ -4093,6 +4099,9 @@ QgsProcessingParameterGeometry *QgsProcessingParameterGeometry::fromScriptCode( QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &value ) const { + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + if ( value.isValid() ) { @@ -4107,7 +4116,7 @@ QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &valu const QgsReferencedGeometry g = value.value(); if ( !g.isNull() ) { - return QStringLiteral( "[%1] %2" ).arg( g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ), QgsWkbTypes::geometryDisplayString( g.type() ) ); + return QStringLiteral( "%1 [%2]" ).arg( QgsWkbTypes::geometryDisplayString( g.type() ), g.crs().userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString )); } return QgsWkbTypes::geometryDisplayString( g.type() ); } @@ -5383,6 +5392,9 @@ QString QgsProcessingParameterEnum::asPythonString( const QgsProcessing::PythonO QString QgsProcessingParameterEnum::userFriendlyString( const QVariant &value ) const { + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + return options().at( value.toInt() ); } @@ -7850,6 +7862,9 @@ bool QgsProcessingParameterDistance::fromVariantMap( const QVariantMap &map ) QString QgsProcessingParameterDistance::userFriendlyString( const QVariant &value ) const { + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); } @@ -7937,7 +7952,10 @@ bool QgsProcessingParameterArea::fromVariantMap( const QVariantMap &map ) QString QgsProcessingParameterArea::userFriendlyString( const QVariant &value ) const { - return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toString( defaultUnit() ) ); + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + + return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); } @@ -8023,7 +8041,10 @@ bool QgsProcessingParameterVolume::fromVariantMap( const QVariantMap &map ) QString QgsProcessingParameterVolume::userFriendlyString( const QVariant &value ) const { - return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toString( defaultUnit() ) ); + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + + return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); } // @@ -8084,6 +8105,9 @@ bool QgsProcessingParameterDuration::fromVariantMap( const QVariantMap &map ) QString QgsProcessingParameterDuration::userFriendlyString( const QVariant &value ) const { + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + return QStringLiteral( "%1 %2" ).arg( value.toString(), QgsUnitTypes::toAbbreviatedString( defaultUnit() ) ); } @@ -8946,19 +8970,16 @@ QgsProcessingParameterDateTime *QgsProcessingParameterDateTime::fromScriptCode( QString QgsProcessingParameterDateTime:: userFriendlyString( const QVariant &value ) const { + if ( QgsVariantUtils::isNull( value ) ) + return QString(); + if ( value.userType() == QMetaType::Type::QDateTime ) { const QDateTime dt = value.toDateTime(); if ( !dt.isValid() ) return QObject::tr( "Invalid datetime" ); else - return QStringLiteral( "%1-%2-%3T%4:%5:%6" ) - .arg( dt.date().year() ) - .arg( dt.date().month() ) - .arg( dt.date().day() ) - .arg( dt.time().hour() ) - .arg( dt.time().minute() ) - .arg( dt.time().second() ); + return dt.toString( Qt::ISODate ); } else if ( value.userType() == QMetaType::Type::QDate ) @@ -8967,10 +8988,7 @@ QString QgsProcessingParameterDateTime:: userFriendlyString( const QVariant &val if ( !dt.isValid() ) return QObject::tr( "Invalid date" ); else - return QStringLiteral( "%1-%2-%3" ) - .arg( dt.year() ) - .arg( dt.month() ) - .arg( dt.day() ); + return dt.toString( Qt::ISODate ); } else if ( value.userType() == QMetaType::Type::QTime ) @@ -8979,10 +8997,7 @@ QString QgsProcessingParameterDateTime:: userFriendlyString( const QVariant &val if ( !dt.isValid() ) return QObject::tr( "Invalid time" ); else - return QStringLiteral( "%4:%5:%6" ) - .arg( dt.hour() ) - .arg( dt.minute() ) - .arg( dt.second() ); + return dt.toString( Qt::ISODate ); } return value.toString(); diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h index 7a9162da161..434a325ead7 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.h +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.h @@ -137,10 +137,20 @@ class GUI_EXPORT QgsModelComponentGraphicItem : public QGraphicsObject */ void setItemRect( QRectF rect ); + /** + * Returns the data type of the linked parameter at the specified \a index on the specified \a edge. + * + * \since QGIS 4.0 + */ virtual QString linkedParameterDataType( Qt::Edge edge, int index ) const; #ifndef SIP_RUN + /** + * Returns the color of the link at the specified \a index on the specified \a edge. + * + * \since QGIS 4.0 + */ virtual QColor linkColor( Qt::Edge edge, int index ) const; /** @@ -439,7 +449,7 @@ class GUI_EXPORT QgsModelParameterGraphicItem : public QgsModelComponentGraphicI void contextMenuEvent( QGraphicsSceneContextMenuEvent *event ) override; bool canDeleteComponent() override; - QString linkedParameterDataType( Qt::Edge /* unused in this implementation because parameters only have a bottom edge */, int index ) const override; + QString linkedParameterDataType( Qt::Edge, int index ) const override; QColor linkColor( Qt::Edge edge, int index ) const override; diff --git a/src/gui/processing/models/qgsmodelgraphicitem.cpp b/src/gui/processing/models/qgsmodelgraphicitem.cpp index a1484b62709..33b7d8cc04b 100644 --- a/src/gui/processing/models/qgsmodelgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelgraphicitem.cpp @@ -206,9 +206,12 @@ void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOp painter->setRenderHint( QPainter::Antialiasing ); + // Radius of the socket circle constexpr float DISPLAY_SIZE = 4; - float ellipseOffset = 0.4; - QPointF ellipsePosition = QPointF( position().x() + ellipseOffset, position().y() + ellipseOffset ); + + // Offset of the socket to separate from the label + constexpr float ELLIPSE_OFFSET = 0.4; + QPointF ellipsePosition = QPointF( position().x() + ELLIPSE_OFFSET, position().y() + ELLIPSE_OFFSET ); painter->drawEllipse( ellipsePosition, DISPLAY_SIZE, DISPLAY_SIZE ); /* Uncomment to display bounding box */ @@ -252,18 +255,15 @@ bool QgsModelDesignerSocketGraphicItem::isDefaultParameterValue() const // Input params case Qt::TopEdge: { - QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions(); - - if ( mIndex > ( params.length() - 1 ) ) - { + const QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions(); + const QgsProcessingParameterDefinition *param = params.value( mIndex ); + if ( !param ) break; - } - const QgsProcessingParameterDefinition *param = params.at( mIndex ); - QString name = param->name(); + const QString name = param->name(); QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name ); - if ( paramSources.size() == 0 ) + if ( paramSources.empty() ) { break; } diff --git a/tests/src/analysis/testqgsprocessing.cpp b/tests/src/analysis/testqgsprocessing.cpp index 17931ab94fe..f5d5723c035 100644 --- a/tests/src/analysis/testqgsprocessing.cpp +++ b/tests/src/analysis/testqgsprocessing.cpp @@ -3213,7 +3213,7 @@ void TestQgsProcessing::parameterCrs() QVERIFY( def->checkValueIsAcceptable( QgsProcessingFeatureSourceDefinition( QgsProperty::fromValue( QVariant::fromValue( r1 ) ) ) ) ); QVERIFY( def->checkValueIsAcceptable( QgsProcessingOutputLayerDefinition( r1->id() ) ) ); - QCOMPARE( def->userFriendlyString( QVariant( "EPSG:3857" ) ), QgsCoordinateReferenceSystem( QVariant( "EPSG:3857" ).toString() ).userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ); + QCOMPARE( def->userFriendlyString( QVariant( "EPSG:3857" ) ), QgsCoordinateReferenceSystem( QStringLiteral( "EPSG:3857" ) ).userFriendlyIdentifier( Qgis::CrsIdentifierType::ShortString ) ); // using map layer QVariantMap params; From 4bab898301d3e80bea6ab38f864a5a37fb2f2685 Mon Sep 17 00:00:00 2001 From: Jonathan Lurie Date: Wed, 17 Sep 2025 14:09:22 +0200 Subject: [PATCH 42/42] removed blank line --- src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp index ce96c9ae637..0235cc14045 100644 --- a/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp +++ b/src/gui/processing/models/qgsmodelcomponentgraphicitem.cpp @@ -1272,7 +1272,6 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind const QgsProcessingParameterDefinition *param = params.at( index ); QString name = param->name(); QString title = param->description(); - QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name ); QString parameterValueAsString;