I was able to resolve
//main.cpp
I did using this lines in main.cpp
QQmlComponent component(&engine, QUrl(QStringLiteral("qrc:/pathToThatQmlFile.qml")));
QObject *object = component.create();
C++ClassName::getInstance()->setObject(object);
//C++
As this qml file is singleton, in C++ class where constants need to be called,
In constructor add:
qmlRegisterSingletonType(QUrl(QStringLiteral("qrc:/pathToQmlFile.qml")), "com.Test.TestConstants", 1, 0, "TestConstants");
void C++ClassName::setObject(QObject *newObject)
{
item = qobject_cast<QQuickItem *>(newObject);
qDebug() << item->property("phi").toDouble);
}
//QML
pragma Singleton
import QtQuick 2.14
Item
{
readonly property double phi: "3.142"
}