Marble

MarbleDeclarativeObject.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2012 Dennis Nienhüser <[email protected]>
4 //
5 
6 #ifndef MARBLE_DECLARATIVE_OBJECT_H
7 #define MARBLE_DECLARATIVE_OBJECT_H
8 
9 #include <QObject>
10 
11 class 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 {
19  Q_OBJECT
20 
21  Q_PROPERTY(QString version READ version CONSTANT)
22 
23 public:
24  explicit MarbleDeclarativeObject( QObject* parent = nullptr );
25 
26  ~MarbleDeclarativeObject() override;
27 
28  /** Returns the Marble library version */
29  QString version() const;
30 
31 public 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 
50 private:
51  MarbleDeclarativeObjectPrivate* const d;
52 };
53 
54 #endif
QString version() const
Returns the Marble library version.
QString resolvePath(const QString &path) const
resolvePath Resolves files in the marble data path
Q_OBJECTQ_OBJECT
bool canExecute(const QString &program) const
canExecute Check whether a given program is found in the path
Q_PROPERTY(...)
Provides access to global Marble related properties and methods to QML (intended to be registered as ...
Q_SLOTSQ_SLOTS
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Nov 26 2021 23:23:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.