C++ Qt 12 - QFile

How to work with the QT QFile class to write and read files

Video tags:


Comments

Your tutorials are the best! Could you please comment how to write the console output? thanks
It seems better for console application to just... return 0; //a.exec(); else I get exit code-1073741510.
The mode flags for the open() method now seem to be defined in QIODevice userspace, so instead of QFile::ReadOnly, it needs to be QIODevice::ReadOnly and so on. At least this is my experience in version 5.8.
"...rather than blindly following tutorials that you find on internet..." oh wait. ahahahahaahah =) keep up man, really good videos!
This guy really deserves a BIG thumps up for great tutorials. Thanks buddy for detailed and part by part tutorial.
The use of flush() is excessive there, close() performs flushing automatically. Great tutorial!
Thank you
Why does "Hello world" appear in the file mFilename only once when you re-run the program a second time. Is there a way to specify WriteOnlyAppend vs. WriteOnlyReplace [my nomenclature] when writing? I couldn't find anything in the help resource.
Not only is this educational and entertaining, but this this is in the best format for me! Small screen so I don't have to be in 1080p full screen to read the text and I can have QT open next to it, short videos so I don't lose the will to live, and finally you have a really nice voice XD its not normal us people from Britain enjoy an America accent XD
How can I read a variable instead of a String?
Hello you too my man brian
I stopped going to google to find something I need to know about.  I just go to youtube and look for one of your videos.
My biggest question is why is a bitwise or ( | ) applied between QFile::WriteOnly and QFile::Text. 
Thanks bro, best wishes!
I got this error following your tutorial... any idea? I'm using Qt 5.2.1. error: C2512: 'QDebug::QDebug' : no appropriate default constructor available
For the newest version of QT ; Qfile file;file.open(QIO::Device::ReadOnly) or file.open(QIO::Device::WriteOnly) was succesful.
What does the qDebugfunction do?? is it the same as cout in c++??
Function names starting with uppercase letters! is this wrong or a standard in qt?
These tutes are great. I'm a C# guy delving into the world of C++. I'm finding your explanations really helpful. It's really interesting seeing the difference in environments of the two languages/runtimes. Thanks!
Your tutorials have been saving my butt more than once, or to be more specific saving lots and lots of time I'd spend getting through countless chapters of documentation... I.e. in this case I basically forgot how to read a line from file and you do that indirectly by using QTextStream which works great! QFile on its own can only return int64 which is... well... unuseful
Could not open file ? why? I set the path of file in D:\test.txt But I cant open the file. My function is:void Write(QString pathFilesName) {     QFile files(pathFilesName);     if(!files.open(QFile::WriteOnly|QFile::Text))     {         qDebug()<<"Could not open this file!";         return;     }     QTextStream stream(&files);     stream << "Hello World";     stream.flush();     files.close(); }
Hi . Can you please show how to use AutoCloseHandler. I am trying to modify a file outside the program and read the contents but my program is reading the old contents :( (

C++ Qt 13 - Resource Files

How to create and read from qt resource files that are compiled in your application


Qt Tutorials For Beginners 22 - QFile

Qfile class qt5 tutorial qfile qt4 - do i really need to call qfile::close() in this case? c++ - qfile won't open the file searches related to qfile qdir qfile


C++ Qt 11 - QDir

How to work with the qt qdir class to list directories, drives, and files


Tutorial Qt Creator - QFile

Ofrezco mis servicios como desarrollador de software. hago software a la necesidad del cliente. contacto: [email protected]


C++ Tutorial - Reading From a CSV File -fstream

This video shows how to read csv file in c++ github : source_code: linkedin: web:


04 - Pointers and Dynamic Variables in Qt

04 - pointers and dynamic variables in qt


Receive and store data lineEdit value to variable QT and save it in text file part2

Receive and store data lineedit value to variable qt and save it in text file part2


QT C++ GUI Tutorial 24- How to use QFileDialog

How to use qdir and qfiledialog in qt can the open file dialog be used to select a folder c++ - in the qt how to open qfiledialog::getopenfilenames qt toolkit


C++ Qt 15 - QPushButton

Learn how to use the qpushbutton widget


QT C++ GUI Tutorial 27- How to read text file and display file to a textbrowser or textEdit

How to display text from a file to a text browser reading and writing text | c++ gui programming with qt4 qtcreator gui open text file parsing - load text fil


C++ Qt 21 - QTreeWidget

Part 1 of 2 - learn how ot use the qtreewidget


Qt Tutorials For Beginners 24 - QTimer

C++ , qt - qtimer examples qt - how to use qtimer qtimer(3): timer signals/single-shot timers qtimer class reference searches related to qtimer example qtimer


C++ Qt 90 - QTextStream

Learn how to use this class to easily read and write text files


C++ Qt 10 - Splitters

Learn how to use splitters in qt creator



C++ Qt 12 - QFile