- QWidget* anEditor = 0;
-
- if ( theIndex.column() > 0 ) {
- QVariant aData = theIndex.data( Qt::DisplayRole );
-
- QLineEdit* aLineEdit = new QLineEdit( theParent );
- aLineEdit->setValidator( new QDoubleValidator( aLineEdit ) );
- aLineEdit->setText( aData.toString() );
-
- anEditor = aLineEdit;
- }
-
- if ( !anEditor) {
- anEditor = QItemDelegate::createEditor( theParent, theOption, theIndex );
- }
-
- return anEditor;
-}
-
-void HYDROGUI_GeoreferencementDlg::Delegate::setEditorData(
- QWidget* theEditor, const QModelIndex& theIndex ) const
-{
- QLineEdit* anEditor = qobject_cast<QLineEdit*>( theEditor );
- if ( anEditor ) {
- anEditor->setText( theIndex.data( Qt::EditRole ).toString() );
- }
-}
-
-void HYDROGUI_GeoreferencementDlg::Delegate::setModelData(
- QWidget* theEditor, QAbstractItemModel* theModel, const QModelIndex& theIndex) const
-{
- QLineEdit* anEditor = qobject_cast<QLineEdit*>( theEditor );
- if ( anEditor ) {
- theModel->setData( theIndex, anEditor->text() );
+ this->Name = theName;
+ this->isEmpty = theXg.isEmpty() && theYg.isEmpty() &&
+ theXd.isEmpty() && theYd.isEmpty();
+ this->isIncomplete = !isEmpty;
+
+ if ( isIncomplete ) {
+ bool isOk = false;
+
+ this->Xg= theXg.toDouble( &isOk );
+ if ( isOk ) {
+ this->Yg = theYg.toDouble( &isOk );
+ if ( isOk ) {
+ this->Xd = theXd.toDouble( &isOk );
+ if ( isOk ) {
+ this->Yd = theYd.toDouble( &isOk );
+ this->isIncomplete = !isOk;
+ }
+ }
+ }