diff --git a/src/app/vertextool/qgsvertexeditor.cpp b/src/app/vertextool/qgsvertexeditor.cpp index 6e15f25a4a21..515353314449 100644 --- a/src/app/vertextool/qgsvertexeditor.cpp +++ b/src/app/vertextool/qgsvertexeditor.cpp @@ -499,4 +499,11 @@ void CoordinateItemDelegate::setModelData( QWidget *editor, QAbstractItemModel * } } - +void CoordinateItemDelegate::setEditorData( QWidget *editor, const QModelIndex &index ) const +{ + QLineEdit *lineEdit = qobject_cast( editor ); + if ( lineEdit && index.isValid() ) + { + lineEdit->setText( QLocale().toString( index.data( ).toDouble( ) ) ); + } +} diff --git a/src/app/vertextool/qgsvertexeditor.h b/src/app/vertextool/qgsvertexeditor.h index 38264c6f69ae..6c30db7e9cba 100644 --- a/src/app/vertextool/qgsvertexeditor.h +++ b/src/app/vertextool/qgsvertexeditor.h @@ -140,6 +140,9 @@ class APP_EXPORT CoordinateItemDelegate : public QStyledItemDelegate protected: QWidget *createEditor( QWidget *parent, const QStyleOptionViewItem & /*option*/, const QModelIndex &index ) const override; void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const override; + void setEditorData( QWidget *editor, const QModelIndex &index ) const override; }; + + #endif // QGSVERTEXEDITOR_H