Skip to content

Commit 08b7eca

Browse files
committedNov 23, 2019
Fix docstrings and respond to feedback
1 parent 51c1289 commit 08b7eca

File tree

6 files changed

+23
-7
lines changed

6 files changed

+23
-7
lines changed
 

‎python/gui/auto_generated/qgsattributeform.sip.in

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,16 @@ class QgsAttributeForm : QWidget
4444

4545
const QgsFeature &feature();
4646

47-
void displayWarning( QString message );
47+
void displayWarning( const QString& message );
48+
%Docstring
49+
Displays a warning message in the form message bar
50+
51+
:param message: message string
52+
53+
.. seealso:: :py:func:`mode`
54+
55+
.. versionadded:: 3.12
56+
%End
4857

4958

5059
void hideButtonBox();

‎src/gui/editorwidgets/core/qgseditorwidgetwrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ class GUI_EXPORT QgsEditorWidgetWrapper : public QgsWidgetWrapper
360360
*/
361361
bool setFormFeatureAttribute( const QString &attributeName, const QVariant &attributeValue );
362362

363-
protected:
363+
private:
364364

365365
/**
366366
* Is called, when the value of the widget needs to be changed. Update the widget representation

‎src/gui/editorwidgets/qgstexteditwrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,12 @@ void QgsTextEditWrapper::setFeature( const QgsFeature &feature )
203203
{
204204
// Do nothing if the value has not changed
205205
if ( mInvalidJSON )
206-
mForm->displayWarning( tr( "Your JSON is invalid and will be reverted back to what was in the datastore before editing" ) );
206+
mForm->displayWarning( tr( "Your JSON is invalid and will be reverted back to the last valid edit or the original data" ) );
207207
{
208208
mInvalidJSON = false;
209209
}
210210
setFormFeature( feature );
211-
setValue( feature.attribute( mFieldIdx ) );
211+
setValue( feature.attribute( fieldIdx() ) );
212212
}
213213

214214
void QgsTextEditWrapper::updateValues( const QVariant &val, const QVariantList & )

‎src/gui/editorwidgets/qgstexteditwrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class GUI_EXPORT QgsTextEditWrapper : public QgsEditorWidgetWrapper
7474

7575
public slots:
7676
void setEnabled( bool enabled ) override;
77-
void setFeature( const QgsFeature &feature );
77+
void setFeature( const QgsFeature &feature ) override;
7878

7979
private slots:
8080
void textChanged( const QString &text );

‎src/gui/qgsattributeform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ void QgsAttributeForm::pushSelectedFeaturesMessage()
591591
}
592592
}
593593

594-
void QgsAttributeForm::displayWarning( QString message )
594+
void QgsAttributeForm::displayWarning( const QString& message )
595595
{
596596
mMessageBar->pushMessage( QString(),
597597
message,

‎src/gui/qgsattributeform.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
7575

7676
const QgsFeature &feature() { return mFeature; }
7777

78-
void displayWarning( QString message );
78+
/**
79+
* Displays a warning message in the form message bar
80+
* \param message message string
81+
* \see mode()
82+
* \since QGIS 3.12
83+
*
84+
*/
85+
void displayWarning( const QString& message );
7986

8087
// TODO QGIS 4.0 - make private
8188

0 commit comments

Comments
 (0)
Please sign in to comment.