QString string operations

Foreword I don’t have much to say in Frontier. This article is just the notes I recorded after watching the QT6 Development Guide and watching the video of Dabing Qt, the master of up station b who loves programming. 1.1QString string operation 1.1.1QString Introduction QString is used to store strings and has no parent class. […]

cstring string CString QString char*

The connection and difference between cstring string CString QString char*cstring and string.h header files are equivalent, cstring is the c++ version Header file, string.h is the c version of the header file, which can be understood as the same thing, oriented to char* The string header file defines a class in the c++ standard library, […]

Conversion between strings (char*, const char*, char[], string, QString, QByteArray, int, double)

Table of Contents 1. Several methods to apply for space: 1. C language 2.C++ 2. Conversion of each string 1. char* and unsigned char*, char* and const char*, char* and char[ ] 2. string and char*, string and unsigned char*, string and QString, string and int, double 3. QString and int, double, QString and char* […]

QFileSystemModel class and QStringListModel class

Introduction to QFileSystemModel QFileSystemModel is a model class in the Qt framework used to represent the directory structure of the local file system in Qt applications. It provides a convenient way to access and manipulate files and directories in the file system. The following is a detailed introduction to QFileSystemModel: Representation of directory structure: QFileSystemModel […]

QString, QBitArray

QString 1. Initialize QString 1. The most commonly used initialization: QString str = “Hello”; This is actually a C-style string using QString::fromUtf8(): const char * p = “hello”; Convert to QString. p can be empty, the following writing is legal: #define debug qDebug()<< int main(int argc, char *argv[]) { QString s = nullptr; debug s.isEmpty();//true […]

String class QString

String class QString Constructor data manipulation String search and judgment traverse view byte count type conversion string format Qt not only supports string types in C and C++, but also defines exclusive string types in the framework. C char* C++ std::string, char* Qt QByteArray, QString QByteArray Many functions of QString and QByteArray are similar. . […]

String split QString

QString::section section is used to obtain the split string, and there are multiple overloaded versions. QString section(QChar sep, int start, int end = -1, SectionFlags flags = SectionDefault) const; Parameter 1 is the delimiter, which starts from parameter 2 to the end of parameter 3. If parameter 3 is not specified, it will be taken […]

Three methods of Qt QString string segmentation and interception (*****)

Table of contents Summary of string interception methods (****) The use of QString class in QT–get the specified character position, intercept substring, etc. (****) QT — Get the folder location and create a new folder (****) Three methods of Qt QString string segmentation and interception Two methods of qt splitting strings (*) ————————————————– – Key […]

[Qt] QString, QByteArray, char* are converted to each other.

This article mainly explains the mutual conversion between QString, QByteArray, and char*. There may be many ways, and the methods in this article are only part of them. Because sometimes it is necessary to display hexadecimal data in the control, it involves the conversion between hexadecimal data and strings, so the string containing hexadecimal format […]

The method of converting between QString and QByteArray

The method of converting between QString and QByteArray [1] The method of converting between QString and QByteArray QString to QByteArray method QByteArray to QString method The QByteArray class also does not end with ‘\0’ QByteArray to QString, mainly use buf.toHex() [2] Data conversion problem in Qt development serial communication software 1. Read serial port commands […]