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)
48
49public:
52
54
55 bool isAvailable() const;
56 bool supportsMessages() const;
57
58 bool isVisible() const;
59 void setVisible(bool visible);
60
61 QString tooltip() const;
62 void setTooltip(const QString &tooltip);
63
66
67 QRect geometry() const;
68
70 void setIcon(const QQuickLabsPlatformIcon &icon);
71
72public Q_SLOTS:
73 void show();
74 void hide();
75
76 void showMessage(const QString &title, const QString &message,
77 QPlatformSystemTrayIcon::MessageIcon iconType = QPlatformSystemTrayIcon::Information, int msecs = 10000);
78
86 Q_REVISION(1, 1) void iconChanged();
87
88protected:
89 void init();
90 void cleanup();
91
92 void classBegin() override;
94
96
97private Q_SLOTS:
98 void updateIcon();
99
100private:
101 bool m_complete;
102 bool m_visible;
103 QString m_tooltip;
105 mutable QQuickLabsPlatformIconLoader *m_iconLoader;
106 QPlatformSystemTrayIcon *m_handle;
107};
108
109QT_END_NAMESPACE
110
111#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
Combined button and popup list for selecting options.
QT_REQUIRE_CONFIG(liburing)