From: Wolfgang Bangerth Date: Mon, 20 Dec 2010 23:16:31 +0000 (+0000) Subject: Update. X-Git-Tag: v8.0.0~4623 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d6fbd3454a001e9fe88e9fdd0595a69c70240c5a;p=dealii.git Update. git-svn-id: https://svn.dealii.org/trunk@23036 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/parameter_gui/parameter_delegate.cpp b/deal.II/contrib/parameter_gui/parameter_delegate.cpp index 6530425656..f0754f4402 100644 --- a/deal.II/contrib/parameter_gui/parameter_delegate.cpp +++ b/deal.II/contrib/parameter_gui/parameter_delegate.cpp @@ -85,7 +85,8 @@ QWidget *ParameterDelegate::createEditor(QWidget *parent, rx_dirname("\\b(DirectoryName)\\b"), rx_integer("\\b(Integer)\\b"), rx_double("\\b(Double|Float|Floating)\\b"), - rx_selection("\\b(Selection)\\b"); + rx_selection("\\b(Selection)\\b"), + rx_bool("\\b(Bool)\\b"); if (rx_string.indexIn (pattern_description) != -1) // if the type "Anything" { @@ -181,6 +182,24 @@ QWidget *ParameterDelegate::createEditor(QWidget *parent, combo_box->setEditable(false); + connect(combo_box, SIGNAL(currentIndexChanged(int)), // connect editors signal to the closer function + this, SLOT(commit_and_close_editor())); + + return combo_box; + } + else if (rx_bool.indexIn (pattern_description) != -1) // and booleans + { + QComboBox * combo_box = new QComboBox(parent); + + std::vector choices; // list with the different items + choices.push_back(std::string("true")); // add true + choices.push_back(std::string("false")); // and false + + for (unsigned int i=0; iaddItem (tr(choices[i].c_str()), tr(choices[i].c_str())); + + combo_box->setEditable(false); + connect(combo_box, SIGNAL(currentIndexChanged(int)), // connect editors signal to the closer function this, SLOT(commit_and_close_editor()));