From: Rene Gassmoeller Date: Thu, 30 Mar 2017 01:42:28 +0000 (-0600) Subject: Show string field X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c947c8c17c4f7ec7c6d568a11eca29551c68e37;p=parameter_gui.git Show string field --- diff --git a/parameter_delegate.cpp b/parameter_delegate.cpp index 462486a..28fc27a 100644 --- a/parameter_delegate.cpp +++ b/parameter_delegate.cpp @@ -243,11 +243,18 @@ namespace dealii { QString pattern_description = index.data(Qt::StatusTipRole).toString(); // load pattern description // stored in the StatusLine - QRegExp rx_filename("\\b(FileName)\\b"), + + + QRegExp rx_string("\\b(Anything|MultipleSelection|List|Map)\\b"), + rx_filename("\\b(FileName)\\b"), rx_dirname("\\b(DirectoryName)\\b"), rx_selection("\\b(Selection)\\b"); - if (rx_filename.indexIn (pattern_description) != -1) // if the type is "FileName" + if (rx_string.indexIn (pattern_description) != -1) // if the type is "Anything" + { + QItemDelegate::setEditorData(editor, index); + } + else if (rx_filename.indexIn (pattern_description) != -1) // if the type is "FileName" { QString file_name = index.data(Qt::DisplayRole).toString(); @@ -297,11 +304,16 @@ namespace dealii QString pattern_description = index.data(Qt::StatusTipRole).toString(); // load pattern description // stored in the StatusLine - QRegExp rx_filename("\\b(FileName)\\b"), + QRegExp rx_string("\\b(Anything|MultipleSelection|List|Map)\\b"), + rx_filename("\\b(FileName)\\b"), rx_dirname("\\b(DirectoryName)\\b"), rx_selection("\\b(Selection)\\b"); - if (rx_filename.indexIn (pattern_description) != -1) // if the type is "FileName" + if (rx_string.indexIn (pattern_description) != -1) // if the type is "Anything" + { + QItemDelegate::setModelData(editor, model, index); + } + else if (rx_filename.indexIn (pattern_description) != -1) // if the type is "FileName" { BrowseLineEdit * filename_editor = qobject_cast(editor); // set the text from the editor QString value = filename_editor->text();