qt-material-widgets/lib/style.h

38 lines
760 B
C
Raw Normal View History

2016-04-24 11:36:28 +00:00
#ifndef STYLE_H
#define STYLE_H
#include <QCommonStyle>
2016-05-11 22:18:09 +00:00
#include "theme.h"
2016-04-24 11:36:28 +00:00
class Style : public QCommonStyle
{
Q_OBJECT
public:
static Style &instance()
{
static Style instance;
2016-05-11 22:18:09 +00:00
instance.setTheme(new Theme);
2016-04-24 11:36:28 +00:00
return instance;
}
2016-05-11 22:18:09 +00:00
void setTheme(Theme *theme);
QColor themeColor(const QString &key) const;
2016-04-30 09:38:30 +00:00
void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
const QWidget *w = 0) const Q_DECL_OVERRIDE;
2016-05-14 10:41:40 +00:00
int pixelMetric(PixelMetric m, const QStyleOption *opt,
const QWidget *widget) const Q_DECL_OVERRIDE;
2016-04-24 11:36:28 +00:00
private:
Style() {}
Style(Style const &);
void operator=(Style const &);
2016-05-11 22:18:09 +00:00
Theme *_theme;
2016-04-24 11:36:28 +00:00
};
#endif // STYLE_H