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
Q_OBJECTQ_OBJECT
Q_PROPERTY(...)
Q_SLOTSQ_SLOTS
QString resolvePath(const QString &path) const
resolvePath Resolves files in the marble data path
bool canExecute(const QString &program) const
canExecute Check whether a given program is found in the path
Provides access to global Marble related properties and methods to QML (intended to be registered as ...
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 04:09:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.