From bd153fc535cdfdc9480e1599d0717ddf205ed7ab Mon Sep 17 00:00:00 2001 From: bangerth Date: Mon, 20 Dec 2010 23:16:31 +0000 Subject: [PATCH] Update. git-svn-id: https://svn.dealii.org/trunk@23036 0785d39b-7218-0410-832d-ea1e28bc413d --- .../parameter_gui/parameter_delegate.cpp | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) 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())); -- 2.39.5