mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
code layout, loop improvements, dox, const correction
This commit is contained in:
parent
a4fda0ac01
commit
a3a7b5f447
@ -297,7 +297,7 @@ Get parameter from its id
|
|||||||
.. versionadded:: 3.12
|
.. versionadded:: 3.12
|
||||||
%End
|
%End
|
||||||
|
|
||||||
const QgsProcessingParameterDefinitions parameterDefinitions() const;
|
QgsProcessingParameterDefinitions parameterDefinitions() const;
|
||||||
%Docstring
|
%Docstring
|
||||||
List of parameters
|
List of parameters
|
||||||
|
|
||||||
@ -328,9 +328,15 @@ Copy the parameters (shall be used in clone implementation)
|
|||||||
Format the number according to label properties
|
Format the number according to label properties
|
||||||
%End
|
%End
|
||||||
|
|
||||||
void addParameter( QgsProcessingParameterDefinition *definition );
|
void addParameter( QgsProcessingParameterDefinition *definition /Transfer/ );
|
||||||
%Docstring
|
%Docstring
|
||||||
Add parameter
|
Add a parameter to the method.
|
||||||
|
The paramaeter is a processing parameter which will allow its configuration in the GUI.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
Only parameters having their widget implementation in C++ are supported. i.e. pure
|
||||||
|
Python parameters are not supported.
|
||||||
|
|
||||||
.. versionadded:: 3.12
|
.. versionadded:: 3.12
|
||||||
%End
|
%End
|
||||||
|
@ -35,7 +35,7 @@ class CORE_EXPORT QgsClassificationEqualInterval : public QgsClassificationMetho
|
|||||||
QgsClassificationMethod *clone() const override;
|
QgsClassificationMethod *clone() const override;
|
||||||
QIcon icon() const override;
|
QIcon icon() const override;
|
||||||
|
|
||||||
bool valuesRequired() const override {return false;}
|
bool valuesRequired() const override { return false; }
|
||||||
|
|
||||||
static const QString METHOD_ID;
|
static const QString METHOD_ID;
|
||||||
|
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
QgsClassificationLogarithmic::QgsClassificationLogarithmic()
|
QgsClassificationLogarithmic::QgsClassificationLogarithmic()
|
||||||
: QgsClassificationMethod( NoFlag, 0 )
|
: QgsClassificationMethod( NoFlag, 0 )
|
||||||
{
|
{
|
||||||
QgsProcessingParameterBoolean *param = new QgsProcessingParameterBoolean( QStringLiteral( "FILTER_ZERO_NEG_VALUES" ), QObject::tr( "Filter values <= 0" ), false );
|
QgsProcessingParameterBoolean *param = new QgsProcessingParameterBoolean( QStringLiteral( "FILTER_ZERO_NEG_VALUES" ), QObject::tr( "Filter values ≤ 0" ), false );
|
||||||
addParameter( param );
|
addParameter( param );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,11 +188,11 @@ const QgsProcessingParameterDefinition *QgsClassificationMethod::parameterDefini
|
|||||||
void QgsClassificationMethod::setParameterValues( const QVariantMap &values )
|
void QgsClassificationMethod::setParameterValues( const QVariantMap &values )
|
||||||
{
|
{
|
||||||
mParameterValues = values;
|
mParameterValues = values;
|
||||||
for ( const QString ¶mName : mParameterValues.keys() ) // todo is this ok?
|
for ( auto it = mParameterValues.begin(); it != mParameterValues.end(); ++it )
|
||||||
{
|
{
|
||||||
if ( !parameterDefinition( paramName ) )
|
if ( !parameterDefinition( it.key() ) )
|
||||||
{
|
{
|
||||||
QgsMessageLog::logMessage( name(), QObject::tr( "Parameter %1 does not exist in the method" ).arg( paramName ) );
|
QgsMessageLog::logMessage( name(), QObject::tr( "Parameter %1 does not exist in the method" ).arg( it.key() ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -281,7 +281,7 @@ class CORE_EXPORT QgsClassificationMethod SIP_ABSTRACT
|
|||||||
* List of parameters
|
* List of parameters
|
||||||
* \since QGIS 3.12
|
* \since QGIS 3.12
|
||||||
*/
|
*/
|
||||||
const QgsProcessingParameterDefinitions parameterDefinitions() const {return mParameters;}
|
QgsProcessingParameterDefinitions parameterDefinitions() const {return mParameters;}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set values of the additional parameters
|
* Set values of the additional parameters
|
||||||
@ -303,10 +303,13 @@ class CORE_EXPORT QgsClassificationMethod SIP_ABSTRACT
|
|||||||
QString formatNumber( double value ) const;
|
QString formatNumber( double value ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add parameter
|
* Add a parameter to the method.
|
||||||
|
* The paramaeter is a processing parameter which will allow its configuration in the GUI.
|
||||||
|
* \note Only parameters having their widget implementation in C++ are supported. i.e. pure
|
||||||
|
* Python parameters are not supported.
|
||||||
* \since QGIS 3.12
|
* \since QGIS 3.12
|
||||||
*/
|
*/
|
||||||
void addParameter( QgsProcessingParameterDefinition *definition );
|
void addParameter( QgsProcessingParameterDefinition *definition SIP_TRANSFER );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the parameter value
|
* Get the parameter value
|
||||||
|
@ -832,7 +832,7 @@ void QgsGraduatedSymbolRendererWidget::updateMethodParameters()
|
|||||||
// todo need more?
|
// todo need more?
|
||||||
QgsProcessingContext context;
|
QgsProcessingContext context;
|
||||||
|
|
||||||
for ( const auto *def : method->parameterDefinitions() )
|
for ( const QgsProcessingParameterDefinition *def : method->parameterDefinitions() )
|
||||||
{
|
{
|
||||||
QgsAbstractProcessingParameterWidgetWrapper *ppww = QgsGui::processingGuiRegistry()->createParameterWidgetWrapper( def, QgsProcessingGui::Standard );
|
QgsAbstractProcessingParameterWidgetWrapper *ppww = QgsGui::processingGuiRegistry()->createParameterWidgetWrapper( def, QgsProcessingGui::Standard );
|
||||||
mParametersLayout->addRow( ppww->createWrappedLabel(), ppww->createWrappedWidget( context ) );
|
mParametersLayout->addRow( ppww->createWrappedLabel(), ppww->createWrappedWidget( context ) );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user