Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
Environment.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <PhosphorShell/phosphorshell_export.h>
7
8#include <QObject>
9#include <QString>
10
11namespace PhosphorShell {
12
13// Exposed to QML as a context property (`Environment`) by ShellEngine —
14// not registered as a QML singleton. Q_INVOKABLE methods are still
15// callable from QML through the context-property pointer.
16class PHOSPHORSHELL_EXPORT Environment : public QObject
17{
18 Q_OBJECT
19
20public:
21 explicit Environment(QObject* parent = nullptr);
22 ~Environment() override;
23
24 [[nodiscard]] Q_INVOKABLE QString get(const QString& name) const;
25 [[nodiscard]] Q_INVOKABLE bool has(const QString& name) const;
26};
27
28} // namespace PhosphorShell
Definition Environment.h:17
bool has(const QString &name) const
QString get(const QString &name) const
Environment(QObject *parent=nullptr)
Definition Environment.h:11