Marble

MarbleDeclarativeObject.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2012 Dennis Nienhüser <nienhueser@kde.org>
4//
5
6#ifndef MARBLE_DECLARATIVE_OBJECT_H
7#define MARBLE_DECLARATIVE_OBJECT_H
8
9#include <QObject>
10#include <qqmlintegration.h>
11
12class MarbleDeclarativeObjectPrivate;
13
14/**
15 * Provides access to global Marble related properties and methods
16 * to QML (intended to be registered as a global QML object)
17 */
19{
21 QML_NAMED_ELEMENT(Marble)
22 QML_SINGLETON
23
24 Q_PROPERTY(QString version READ version CONSTANT)
25
26public:
27 explicit MarbleDeclarativeObject(QObject *parent = nullptr);
28
29 ~MarbleDeclarativeObject() override;
30
31 /** Returns the Marble library version */
32 QString version() const;
33
34public Q_SLOTS:
35 /**
36 * @brief resolvePath Resolves files in the marble data path
37 * @param path Relative path to a file installed in Marble's data path
38 * @return The absolute path to the given file, or an empty string if the
39 * relative path cannot be resolved
40 * @see MarbleDirs
41 */
42 QString resolvePath(const QString &path) const;
43
44 /**
45 * @brief canExecute Check whether a given program is found in the path
46 * @param program The name of the program
47 * @return Returns true iff the given program is found in one of
48 * directories defined by the PATH environment variable (as reported by
49 * QProcessEnvironment) and has the executable bit set
50 */
51 bool canExecute(const QString &program) const;
52
53private:
54 MarbleDeclarativeObjectPrivate *const d;
55};
56
57#endif
Provides access to global Marble related properties and methods to QML (intended to be registered as ...
bool canExecute(const QString &program) const
canExecute Check whether a given program is found in the path
QString resolvePath(const QString &path) const
resolvePath Resolves files in the marble data path
Binds a QML item to a specific geodetic location in screen coordinates.
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.