Skip to content
Permalink
Browse files

Fix editor vertex with "non-dot" locales

Fixes #29682
  • Loading branch information
elpaso committed Jun 11, 2020
1 parent 60fe81a commit ab149e11a3b8923965cee921940af614d23e79f9
Showing with 11 additions and 1 deletion.
  1. +8 −1 src/app/vertextool/qgsvertexeditor.cpp
  2. +3 −0 src/app/vertextool/qgsvertexeditor.h
@@ -499,4 +499,11 @@ void CoordinateItemDelegate::setModelData( QWidget *editor, QAbstractItemModel *
}
}


void CoordinateItemDelegate::setEditorData( QWidget *editor, const QModelIndex &index ) const
{
QLineEdit *lineEdit = qobject_cast<QLineEdit *>( editor );
if ( lineEdit && index.isValid() )
{
lineEdit->setText( QLocale().toString( index.data( ).toDouble( ) ) );
}
}
@@ -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

0 comments on commit ab149e1

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