mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-03 00:04:47 -04:00
auto-fix pre-commit issues
This commit is contained in:
parent
99613254d1
commit
192298a388
@ -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):
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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:
|
||||
|
||||
|
@ -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):
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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:
|
||||
|
||||
|
@ -77,7 +77,8 @@ 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<QgsModelParameterGraphicItem *>(mStartItem)){
|
||||
if ( QgsModelParameterGraphicItem *paramItem = dynamic_cast<QgsModelParameterGraphicItem *>( mStartItem ) )
|
||||
{
|
||||
dataType = paramItem->getLinkedParamDataType( mStartEdge, mStartIndex );
|
||||
}
|
||||
else
|
||||
|
@ -503,7 +503,8 @@ void QgsModelComponentGraphicItem::updateButtonPositions()
|
||||
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<QgsProcessingModelChildAlgorithm *>( mComponent.get() ) ){
|
||||
if ( QgsProcessingModelChildAlgorithm *child = dynamic_cast<QgsProcessingModelChildAlgorithm *>( mComponent.get() ) )
|
||||
{
|
||||
mModel->childAlgorithm( child->childId() ).setLinksCollapsed( edge, folded );
|
||||
} else if ( QgsProcessingModelParameter *param = dynamic_cast<QgsProcessingModelParameter *>( mComponent.get() ) ) {
|
||||
}
|
||||
else if ( QgsProcessingModelParameter *param = dynamic_cast<QgsProcessingModelParameter *>( mComponent.get() ) )
|
||||
{
|
||||
QString paramName = param->parameterName();
|
||||
QgsProcessingModelParameter paramComp = mModel->parameterComponent( paramName );
|
||||
paramComp.setLinksCollapsed( edge, folded );
|
||||
} else if ( QgsProcessingModelOutput *output = dynamic_cast<QgsProcessingModelOutput *>( mComponent.get() ) ){
|
||||
}
|
||||
else if ( QgsProcessingModelOutput *output = dynamic_cast<QgsProcessingModelOutput *>( mComponent.get() ) )
|
||||
{
|
||||
mModel->childAlgorithm( output->childId() ).modelOutput( output->name() ).setLinksCollapsed( edge, folded );
|
||||
}
|
||||
|
||||
@ -880,7 +888,6 @@ QString QgsModelParameterGraphicItem::linkPointText( Qt::Edge, int index ) const
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString QgsModelParameterGraphicItem::getLinkedParamDataType( Qt::Edge edge, int index )
|
||||
{
|
||||
QString unknownType = QString( "unknown" );
|
||||
@ -1144,7 +1151,8 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int
|
||||
|
||||
if ( const QgsProcessingModelChildAlgorithm *child = dynamic_cast<const QgsProcessingModelChildAlgorithm *>( component() ) )
|
||||
{
|
||||
if ( !child->algorithm() ) {
|
||||
if ( !child->algorithm() )
|
||||
{
|
||||
return unknownType;
|
||||
}
|
||||
|
||||
@ -1152,7 +1160,8 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int
|
||||
{
|
||||
case Qt::BottomEdge:
|
||||
{
|
||||
if (index <= child->algorithm()->outputDefinitions().size() - 1) {
|
||||
if ( index <= child->algorithm()->outputDefinitions().size() - 1 )
|
||||
{
|
||||
return child->algorithm()->outputDefinitions().at( index )->type();
|
||||
}
|
||||
return unknownType;
|
||||
@ -1161,7 +1170,8 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int
|
||||
{
|
||||
QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions();
|
||||
|
||||
if (index <= params.size() - 1) {
|
||||
if ( index <= params.size() - 1 )
|
||||
{
|
||||
return params.at( index )->type();
|
||||
}
|
||||
|
||||
@ -1178,7 +1188,6 @@ QString QgsModelComponentGraphicItem::getLinkedParamDataType(Qt::Edge edge, int
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int index ) const
|
||||
{
|
||||
if ( index < 0 )
|
||||
@ -1237,11 +1246,12 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind
|
||||
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<QgsProcessingModelAlgorithm *>( model() ) )
|
||||
@ -1257,9 +1267,7 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind
|
||||
break;
|
||||
|
||||
case Qgis::ProcessingModelChildParameterSource::ModelOutput:
|
||||
paramValueAsStr = QStringLiteral( ": output from '%1'" ).arg(
|
||||
firstParamSource.friendlyIdentifier(const_cast<QgsProcessingModelAlgorithm *>(model()))
|
||||
);
|
||||
paramValueAsStr = QStringLiteral( ": output from '%1'" ).arg( firstParamSource.friendlyIdentifier( const_cast<QgsProcessingModelAlgorithm *>( model() ) ) );
|
||||
break;
|
||||
|
||||
case Qgis::ProcessingModelChildParameterSource::ModelParameter:
|
||||
@ -1275,7 +1283,8 @@ QString QgsModelChildAlgorithmGraphicItem::linkPointText( Qt::Edge edge, int ind
|
||||
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()) {
|
||||
if ( param->type() == QgsProcessingParameterEnum::typeName() )
|
||||
{
|
||||
const QgsProcessingParameterEnum *paramAsEnumParam = dynamic_cast<const QgsProcessingParameterEnum *>( param );
|
||||
paramValueAsStr = QStringLiteral( ": %1" ).arg( paramAsEnumParam->options().at( paramValue.toInt() ) );
|
||||
}
|
||||
|
@ -185,7 +185,6 @@ QgsModelDesignerSocketGraphicItem::QgsModelDesignerSocketGraphicItem( QgsModelCo
|
||||
|
||||
void QgsModelDesignerSocketGraphicItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *, QWidget * )
|
||||
{
|
||||
|
||||
QColor outlineColor = getColor();
|
||||
QColor fillColor = QColor( outlineColor );
|
||||
fillColor.setAlpha( isDefaultParamValue() ? 30 : 255 );
|
||||
@ -211,7 +210,8 @@ 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,
|
||||
@ -226,110 +226,93 @@ QColor QgsModelDesignerSocketGraphicItem::getColor() {
|
||||
}
|
||||
|
||||
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()
|
||||
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
|
||||
}
|
||||
else
|
||||
|
||||
// Boolean type
|
||||
if (
|
||||
dataType == QgsProcessingParameterBoolean::typeName() ||
|
||||
dataType == QgsProcessingOutputBoolean::typeName()
|
||||
) {
|
||||
dataType == QgsProcessingParameterBoolean::typeName() || dataType == QgsProcessingOutputBoolean::typeName()
|
||||
)
|
||||
{
|
||||
return QColor( 51, 201, 28 );
|
||||
} else
|
||||
}
|
||||
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()
|
||||
) {
|
||||
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
|
||||
}
|
||||
else
|
||||
|
||||
// Raster type
|
||||
if (
|
||||
dataType == QgsProcessingParameterRasterLayer::typeName() ||
|
||||
dataType == QgsProcessingOutputRasterLayer::typeName()
|
||||
dataType == QgsProcessingParameterRasterLayer::typeName() || dataType == QgsProcessingOutputRasterLayer::typeName()
|
||||
|
||||
) {
|
||||
)
|
||||
{
|
||||
return QColor( 0, 180, 180 );
|
||||
} else
|
||||
}
|
||||
else
|
||||
|
||||
// enum
|
||||
if (
|
||||
dataType == QgsProcessingParameterEnum::typeName()
|
||||
) {
|
||||
)
|
||||
{
|
||||
return QColor( 128, 68, 201 );
|
||||
} else
|
||||
}
|
||||
else
|
||||
|
||||
// String and datetime types
|
||||
if (
|
||||
dataType == QgsProcessingParameterString::typeName() ||
|
||||
dataType == QgsProcessingParameterDateTime::typeName() ||
|
||||
dataType == QgsProcessingParameterCrs::typeName() ||
|
||||
dataType == QgsProcessingOutputHtml::typeName() ||
|
||||
dataType == QgsProcessingOutputString::typeName()
|
||||
dataType == QgsProcessingParameterString::typeName() || dataType == QgsProcessingParameterDateTime::typeName() || dataType == QgsProcessingParameterCrs::typeName() || dataType == QgsProcessingOutputHtml::typeName() || dataType == QgsProcessingOutputString::typeName()
|
||||
|
||||
) {
|
||||
)
|
||||
{
|
||||
return QColor( 100, 100, 255 );
|
||||
} else
|
||||
}
|
||||
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()
|
||||
) {
|
||||
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
|
||||
}
|
||||
else
|
||||
|
||||
// Expression type
|
||||
if(dataType == QgsProcessingParameterExpression::typeName()) {
|
||||
if ( dataType == QgsProcessingParameterExpression::typeName() )
|
||||
{
|
||||
return QColor( 180, 80, 180 );
|
||||
} else
|
||||
}
|
||||
else
|
||||
|
||||
// Other Layer types
|
||||
if (
|
||||
dataType == QgsProcessingParameterMultipleLayers::typeName() ||
|
||||
dataType == QgsProcessingParameterMapLayer::typeName() ||
|
||||
dataType == QgsProcessingParameterAnnotationLayer::typeName() ||
|
||||
dataType == QgsProcessingOutputMultipleLayers::typeName()
|
||||
dataType == QgsProcessingParameterMultipleLayers::typeName() || dataType == QgsProcessingParameterMapLayer::typeName() || dataType == QgsProcessingParameterAnnotationLayer::typeName() || dataType == QgsProcessingOutputMultipleLayers::typeName()
|
||||
|
||||
) {
|
||||
)
|
||||
{
|
||||
return QColor( 128, 128, 0 );
|
||||
} else
|
||||
}
|
||||
else
|
||||
|
||||
// Default color, applies for:
|
||||
// QgsProcessingParameterField
|
||||
@ -351,21 +334,25 @@ QColor QgsModelDesignerSocketGraphicItem::typeToColorLookup(QString dataType) {
|
||||
}
|
||||
|
||||
|
||||
bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() {
|
||||
if (!mComponent) {
|
||||
bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue()
|
||||
{
|
||||
if ( !mComponent )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const QgsProcessingModelChildAlgorithm *child = dynamic_cast<const QgsProcessingModelChildAlgorithm *>( 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,7 +360,8 @@ bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() {
|
||||
{
|
||||
QgsProcessingParameterDefinitions params = child->algorithm()->parameterDefinitions();
|
||||
|
||||
if ( mIndex > (params.length() - 1) ) {
|
||||
if ( mIndex > ( params.length() - 1 ) )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@ -381,12 +369,14 @@ bool QgsModelDesignerSocketGraphicItem::isDefaultParamValue() {
|
||||
QString name = param->name();
|
||||
|
||||
QgsProcessingModelChildParameterSources paramSources = child->parameterSources().value( name );
|
||||
if (paramSources.size() == 0) {
|
||||
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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user