Skip to content

Commit

Permalink
Fix docstrings and respond to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
stev-0 committed Nov 23, 2019
1 parent 51c1289 commit 08b7eca
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 7 deletions.
11 changes: 10 additions & 1 deletion python/gui/auto_generated/qgsattributeform.sip.in
Expand Up @@ -44,7 +44,16 @@ class QgsAttributeForm : QWidget

const QgsFeature &feature();

void displayWarning( QString message );
void displayWarning( const QString& message );
%Docstring
Displays a warning message in the form message bar

:param message: message string

.. seealso:: :py:func:`mode`

.. versionadded:: 3.12
%End


void hideButtonBox();
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/core/qgseditorwidgetwrapper.h
Expand Up @@ -360,7 +360,7 @@ class GUI_EXPORT QgsEditorWidgetWrapper : public QgsWidgetWrapper
*/
bool setFormFeatureAttribute( const QString &attributeName, const QVariant &attributeValue );

protected:
private:

/**
* Is called, when the value of the widget needs to be changed. Update the widget representation
Expand Down
4 changes: 2 additions & 2 deletions src/gui/editorwidgets/qgstexteditwrapper.cpp
Expand Up @@ -203,12 +203,12 @@ void QgsTextEditWrapper::setFeature( const QgsFeature &feature )
{
// Do nothing if the value has not changed
if ( mInvalidJSON )
mForm->displayWarning( tr( "Your JSON is invalid and will be reverted back to what was in the datastore before editing" ) );
mForm->displayWarning( tr( "Your JSON is invalid and will be reverted back to the last valid edit or the original data" ) );
{
mInvalidJSON = false;
}
setFormFeature( feature );
setValue( feature.attribute( mFieldIdx ) );
setValue( feature.attribute( fieldIdx() ) );
}

void QgsTextEditWrapper::updateValues( const QVariant &val, const QVariantList & )
Expand Down
2 changes: 1 addition & 1 deletion src/gui/editorwidgets/qgstexteditwrapper.h
Expand Up @@ -74,7 +74,7 @@ class GUI_EXPORT QgsTextEditWrapper : public QgsEditorWidgetWrapper

public slots:
void setEnabled( bool enabled ) override;
void setFeature( const QgsFeature &feature );
void setFeature( const QgsFeature &feature ) override;

private slots:
void textChanged( const QString &text );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsattributeform.cpp
Expand Up @@ -591,7 +591,7 @@ void QgsAttributeForm::pushSelectedFeaturesMessage()
}
}

void QgsAttributeForm::displayWarning( QString message )
void QgsAttributeForm::displayWarning( const QString& message )
{
mMessageBar->pushMessage( QString(),
message,
Expand Down
9 changes: 8 additions & 1 deletion src/gui/qgsattributeform.h
Expand Up @@ -75,7 +75,14 @@ class GUI_EXPORT QgsAttributeForm : public QWidget

const QgsFeature &feature() { return mFeature; }

void displayWarning( QString message );
/**
* Displays a warning message in the form message bar
* \param message message string
* \see mode()
* \since QGIS 3.12
*
*/
void displayWarning( const QString& message );

// TODO QGIS 4.0 - make private

Expand Down

0 comments on commit 08b7eca

Please sign in to comment.