File indexing completed on 2024-10-06 03:30:32
0001 /* 0002 SPDX-FileCopyrightText: 2016 Artem Fedoskin <afedoskin3@gmail.com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 #ifndef SKYOBJECTLITE_H_ 0006 #define SKYOBJECTLITE_H_ 0007 0008 #include "skyobject.h" 0009 #include "skypointlite.h" 0010 #include <QObject> 0011 0012 /** 0013 * @class SkyObjectLite 0014 * Wrapper for SkyObject to allow access of some of its properties from QML 0015 * 0016 * @author Artem Fedoskin 0017 * @version 1.0 0018 */ 0019 0020 class SkyObjectLite : public SkyPointLite 0021 { 0022 Q_OBJECT 0023 Q_PROPERTY(QString translatedName READ getTranslatedName NOTIFY translatedNameChanged) 0024 public: 0025 /** Constructor **/ 0026 SkyObjectLite(); 0027 0028 /** @short sets SkyObject that is needed to be wrapped **/ 0029 void setObject(SkyObject *object); 0030 0031 /** @return translated name of currently wrapped SkyObject **/ 0032 Q_INVOKABLE QString getTranslatedName(); 0033 0034 /** @return SkyObject that is being wrapped **/ 0035 SkyObject *getObject() const { return object; } 0036 signals: 0037 void translatedNameChanged(QString translatedName); 0038 0039 private: 0040 SkyObject *object; 0041 }; 0042 #endif