BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
MinimizerItemCatalog.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Model/CatJob/MinimizerItemCatalog.cpp
6 //! @brief Implements MinimizerItemCatalog class
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
16 #include "Fit/Kernel/MinimizerFactory.h"
17 #include "GUI/Util/String.h"
18 
19 //! Returns ComboProperty representing list of algorithms defined for given minimizerType.
20 
22 {
23  ComboProperty result = ComboProperty() << algorithmNames(minimizerType);
24  result.setToolTips(algorithmDescriptions(minimizerType));
25  return result;
26 }
27 
28 //! Returns list of algorithm names defined for given minimizer.
29 
30 QStringList MinimizerItemCatalog::algorithmNames(const QString& minimizerType)
31 {
32  std::vector<std::string> algos =
33  MinimizerFactory::catalog().algorithmNames(minimizerType.toStdString());
35 }
36 
37 //! Returns list of algoritm descriptions defined for given minimizer.
38 
39 QStringList MinimizerItemCatalog::algorithmDescriptions(const QString& minimizerType)
40 {
41  std::vector<std::string> descr =
42  MinimizerFactory::catalog().algorithmDescriptions(minimizerType.toStdString());
44 }
Defines MinimizerItemCatalog class.
Defines functions from namespace GUI::Util::String.
Custom property to define list of string values with multiple selections. Intended for QVariant.
Definition: ComboProperty.h:25
void setToolTips(const QStringList &tooltips)
static ComboProperty algorithmCombo(const QString &minimizerType)
Returns ComboProperty representing list of algorithms defined for given minimizerType.
static QStringList algorithmNames(const QString &minimizerType)
Returns list of algorithm names defined for given minimizer.
static QStringList algorithmDescriptions(const QString &minimizerType)
Returns list of algoritm descriptions defined for given minimizer.
QStringList fromStdStrings(const std::vector< std::string > &container)
Definition: String.cpp:18