C++ Qt return empty QString -


i made function returns qstring. @ points in function should return empty qstring.

just returning "" doesn't work. when use qstring::isempty() it's not. "emergency plan" return "empty" string , check whether text "empty". don't think that's style.

so how return empty qstring?

the idiomatic way create empty qstring using default constructor, i.e. qstring(). qstring() creates string both isempty() , isnull() return true.

a qstring created using literal "" empty (isempty() returns true) not null (isnull() returns false).

both have size()/length() of 0.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -