converted to qml in cpp.