mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-04 00:04:03 -04:00
fix after review
This commit is contained in:
parent
0ae2327be1
commit
e6efa0a5c6
@ -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)
|
||||
|
@ -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/;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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<QgsModelComponentGraphicItem::Flag> operator|(QgsModelComponentGraphicItem::Flag f1, QFlags<QgsModelComponentGraphicItem::Flag> f2);
|
||||
|
@ -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:
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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/;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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<QgsModelComponentGraphicItem::Flag> operator|(QgsModelComponentGraphicItem::Flag f1, QFlags<QgsModelComponentGraphicItem::Flag> f2);
|
||||
|
@ -199,7 +199,6 @@ Returns ``True`` if the parameter is set to the default parameter value.
|
||||
signals:
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -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 )
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
||||
|
@ -3054,7 +3054,7 @@ QString QgsProcessingParameterDefinition::userFriendlyString( const QVariant &va
|
||||
else if ( value.userType() == qMetaTypeId<QgsRectangle>() )
|
||||
{
|
||||
const QgsGeometry g = QgsGeometry::fromRect( value.value<QgsRectangle>() );
|
||||
return g.typeName();
|
||||
return QgsWkbTypes::geometryDisplayString( g.type() );
|
||||
}
|
||||
|
||||
else if ( value.userType() == qMetaTypeId<QgsReferencedRectangle>() )
|
||||
@ -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<QgsProcessingOutputLayerDefinition>() )
|
||||
@ -4099,7 +4099,7 @@ QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &valu
|
||||
if ( value.userType() == qMetaTypeId< QgsGeometry>() )
|
||||
{
|
||||
const QgsGeometry g = value.value<QgsGeometry>();
|
||||
return g.typeName();
|
||||
return QgsWkbTypes::geometryDisplayString( g.type() );
|
||||
}
|
||||
|
||||
else if ( value.userType() == qMetaTypeId<QgsReferencedGeometry>() )
|
||||
@ -4107,9 +4107,9 @@ QString QgsProcessingParameterGeometry::userFriendlyString( const QVariant &valu
|
||||
const QgsReferencedGeometry g = value.value<QgsReferencedGeometry>();
|
||||
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() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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 ) );
|
||||
|
@ -572,8 +572,7 @@ void QgsModelComponentGraphicItem::fold( Qt::Edge edge, bool folded )
|
||||
}
|
||||
else if ( QgsProcessingModelParameter *param = dynamic_cast<QgsProcessingModelParameter *>( 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<QgsProcessingModelOutput *>( 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];
|
||||
|
||||
|
@ -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; };
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user