@SGaist Your comment was very helpful. I checked the contents by printing them and saw that when I called the process, the file was still being written (since I write a JSON file from the GUI). So I added one more line QFile.close() and now the python script is called only after JSON gets written from the GUI. Now it is running fine.
@antemort First check if that QML contains no error. Secondly you need to findChild in the rootObject
QQuickItem *rootItem = view.rootObject(); //root item in QML
QQuickItem *child = parent->findChild<QQuickItem*>("childobjectname"); //find child of that root object using its objectName
child->setProperty("angle1", 160); //set property angle1 to 160