Fabcoin Core  0.16.2
P2P Digital Currency
styleSheet.h
Go to the documentation of this file.
1 #ifndef STYLESHEET_H
2 #define STYLESHEET_H
3 
4 #include <QMap>
5 #include <QString>
6 
7 class QWidget;
8 class QApplication;
9 
10 #define SetObjectStyleSheet(object, name) StyleSheet::instance().setStyleSheet(object, name)
11 
14 namespace StyleSheetNames
15 {
16  static const QString App = "app";
17  static const QString Invalid = "invalid";
18  static const QString TableViewLight = "tableviewlight";
19  static const QString ButtonBlack = "buttonblack";
20  static const QString ButtonWhite = "buttonwhite";
21  static const QString ButtonBlue = "buttonblue";
22  static const QString ButtonTransparent = "buttontransparent";
23  static const QString ButtonTransparentBordered = "buttontransparentbordered";
24  static const QString ToolBlack = "toolblack";
25  static const QString ToolGroupBlack = "toolgroupblack";
26  static const QString ToolSubBlack = "toolsubblack";
27  static const QString TreeView = "treeview";
28  static const QString ScrollBarLight = "scrollbarlight";
29  static const QString ScrollBarDark = "scrollbardark";
30 }
31 
35 {
36 public:
37  static StyleSheet& instance();
38  void setStyleSheet(QWidget* widget, const QString& style_name);
39  void setStyleSheet(QApplication* app, const QString& style_name);
40 
41 private:
42  QString getStyleSheet(const QString& style_name);
43 
44  template<typename T>
45  void setObjectStyleSheet(T* object, const QString& style_name);
46 
47  explicit StyleSheet();
48  QMap<QString, QString> m_cacheStyles;
49 };
50 #endif // STYLESHEET_H
#define T(i, x)
QMap< QString, QString > m_cacheStyles
Definition: styleSheet.h:48
Singleton class that manage the styles.
Definition: styleSheet.h:34
Names of the styles that will be used for the GUI components appearance.
Definition: styleSheet.h:14