Browse Source

Display "No description" rather than empty string in model view

(Thanks Andras Lasso!)
Steve Pieper 13 years ago
parent
commit
7f586848d6
1 changed files with 10 additions and 1 deletions
  1. 10 1
      Libs/DICOM/Core/ctkDICOMModel.cpp

+ 10 - 1
Libs/DICOM/Core/ctkDICOMModel.cpp

@@ -497,7 +497,16 @@ QVariant ctkDICOMModel::data ( const QModelIndex & dataIndex, int role ) const
     // invalid).
     return QString();
     }
-  return d->value(parentIndex, dataIndex.row(), field);
+
+  QVariant dataValue=d->value(parentIndex, dataIndex.row(), field);
+  if (dataValue.isNull())
+  {
+    if (columnName.compare("Name")==0)
+    {
+      return QString("No description");
+    }
+  }
+  return dataValue;
 }
 
 //------------------------------------------------------------------------------