The idiomatic way to create an empty QString is using its default constructor, i.e. QString()
. QString()
creates a string for which both isEmpty()
and isNull()
return true
.
A QString created using the literal ""
is empty (isEmpty()
returns true
) but not null (isNull()
returns false
).
Both have a size()
/length()
of 0.