QFileDialog file selection dialog Description Provides a dialog that allows the user to select a file or directory Allows the user to traverse the file system to select one or more files or directories Inherited from: QDialog Functional role Static method (the easiest way to get it) Get file # Single file selection dialog # […]
Tag: qfile
qt QFile & QTextStream \QDataStream read and write file operations
1. QFile class QFile is a class in Qt for reading and writing files. It provides some basic file operation methods, such as open, close, read and write, etc. The following in-depth understanding of QFile: 1. The constructor of QFile The constructor of QFile has two parameters, one is the name of the file, and […]
[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 […]
Use QFile for file operations (QFile can use FILE * pointers, and must also specify AutoCloseHandle)
The QFile class provides common functions for manipulating files. It is an io device that can be used to read and write text files and binary files, and can also be used to read and write Qt resource files. The QFile class can be used alone. The class itself provides read/write functions, but it is […]
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 = […]