ArchitectureColoredPainting/qt-material-widgets/components/lib/qtmaterialstyle.h

41 lines
842 B
C
Raw Normal View History

2023-03-06 12:38:25 +08:00
#ifndef QTMATERIALSTYLE_H
#define QTMATERIALSTYLE_H
#include <QtWidgets/QCommonStyle>
#include "lib/qtmaterialstyle_p.h"
#define MATERIAL_DISABLE_THEME_COLORS \
if (d->useThemeColors == true) { d->useThemeColors = false; }
class QtMaterialTheme;
class QtMaterialStyle : public QCommonStyle
{
Q_OBJECT
public:
inline static QtMaterialStyle &instance();
void setTheme(QtMaterialTheme *theme);
QColor themeColor(const QString &key) const;
protected:
const QScopedPointer<QtMaterialStylePrivate> d_ptr;
private:
Q_DECLARE_PRIVATE(QtMaterialStyle)
QtMaterialStyle();
QtMaterialStyle(QtMaterialStyle const &);
void operator=(QtMaterialStyle const &);
};
inline QtMaterialStyle &QtMaterialStyle::instance()
{
static QtMaterialStyle instance;
return instance;
}
#endif // QTMATERIALSTYLE_H