prepare code qml thread