rename method to socketColor

This commit is contained in:
jonathanlurie 2025-06-19 14:54:48 +02:00
parent 293be69903
commit 9c1035e773
5 changed files with 31 additions and 19 deletions

View File

@ -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:

View File

@ -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:

View File

@ -3145,8 +3145,6 @@ QString QgsProcessingParameterDefinition::userFriendlyString( QVariant &value )
}
}
qDebug() << value ;
return value.toString();
}

View File

@ -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 )
{

View File

@ -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: