2022-08-11 09:32:48 +08:00
|
|
|
// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd.
|
|
|
|
|
//
|
|
|
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
|
|
|
|
2019-09-08 15:14:08 +08:00
|
|
|
#ifndef DAPPLICATIONHELPER_H
|
|
|
|
|
#define DAPPLICATIONHELPER_H
|
|
|
|
|
|
|
|
|
|
#include <dtkwidget_global.h>
|
|
|
|
|
#include <DGuiApplicationHelper>
|
|
|
|
|
#include <DPalette>
|
|
|
|
|
|
2023-07-03 14:40:55 +08:00
|
|
|
#if DTK_VERSION < DTK_VERSION_CHECK(6, 0, 0, 0)
|
|
|
|
|
|
2019-09-08 15:14:08 +08:00
|
|
|
DWIDGET_BEGIN_NAMESPACE
|
|
|
|
|
|
2023-06-16 17:15:04 +08:00
|
|
|
DGUI_USE_NAMESPACE
|
|
|
|
|
|
2020-12-19 14:54:10 +08:00
|
|
|
class D_DECL_DEPRECATED_X("Use DPaletteHelper") DApplicationHelper : public DGuiApplicationHelper
|
2019-09-08 15:14:08 +08:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
static DApplicationHelper *instance();
|
|
|
|
|
|
|
|
|
|
DPalette palette(const QWidget *widget, const QPalette &base = QPalette()) const;
|
|
|
|
|
void setPalette(QWidget *widget, const DPalette &palette);
|
2019-09-24 14:00:27 +08:00
|
|
|
void resetPalette(QWidget *widget);
|
2019-09-08 15:14:08 +08:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
DApplicationHelper();
|
|
|
|
|
~DApplicationHelper();
|
|
|
|
|
|
|
|
|
|
bool eventFilter(QObject *watched, QEvent *event) override;
|
2019-11-13 10:22:08 +08:00
|
|
|
bool event(QEvent *event) override;
|
2019-09-08 15:14:08 +08:00
|
|
|
|
|
|
|
|
friend class _DApplicationHelper;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
DWIDGET_END_NAMESPACE
|
|
|
|
|
|
|
|
|
|
#endif // DAPPLICATIONHELPER_H
|
2023-07-03 14:40:55 +08:00
|
|
|
|
|
|
|
|
#endif
|