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
11class MarbleDeclarativeObjectPrivate;
12
13/**
14 * Provides access to global Marble related properties and methods
15 * to QML (intended to be registered as a global QML object)
16 */
18{
20
21 Q_PROPERTY(QString version READ version CONSTANT)
22
23public:
24 explicit MarbleDeclarativeObject( QObject* parent = nullptr );
25
26 ~MarbleDeclarativeObject() override;
27
28 /** Returns the Marble library version */
29 QString version() const;
30
31public Q_SLOTS:
32 /**
33 * @brief resolvePath Resolves files in the marble data path
34 * @param path Relative path to a file installed in Marble's data path
35 * @return The absolute path to the given file, or an empty string if the
36 * relative path cannot be resolved
37 * @see MarbleDirs
38 */
39 QString resolvePath( const QString &path ) const;
40
41 /**
42 * @brief canExecute Check whether a given program is found in the path
43 * @param program The name of the program
44 * @return Returns true iff the given program is found in one of
45 * directories defined by the PATH environment variable (as reported by
46 * QProcessEnvironment) and has the executable bit set
47 */
48 bool canExecute( const QString &program ) const;
49
50private:
51 MarbleDeclarativeObjectPrivate* const d;
52};
53
54#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
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SLOTSQ_SLOTS
QObject * parent() const const
T qobject_cast(QObject *object)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:18:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.