Representing data using Qt's core classes
Probably the most common Qt core class you'll run into is QString
, Qt's container class for character strings. It has similar capabilities to the C++ STL class, std::wstring
. Like wstring
, it's multibyte. You can construct one from a traditional C-style char *
string or another QString
.
QString
has lots of helper methods, some of which are as follows:
append
: This appends oneQString
class onto anotherarg
: This is used to build up formatted strings (instead ofsprintf
)at
andoperator[]
: These you can use to access a single character in theQString
operator==
,operator!=
,operator<
,operator>
,operator<=
, andoperator>=
: These compare twoQStrings
clear
: This empties aQString
and sets it to the null stringcontains
: This searches one string for another string or a regular expressioncount
: This counts the occurrences of a substring or character in aQString
startsWith
andendsWith
: These return true if aQString
starts...