Creating a .txt file based on the user interaction

Hello,
I'm right in the middle of designing a UI with Qt Quick for a Touch Screen. In the end, I want a UI that creates a .txt file which is then red by another programm. I still have no idea how to achieve this and I am starting to wonder it Qt Widget would have been a better choice? Of course I would be glad if I don't have to start over so I would prefer to keep my Qt Quick project.
Does anybody have an idea how to achieve this?

For anybody interessted as to what exactly I want to achieve:
I'm designing a GUI for a 3D Printer I build. I the user to be able to chose between different model that he wants to print. Qt reads and edits the .txt file and feds it to another programm (Pronterface) which will generate the movement based on the code. Somehow I have to creates the .txt file and find out how to trasnfer it to pronterface as well as to start the print in the other software (Pronterface is based on python)

Can you explain how that would work? I sthere an example soemwhere? I'm sorry but I'm totally new to Qt. I also thought about using the shared memory class to transfer the data. Do you think I should switch to Qt Widget?

as shown in the documentation. Then all your QML code recogizes the object with name 'msg' and you can use it in QML as a normal object, namely the aforementioned properties, slots, signals and invokables. Maybe it's possible even to create and use QFile and QProcess objects directly without wrapper classes.

At first it requires a bit more work than using plain QML, but in the end you get better architecture with "business logic" and low level stuff in C++ backend and UI in QML frontend.