BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FitLogFlags.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/FitWidgets/FitLogFlags.cpp
6 //! @brief Implements class FitLogFlags
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 <QMap>
17 
18 namespace {
19 
20 QMap<FitLogFlags::MessageType, Qt::GlobalColor> messageTypeToColorMap()
21 {
22  QMap<FitLogFlags::MessageType, Qt::GlobalColor> result;
23  result[FitLogFlags::DEFAULT] = Qt::black;
24  result[FitLogFlags::SUCCESS] = Qt::darkBlue;
25  result[FitLogFlags::HIGHLIGHT] = Qt::darkGreen;
26  result[FitLogFlags::WARNING] = Qt::darkYellow;
27  result[FitLogFlags::ERROR] = Qt::darkRed;
28  return result;
29 }
30 
31 } // namespace
32 
33 Qt::GlobalColor FitLogFlags::color(MessageType messageType)
34 {
35  static auto typeToColor = messageTypeToColorMap();
36 
37  if (typeToColor.find(messageType) == typeToColor.end())
38  return Qt::red;
39 
40  return typeToColor[messageType];
41 }
Defines class FitSuiteManager.
static Qt::GlobalColor color(MessageType messageType)
Definition: FitLogFlags.cpp:33