Unsolved C++ namespace with consts in QML
-
Hello,
I was wondering if it is possible to have C++ namespace with constants and somehow use those constants in the QML.
Here is my namespace:
namespace ProjectNameSpace { extern const int PROJECT_BUILD; extern const QString PROJECT_NAME; }
Is it possible to use PROJECT_BUILD and PROJECT_NAME in the QML file?
With best wishes,
poor_robert -
Hi,
Do you really need a namespace ?
Otherwise you could make a QObject with e.g. read-only properties returning the values you want.