DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dpalettehelper.h
1// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DPALETTEHELPER_H
6#define DPALETTEHELPER_H
7
8#include <dtkwidget_global.h>
9#include <DPalette>
10#include <DObject>
11
12
13DWIDGET_BEGIN_NAMESPACE
14
15DGUI_USE_NAMESPACE
16
17class DPaletteHelperPrivate;
18class DPaletteHelper : public QObject
19 , public DCORE_NAMESPACE::DObject
20{
21 Q_OBJECT
22
23public:
24 static DPaletteHelper *instance();
25
26 DPalette palette(const QWidget *widget, const QPalette &base = QPalette()) const;
27 void setPalette(QWidget *widget, const DPalette &palette);
28 void resetPalette(QWidget *widget);
29
30private:
31 DPaletteHelper(QObject *parent = nullptr);
32 ~DPaletteHelper() override;
33
34 bool eventFilter(QObject *watched, QEvent *event) override;
35
36 D_DECLARE_PRIVATE(DPaletteHelper)
37};
38
39DWIDGET_END_NAMESPACE
40
41#endif // DPALETTEHELPER_H
Definition dpalettehelper.h:20