Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
4#ifndef QQUICKLABSPLATFORMSYSTEMTRAYICON_P_H
5#define QQUICKLABSPLATFORMSYSTEMTRAYICON_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/qurl.h>
19#include <QtCore/qrect.h>
20#include <QtGui/qpa/qplatformsystemtrayicon.h>
21#include <QtQml/qqmlparserstatus.h>
22#include <QtQml/qqml.h>
23
25
26QT_REQUIRE_CONFIG(systemtrayicon);
27
29
32
34{
36 QML_NAMED_ELEMENT(SystemTrayIcon)
39 Q_PROPERTY(bool available READ isAvailable CONSTANT FINAL)
44 Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged FINAL REVISION(1, 1))
45 Q_PROPERTY(QQuickLabsPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(1, 1))
46
47public:
50
52
53 bool isAvailable() const;
54 bool supportsMessages() const;
55
56 bool isVisible() const;
57 void setVisible(bool visible);
58
59 QString tooltip() const;
60 void setTooltip(const QString &tooltip);
61
64
65 QRect geometry() const;
66
69
70public Q_SLOTS:
71 void show();
72 void hide();
73
74 void showMessage(const QString &title, const QString &message,
75 QPlatformSystemTrayIcon::MessageIcon iconType = QPlatformSystemTrayIcon::Information, int msecs = 10000);
76
78 void activated(QPlatformSystemTrayIcon::ActivationReason reason);
83 Q_REVISION(2, 1) void geometryChanged();
84 Q_REVISION(2, 1) void iconChanged();
85
86protected:
87 void init();
88 void cleanup();
89
90 void classBegin() override;
91 void componentComplete() override;
92
94
96 void updateIcon();
97
99 bool m_complete;
100 bool m_visible;
101 QString m_tooltip;
103 mutable QQuickLabsPlatformIconLoader *m_iconLoader;
104 QPlatformSystemTrayIcon *m_handle;
105};
106
108
109#endif // QQUICKLABSPLATFORMSYSTEMTRAYICON_P_H
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QQmlParserStatus class provides updates on the QML parser state.
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 activated(QPlatformSystemTrayIcon::ActivationReason reason)
void classBegin() override
Invoked after class creation, but before any properties have been set.
QQuickLabsPlatformIconLoader * iconLoader() const
void show()
\qmlmethod void Qt.labs.platform::SystemTrayIcon::show()
bool isAvailable() const
\readonly \qmlproperty bool Qt.labs.platform::SystemTrayIcon::available
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setIcon(const QQuickLabsPlatformIcon &icon)
\inmodule QtCore\reentrant
Definition qrect.h:30
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
GLuint64 GLenum void * handle
GLuint GLsizei const GLchar * message
#define QML_NAMED_ELEMENT(NAME)
#define QML_EXTENDED_NAMESPACE(EXTENDED_NAMESPACE)
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_INTERFACES(x)
#define Q_SLOTS
#define Q_SIGNALS
#define explicit
QString title
[35]