DtkWidget
DTK Widget module
载入中...
搜索中...
未找到
dmessagemanager.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 - 2024 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DMESSAGEMANAGER_H
6#define DMESSAGEMANAGER_H
7
8#include <DObject>
9#include <QWidget>
10#include <dtkwidget_global.h>
11#include <dtkgui_global.h>
12
13DGUI_BEGIN_NAMESPACE
14class DDciIcon;
15DGUI_END_NAMESPACE
16
17DWIDGET_BEGIN_NAMESPACE
18class DFloatingMessage;
19class DMessageManagerPrivate;
20class DMessageManager: public QObject, public DCORE_NAMESPACE::DObject
21{
22 Q_OBJECT
23 D_DECLARE_PRIVATE(DMessageManager)
24
25private:
26 DMessageManager(); //构造函数是私有的
27
28public:
29 static DMessageManager *instance();
30
31 void sendMessage(QWidget *par, DFloatingMessage *floMsg);
32 void sendMessage(QWidget *par, const QIcon &icon, const QString &message);
33 void sendMessage(QWidget *par, const DGUI_NAMESPACE::DDciIcon &icon, const QString &message);
34 bool setContentMargens(QWidget *par, const QMargins &margins);
35
36protected:
37 bool eventFilter(QObject *watched, QEvent *event) override;
38};
39
40DWIDGET_END_NAMESPACE
41
42#endif // DMESSAGEMANAGER_H
static DMessageManager * instance()
DMessageManager::instance 构造一个单例对象
Definition dmessagemanager.cpp:68
bool eventFilter(QObject *watched, QEvent *event) override
DMessageManager::eventFilter 消息过滤
Definition dmessagemanager.cpp:88
bool setContentMargens(QWidget *par, const QMargins &margins)
DMessageManager::setContentMargens 设置中间间隔值
Definition dmessagemanager.cpp:83
一个浮动消息的类.
Definition dfloatingmessage.h:18
该控件是一个显示应用内部通知消息的控件。根据具体应用,可以让通知消息自动消失; 也可以让用户手动进行操作(如:点击“关闭”)后,通知消息消失。
Definition dmessagemanager.h:21