Тёмный

C++ Qt 12 - QFile 

VoidRealms
Подписаться 84 тыс.
Просмотров 139 тыс.
50% 1

QML Beginners: www.udemy.com/course/qml-for-...
Qt Core Beginners: www.udemy.com/course/qt-core-...
Qt Core Intermediate: www.udemy.com/course/qt-core-...
QT Core Advanced: www.udemy.com/course/qt-core-...
Qt Widgets Beginners: www.udemy.com/course/qt-widge...

Опубликовано:

 

5 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 53   
@pogggggggggg
@pogggggggggg 8 лет назад
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
@anupx73
@anupx73 7 лет назад
This guy really deserves a BIG thumps up for great tutorials. Thanks buddy for detailed and part by part tutorial.
@VoidRealms
@VoidRealms 13 лет назад
Errata (from offical Qt forums): 03:48 Since you’re teaching good practice, it is important to stress that. (Calling close() isn’t mandatory since the QFile object will be destroyed at the end of scope, closing it. The explicit call to close() becomes therefore a matter of “style”/“habit”). 04:38 The QTextStream is called “out” instead of “mOut”. Why not keeping your naming convention for variables? 04:44 Not a reference, but a pointer to
@VoidRealms
@VoidRealms 13 лет назад
QFile automatically flushes when it’s closed, and it automatically closes when it’s destroyed => you can remove the last two lines altogether and have a correct behaviour). Instead, you call mFile.close() without flushing the QTextStream, which is an error!
@DaveRogersEsq
@DaveRogersEsq 9 лет назад
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!
@VoidRealms
@VoidRealms 13 лет назад
Errata (from offical Qt forums): 03:10 WriteOnly and Text are actually defined in QIODevice; a better style is to prefix the enum with the scope of the class that declared them, rather than an arbitrary subclass. 03:36 Minor typo on “writting”
@drancisdrake
@drancisdrake 11 лет назад
Bryan, you are great! Thanks for the informative videos on Qt, I will see a whole lot of them. /Swedish-Norwegian
@wallyhighsmith9005
@wallyhighsmith9005 10 лет назад
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.
@afigegoznaet
@afigegoznaet 8 лет назад
The use of flush() is excessive there, close() performs flushing automatically. Great tutorial!
@PUPIMUMIP
@PUPIMUMIP 8 лет назад
thanks bro, best wishes!
@algnadjib
@algnadjib 12 лет назад
@VoidRealms thanks for posting the corrections
@antoinel6091
@antoinel6091 7 лет назад
Your tutorials are the best! Could you please comment how to write the console output? thanks
@VoidRealms
@VoidRealms 13 лет назад
Errata (from offical Qt forums): 06:00 Why QString and readAll()? For consistency, you wrote a char array, then you read back a char array, or create a QString in the write method and read back a QString.
@Qornv
@Qornv 9 лет назад
Hello you too my man brian
@VoidRealms
@VoidRealms 13 лет назад
Errata (from offical Qt forums): 05:05 This is an error: the explaination is correct, but you actually want to call “out.flush()”, not (only) “mFile.flush()” there, otherwise you’re not flushing the QTextStream’s internal buffer but QFile’s one. After out.flush() you can call mFile.flush(). Again, it should be stressed that you’re introducing flush() just for the sake of argument, because QTextStream automatically flushes when it’s destroyed (and
@BaldwinMediaVisualFX
@BaldwinMediaVisualFX 11 лет назад
Ctrl + c and Ctrl + v best short cuts ever
@kn0w0n3
@kn0w0n3 8 лет назад
Thank you
@vegas34162
@vegas34162 9 лет назад
what if you want to find a txt file versus creating it first?
@dan95boy
@dan95boy 12 лет назад
Does standar C++ methods work too in QT, like ofstream or ifstream..?
@andrejagrujic9810
@andrejagrujic9810 6 лет назад
is c++ way of doing this much faster or it is equal? I can't see diffrence.
@rcitaliano
@rcitaliano 7 лет назад
"...rather than blindly following tutorials that you find on internet..." oh wait. ahahahahaahah =) keep up man, really good videos!
@MostaphaQamar
@MostaphaQamar 2 года назад
How can I move an element to where the cursor is? For example: I want to move the combobox to the position of the cursor in the text box of the element.
@CarlosEstebanLopezJaramillo
@CarlosEstebanLopezJaramillo 11 лет назад
eeh having a little problem, maybe because i got the last qt version 5.0.2 and qDebug is used like this: qDebug( "Text"); but when i put qDebug( mText); that is a QString i got an error, how do i print with the new qDebug a variable?
@vinceherried497
@vinceherried497 6 лет назад
qDebug doesn't work on my system when after QCoreApplication. I tried various term settings in the options with no luck. Ended up using std::cout
@drakZes
@drakZes 6 лет назад
If I have QString string, how do I read the individual characters from the string one at a time using Qt c++?
@edulgl
@edulgl 5 лет назад
You can probably iterate using something like: QString myQString("Hello"); for (QChar myChar : myQString) { // process qchar here }". The documentation says "The QString::iterator typedef provides an STL-style const/non-const iterator for QString."
@wilsonsnead
@wilsonsnead 13 лет назад
Are you able to integrate QFile into a Gui project? Or does it only function correctly in console applications?
@achauhan008
@achauhan008 10 лет назад
function names starting with uppercase letters! is this wrong or a standard in qt?
@sqlpython2524
@sqlpython2524 11 лет назад
Using Linux For some reason that I can not see the If statement does not work properly overriding the Writing and Reading of the Created Text file. When I simply use mFile.open(QFile::ReadOnly | QFile::Text); ...and mFile.open(QFile::WriteOnly | QFile::Text); all works fine BUT using the if(!mFile.open(QFile::WriteOnly | QFile::Text)); { qDebug()
@rodrigovarela550
@rodrigovarela550 8 лет назад
How can I read a variable instead of a String?
@valdemardomingos1275
@valdemardomingos1275 10 лет назад
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
@valdemardomingos1275
@valdemardomingos1275 10 лет назад
already solved, a typo error from me... I wrote QDebug()
@azurewang
@azurewang 11 лет назад
Why do you use pointer to create new widgets, but not for something like QTextStream?
@cezudas
@cezudas 12 лет назад
hey Brian.. I have a question... How can I print a QString to the screen using qDebug() without those quotes(at the beggining and at the end). For the example if I write QString text = "C'mon"; qDebug()
@ezio8000
@ezio8000 8 лет назад
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.
@ezio8000
@ezio8000 8 лет назад
I found it. There is another mode. If the line is changed to if(!mFile.open(QFile::Append | QFile::Text)), the words are appended. It looks like this: "Hello worldHello world"
@jloibman
@jloibman 11 лет назад
Bryan, how can I jump a line into the file? I want to write something, and then other something on the other line.. " " doesn't work.. And how can I write the actual time before writting something, so I know when that I wrote that.. Can you help me?
@karanvirk5899
@karanvirk5899 9 лет назад
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 :( (
@619FanHarut
@619FanHarut 8 лет назад
what does the qDebug function do?? is it the same as cout in c++??
@DiegoTenorioSolis
@DiegoTenorioSolis 8 лет назад
+619FanHarut Yes it's the same
@619FanHarut
@619FanHarut 8 лет назад
Then what is out
@guang_chen
@guang_chen 8 лет назад
+619FanHarut Put the string into the buffer of a QFile instance.
@619FanHarut
@619FanHarut 8 лет назад
Chen Guang so its the same as cout
@oscarsalgado189
@oscarsalgado189 11 лет назад
whats the difference between: QFile::WriteOnly | QFile::Text and to only write: QFile::WriteOnly because i´ve done each and the result is the same
@aytekincem94
@aytekincem94 9 лет назад
For the newest version of QT ; Qfile file; file.open(QIO::Device::ReadOnly) or file.open(QIO::Device::WriteOnly) was succesful.
@CarlosEstebanLopezJaramillo
@CarlosEstebanLopezJaramillo 11 лет назад
Sorry i find the solution, i included this: include "QtDebug" that let me use the sinthaxis: qDebug()
@rks515skr
@rks515skr 7 лет назад
It seems better for console application to just... return 0; //a.exec(); else I get exit code -1073741510.
@JasonMalan
@JasonMalan 10 лет назад
My biggest question is why is a bitwise or ( | ) applied between QFile::WriteOnly and QFile::Text.
@aaronmichael4152
@aaronmichael4152 10 лет назад
I think that's a traditional way of compounding optional flags. And'ing them would nullify both of them. But if you OR them, then the final bit string will have both flags set to 1.
@algnadjib
@algnadjib 12 лет назад
@VoidRealms thanks for posting the corrections
Далее
C++ Qt 13 - Resource Files
4:18
Просмотров 142 тыс.
Makefiles: 95% of what you need to know
1:01:53
Просмотров 118 тыс.
Это реально работает?!
00:33
Просмотров 2,5 млн
Китайка Шрек поймал Зайца😂😆
00:20
C++ Qt- 23 QActions
6:25
Просмотров 106 тыс.
BEST WAY to make Desktop Applications in C++
26:00
Просмотров 900 тыс.
Linus Torvalds On Future Of Desktop Linux
44:18
Просмотров 359 тыс.
CONST in C++
12:54
Просмотров 399 тыс.
QML Qt 146 - Dialogs and Text Fields
13:54
Просмотров 19 тыс.
C++ vs Rust: which is faster?
21:15
Просмотров 386 тыс.
How to Do 90% of What Plugins Do (With Just Vim)
1:14:03
Просмотров 883 тыс.
Это реально работает?!
00:33
Просмотров 2,5 млн