Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
How to write a file in qt ?
The title is going to be (lineedit text + .txt)?
and the location is fix to (~/.myproject)
I am new to qt and c++ and i am coming from vb.net since vb.net doen't work with Linux then i am learning qt.
Posted

1 solution

Writing a file is already totally unrelated to any dialog, and unrelated to UI in general. If you had the impression that is it related in .NET, this is only because you have no clue about .NET as well, no matter how much of code you created.

Ideally, writing files should not be related to QT. Nevertheless, by some reasons (I don't think this is a place to discuss them), file support is included in QT. Please see:
http://doc.qt.digia.com/qt/qfile.html[^],
http://doc.qt.digia.com/qt/qiodevice.html[^],
http://doc.qt.digia.com/qt/qbuffer.html[^].

With C++, you can directly use C++ API via <cstdio> or <iostream>, but see also the comments in the QT reference page reference above, the first one.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900