1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QSPLASHSCREEN_H |
5 | #define QSPLASHSCREEN_H |
6 | |
7 | #include <QtWidgets/qtwidgetsglobal.h> |
8 | #include <QtGui/qpixmap.h> |
9 | #include <QtWidgets/qwidget.h> |
10 | |
11 | QT_REQUIRE_CONFIG(splashscreen); |
12 | |
13 | QT_BEGIN_NAMESPACE |
14 | |
15 | class QSplashScreenPrivate; |
16 | |
17 | class Q_WIDGETS_EXPORT QSplashScreen : public QWidget |
18 | { |
19 | Q_OBJECT |
20 | public: |
21 | explicit QSplashScreen(const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = Qt::WindowFlags()); |
22 | QSplashScreen(QScreen *screen, const QPixmap &pixmap = QPixmap(), Qt::WindowFlags f = Qt::WindowFlags()); |
23 | virtual ~QSplashScreen(); |
24 | |
25 | void setPixmap(const QPixmap &pixmap); |
26 | const QPixmap pixmap() const; |
27 | void finish(QWidget *w); |
28 | void repaint(); |
29 | QString message() const; |
30 | |
31 | public Q_SLOTS: |
32 | void showMessage(const QString &message, int alignment = Qt::AlignLeft, |
33 | const QColor &color = Qt::black); |
34 | void clearMessage(); |
35 | |
36 | Q_SIGNALS: |
37 | void messageChanged(const QString &message); |
38 | |
39 | protected: |
40 | bool event(QEvent *e) override; |
41 | virtual void drawContents(QPainter *painter); |
42 | void mousePressEvent(QMouseEvent *) override; |
43 | |
44 | private: |
45 | Q_DISABLE_COPY(QSplashScreen) |
46 | Q_DECLARE_PRIVATE(QSplashScreen) |
47 | }; |
48 | |
49 | QT_END_NAMESPACE |
50 | |
51 | #endif // QSPLASHSCREEN_H |
52 |