QtCanpool 3.3.0
载入中...
搜索中...
未找到
qxtoast_p.h
浏览该文件的文档.
1
5#pragma once
6
7#include "qxapp_global.h"
8#include "qxtoast.h"
9
10QT_BEGIN_NAMESPACE
11class QGraphicsOpacityEffect;
12class QPropertyAnimation;
13class QTimer;
14class QLabel;
15QT_END_NAMESPACE
16
18
30{
32public:
34 void init();
35
37 void applyLevel();
39 void placeChildren();
41 void startFade(qreal to, bool dismissWhenFaded);
43 void finishDismiss();
44
46 int plateWidth(int outerWidth) const;
48 static int textWidthFor(int plateWidth);
50 int outerHeightFor(int outerWidth) const;
51public:
52 QString m_text;
53 QxToast::Level m_level = QxToast::Information;
54 int m_timeout = QxToast::DefaultTimeout;
55 int m_fadeDuration = QxToast::DefaultFadeDuration;
57 int m_remaining = 0;
58 bool m_dismissing = false;
59 bool m_paused = false;
60 bool m_dismissWhenFaded = false;
61 QLabel *m_icon = Q_NULLPTR;
62 QLabel *m_label = Q_NULLPTR;
63 QTimer *m_timer = Q_NULLPTR;
64 QGraphicsOpacityEffect *m_effect = Q_NULLPTR;
65 QPropertyAnimation *m_fade = Q_NULLPTR;
66};
67
The state behind QxToast: the message, the level, the clock and the two animations.
Definition qxtoast_p.h:30
One short message, shown over the window it belongs to and gone a few seconds later.
Definition qxtoast.h:54
Level
What the message is about; it selects the icon and the accent colour.
Definition qxtoast.h:58
#define QX_APP_END_NAMESPACE
#define QX_DECLARE_PUBLIC(Class)
#define Q_NULLPTR
Copyleft (C) 2025 maminjie canpool@163.com SPDX-License-Identifier: MulanPSL-2.0
#define QX_APP_BEGIN_NAMESPACE