Skip to content

Latest commit

 

History

History
9 lines (6 loc) · 528 Bytes

README-empty-qstringliteral.md

File metadata and controls

9 lines (6 loc) · 528 Bytes

empty-qstringliteral

Suggests to use an empty QString instead of an empty QStringLiteral. The later causes unneeded code bloat.

You should use QString() instead of QStringLiteral() and QStringLiteral("").

Note: Beware that QString().isNull() is true while both QStringLiteral().isEmpty() and QStringLiteral("").isNull() are false. So be sure not to introduce subtle bugs when doing such replacements. In most cases it's simply a matter of using isEmpty() instead, which is true for all cases above.