File tree Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Expand file tree Collapse file tree 3 files changed +47
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ qt_add_executable(${APP_TARGET}
66 app.h
77 appmenubar.cpp
88 appmenubar.h
9+ libraryinfo.cpp
10+ libraryinfo.h
911)
1012
1113qt_add_qml_module(${APP_TARGET}
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: GPL-3.0-or-later
2+
3+ #include < scratchcpp/scratchconfiguration.h>
4+ #include < scratchcpp-render/scratchcpp-render.h>
5+
6+ #include " libraryinfo.h"
7+
8+ using namespace scratchcpp ;
9+
10+ LibraryInfo::LibraryInfo (QObject *parent) :
11+ QObject(parent)
12+ {
13+ }
14+
15+ QString LibraryInfo::libscratchcppVersion () const
16+ {
17+ return QString::fromStdString (libscratchcpp::ScratchConfiguration::version ());
18+ }
19+
20+ QString LibraryInfo::scratchcppRenderVersion () const
21+ {
22+ return QString::fromStdString (scratchcpprender::version ());
23+ }
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: GPL-3.0-or-later
2+
3+ #pragma once
4+
5+ #include < QQmlEngine>
6+
7+ namespace scratchcpp
8+ {
9+
10+ class LibraryInfo : public QObject
11+ {
12+ Q_OBJECT
13+ QML_ELEMENT
14+ QML_SINGLETON
15+ public:
16+ explicit LibraryInfo (QObject *parent = nullptr );
17+
18+ Q_INVOKABLE QString libscratchcppVersion () const ;
19+ Q_INVOKABLE QString scratchcppRenderVersion () const ;
20+ };
21+
22+ } // namespace scratchcpp
You can’t perform that action at this time.
0 commit comments