DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dalertcontrol.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2020 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DALERTCONTROL_H
6#define DALERTCONTROL_H
7
8#include <QObject>
9#include <QPointer>
10
11#include <DFloatingWidget>
12#include <DToolTip>
13
14DWIDGET_BEGIN_NAMESPACE
15class DAlertControlPrivate;
16class LIBDTKWIDGETSHARED_EXPORT DAlertControl : public QObject, public DTK_CORE_NAMESPACE::DObject
17{
18 Q_OBJECT
19 Q_DISABLE_COPY(DAlertControl)
20 D_DECLARE_PRIVATE(DAlertControl)
21 Q_PROPERTY(bool alert READ isAlert WRITE setAlert NOTIFY alertChanged)
22 Q_PROPERTY(QColor alertColor READ alertColor WRITE setAlertColor)
23
24public:
25 explicit DAlertControl(QWidget *target, QObject *parent = nullptr);
26 ~DAlertControl() override;
27
28 void setAlert(bool isAlert);
29 bool isAlert() const;
30 void setAlertColor(QColor c);
31 QColor alertColor() const;
32 QColor defaultAlertColor() const;
33 void setMessageAlignment(Qt::Alignment alignment);
34 Qt::Alignment messageAlignment() const;
35 void showAlertMessage(const QString &text, int duration = 3000);
36 void showAlertMessage(const QString &text, QWidget *follower, int duration = 3000);
37 void hideAlertMessage();
38
39Q_SIGNALS:
40 void alertChanged(bool alert) const;
41
42protected:
43 DAlertControl(DAlertControlPrivate &d, QObject *parent);
44 bool eventFilter(QObject *watched, QEvent *event) override;
45
46};
47
48DWIDGET_END_NAMESPACE
49#endif // DALERTCONTROL_H
Definition dalertcontrol_p.h:15
此类是提供了应用程序的警告对话框, 符合Deepin风格
Definition dalertcontrol.h:17