Skip to content
Permalink
Browse files

nit

  • Loading branch information
tomasMizera authored and PeterPetrik committed Nov 17, 2020
1 parent c4be1bd commit a4b993fd58a3c8694fd607f443ca90515f5c3f13
Showing with 7 additions and 7 deletions.
  1. +2 −2 src/quickgui/qgsquickfeatureslistmodel.cpp
  2. +5 −5 src/quickgui/qgsquickfeatureslistmodel.h
@@ -195,7 +195,7 @@ void QgsQuickFeaturesListModel::setupValueRelation( const QVariantMap &config )
setFeatureTitleField( fields.field( config.value( QStringLiteral( "Value" ) ).toString() ).name() );

// store value relation filter expression
setFilterExpression( config.value( QStringLiteral("FilterExpression") ).toString() );
setFilterExpression( config.value( QStringLiteral( "FilterExpression" ) ).toString() );

loadFeaturesFromLayer( layer );
}
@@ -326,7 +326,7 @@ QVariant QgsQuickFeaturesListModel::convertMultivalueFormat( const QVariant &mul
{
QVariant var = attributeFromValue( KeyColumn, i, role );
if ( !var.isNull() )
retList.append(var);
retList.append( var );
}

return retList;
@@ -115,18 +115,18 @@ class QUICK_EXPORT QgsQuickFeaturesListModel : public QAbstractListModel
* \brief attributeFromValue finds feature with role and value, returns value for requested role
* \param role role to find from modelRoles
* \param value value to find
* \param requestedRole role thats value is being requested
* \param requestedRole a role whose value is returned
* \return If feature is found by role and value, method returns value for requested role. Returns empty QVariant if no feature is found. If more features
* match requested role and value, value for first is returned.
*/
Q_INVOKABLE QVariant attributeFromValue( const int role, const QVariant &value, const int requestedRole ) const;

/**
* @brief convertMultivalueFormat converts postgres string like string to an array of variants with requested role.
* \brief convertMultivalueFormat converts postgres string like string to an array of variants with requested role.
* Array {1,2,3} with requested role FeatureId results in list of QVariant ints [1, 2, 3]
* @param multivalue string to convert
* @param requestedRole role to convert keys from string, default value is Qt::DisplayRole
* @return array of QVariants with values for requested role. If model can not find value for requested role, this key is omitted.
* \param multivalue string to convert
* \param requestedRole role to convert keys from string, default value is Qt::DisplayRole
* \return array of QVariants with values for requested role. If model can not find value for requested role, this key is omitted.
*/
Q_INVOKABLE QVariant convertMultivalueFormat( const QVariant &multivalue, const int requestedRole = Qt::DisplayRole );

0 comments on commit a4b993f

Please sign in to comment.
You can’t perform that action at this time.