[QT] How to detect that the content in a directory or file has been modified, you can use the QFileSystemWatcher class to detect

Table of Contents 1. Introduction to the QFileSystemWatcher class 2. Public functions of QFileSystemWatcher 2.1 Constructor 2.2 Destructor 2.3 Add monitoring path 2.4 Return the directory or file being monitored 2.5 Remove the specified path from the file system watchdog 3. The signal of QFileSystemWatcher 4. Test code 4.1 Operation steps 4.2 MainWindow.h 4.3 MainWindow.cpp […]

QT-based file read and write operations–QFile, QTextStream, QFileDialog, etc.

Directory introduction 1. File read operation (1) Use the QFile class (2) Use the QTextStream class Second, read file information – QFileDialog Three, QT configuration ini file establishment, read, write operation 1 ini file introduction 2 ini file format 3 Qt write ini file 4 Qt read ini file Introduction File reading and writing is […]

Use of QFileDialog, QFontDialog and QColofDialog in Qt5.12 combat

Reference to the file: #include instantiated object: QFileDialog filedlg(nullptr,//parent window “open image file”, //title “C:”,//default directory “ImageFile(*.jpg *.png)”);//File type filtering //show if(filedlg.exec()==QDialog::Accepted){ } display effect File dialog example source code: QFileDialog fileDlg(this, “FileDialog”, “c://”, “All File(*.*);;” “Video File(*.mp4 *.avi *.mkv *.flv);;” “Doc File(*.pdf *.doc *.docx *.xls *.xlsx)”); fileDlg.setWindowTitle(QString::fromLocal8Bit(“Please select a file”)); fileDlg.exec(); QStringList selectFiles = […]