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

Winapi c++: DialogBox hangs when breaking a loop -

vb.net - Font adding using PDFsharp -

javascript - jQuery iScroll clickable list elements while retaining scroll? -