Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquicklabsplatformsystemtrayicon_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKLABSPLATFORMSYSTEMTRAYICON_P_H
6#define QQUICKLABSPLATFORMSYSTEMTRAYICON_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qurl.h>
20#include <QtCore/qrect.h>
21#include <QtGui/qpa/qplatformsystemtrayicon.h>
22#include <QtQml/qqmlparserstatus.h>
23#include <QtQml/qqml.h>
24
26
28
29QT_BEGIN_NAMESPACE
30
31class QQuickLabsPlatformMenu;
33
35{
36 Q_OBJECT
37 QML_NAMED_ELEMENT(SystemTrayIcon)
47
48public:
51
53
54 bool isAvailable() const;
55 bool supportsMessages() const;
56
57 bool isVisible() const;
58 void setVisible(bool visible);
59
60 QString tooltip() const;
61 void setTooltip(const QString &tooltip);
62
65
66 QRect geometry() const;
67
69 void setIcon(const QQuickLabsPlatformIcon &icon);
70
71public Q_SLOTS:
72 void show();
73 void hide();
74
75 void showMessage(const QString &title, const QString &message,
76 QPlatformSystemTrayIcon::MessageIcon iconType = QPlatformSystemTrayIcon::Information, int msecs = 10000);
77
85 Q_REVISION(1, 1) void iconChanged();
86
87protected:
88 void init();
89 void cleanup();
90
91 void classBegin() override;
93
95
96private Q_SLOTS:
97 void updateIcon();
98
99private:
100 bool m_complete;
101 bool m_visible;
102 QString m_tooltip;
104 mutable QQuickLabsPlatformIconLoader *m_iconLoader;
105 QPlatformSystemTrayIcon *m_handle;
106};
107
108QT_END_NAMESPACE
109
110#endif // QQUICKLABSPLATFORMSYSTEMTRAYICON_P_H
void setIcon(const QQuickLabsPlatformIcon &icon)
QQuickLabsPlatformIcon icon() const
bool operator==(const QQuickLabsPlatformIcon &other) const
QQuickLabsPlatformMenu * menu() const
\qmlproperty Menu Qt.labs.platform::SystemTrayIcon::menu
void hide()
\qmlmethod void Qt.labs.platform::SystemTrayIcon::hide()
bool isVisible() const
\qmlproperty bool Qt.labs.platform::SystemTrayIcon::visible
void showMessage(const QString &title, const QString &message, QPlatformSystemTrayIcon::MessageIcon iconType=QPlatformSystemTrayIcon::Information, int msecs=10000)
\qmlmethod void Qt.labs.platform::SystemTrayIcon::showMessage(string title, string message,...
void classBegin() override
Invoked after class creation, but before any properties have been set.
QQuickLabsPlatformIconLoader * iconLoader() const
bool isAvailable() const
\readonly \qmlproperty bool Qt.labs.platform::SystemTrayIcon::available
bool supportsMessages() const
\readonly \qmlproperty bool Qt.labs.platform::SystemTrayIcon::supportsMessages
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
Q_REVISION(1, 1) void geometryChanged()
void setIcon(const QQuickLabsPlatformIcon &icon)
QString tooltip() const
\qmlproperty string Qt.labs.platform::SystemTrayIcon::tooltip
QT_REQUIRE_CONFIG(thread)