Help: How do you use @position_used_satellites?

Return to the theme in use of position_used_satellites
In QField documentation:

I find this information:
array_count (position_used_satellites)
but within QGis syntax for arraay_cont requires a parameter:
Example: array_count (array ('a', 'b', 'c', 'b'), 'b') → 2

For array_count (position_used_satellites)
Parser Errors: array_count function is called with wrong number of arguments. Expected 2 but got 1.

so I tried with: array_count (position_used_satellites , '39')
the QField LOG reports the following message:
Connot convert '' to array

I tried with “array_length” statement which takes no parameters:
array_length (position_used_satellites)
also in this case QField LOG shows the same message:
Connot convert '' to array


I checked QField code a bit and find in:
src\core\utils\expressioncontextutils.cpp
52 const QList <int> usedSatelites = positionInformation.satPrn ();

I did the related search in QGis code for “array_count”;
src\core\expression\qgsexpressionfunction.cpp
8479 << new QgsStaticExpressionFunction( QStringLiteral( "array_count" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "array" ) ) << QgsExpressionFunction::Parameter( QStringLiteral( "value" ) ), fcnArrayCount, QStringLiteral( "Arrays" ) )

6052 static QVariant fcnArrayCount( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
6053 {
6054 return QVariant( QgsExpressionUtils::getListValue( values.at( 0 ), parent ).count( values.at( 1 ) ) );
6055 }

and for “array_length”:
8476 << new QgsStaticExpressionFunction( QStringLiteral( "array_length" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "array" ) ), fcnArrayLength, QStringLiteral( "Arrays" ) )

6042 static QVariant fcnArrayLength( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
6043 {
6044 return QgsExpressionUtils::getListValue( values.at( 0 ), parent ).length();
6045 }

src\core\expression\qgsexpressionutils.h
430 static QVariantList getListValue( const QVariant &value, QgsExpression *parent )
431 {
432 if ( value.type() == QVariant::List || value.type() == QVariant::StringList )
433 {
434 return value.toList();
435 }
436 else
437 {
438 parent->setEvalErrorString( QObject::tr( "Cannot convert '%1' to array" ).arg( value.toString() ) );
439 return QVariantList();
440 }
441 }

I am not a C ++ programmer, but I ask this question:
Can “QList” be read with QGis “array” functions?
Thank you


Imported from GitHub discussion by @bettellam on 2022-10-11T15:50:16Z

#3360


Imported from GitHub comment by @antoniusz on 2024-01-26T06:40:03Z