| 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 QWHATSTHIS_H |
| 5 | #define QWHATSTHIS_H |
| 6 | |
| 7 | #include <QtWidgets/qtwidgetsglobal.h> |
| 8 | #include <QtCore/qobject.h> |
| 9 | #include <QtGui/qcursor.h> |
| 10 | |
| 11 | QT_REQUIRE_CONFIG(whatsthis); |
| 12 | |
| 13 | QT_BEGIN_NAMESPACE |
| 14 | |
| 15 | #if QT_CONFIG(action) |
| 16 | class QAction; |
| 17 | #endif // QT_CONFIG(action) |
| 18 | |
| 19 | class Q_WIDGETS_EXPORT QWhatsThis |
| 20 | { |
| 21 | QWhatsThis() = delete; |
| 22 | |
| 23 | public: |
| 24 | static void enterWhatsThisMode(); |
| 25 | static bool inWhatsThisMode(); |
| 26 | static void leaveWhatsThisMode(); |
| 27 | |
| 28 | static void showText(const QPoint &pos, const QString &text, QWidget *w = nullptr); |
| 29 | static void hideText(); |
| 30 | |
| 31 | #if QT_CONFIG(action) |
| 32 | static QAction *createAction(QObject *parent = nullptr); |
| 33 | #endif // QT_CONFIG(action) |
| 34 | |
| 35 | }; |
| 36 | |
| 37 | QT_END_NAMESPACE |
| 38 | |
| 39 | #endif // QWHATSTHIS_H |
| 40 | |