Warning, file /sdk/clazy/tests/qt4-qstring-from-array/main.cpp was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 #include <QtCore/QString> 0002 #include <QtCore/QByteArray> 0003 0004 0005 0006 0007 QByteArray returns_byte_array() { return {}; } 0008 void receivesQString(const QString &) {} 0009 0010 0011 0012 0013 0014 0015 0016 void test() 0017 { 0018 QByteArray bytearray; 0019 QString s1("test"); 0020 QString s2(bytearray); 0021 QString s3(bytearray + bytearray); 0022 QString s4 = QString("test"); 0023 QString s5 = QString(bytearray); 0024 QString s6 = QString(bytearray + bytearray); 0025 QString s7 = QString(); // OK 0026 QString s8 = QString(QString()); // OK 0027 s1 = "test"; 0028 s1 = "test" 0029 "bar"; 0030 s1 = bytearray; 0031 0032 if (s1 == "test") {} 0033 if (s1 == bytearray) {} 0034 if (s1 == bytearray + "test") {} 0035 0036 s1 = bytearray + bytearray; 0037 s1 += bytearray; 0038 s1 += bytearray + bytearray; 0039 s1.append("foo"); 0040 s1.prepend(bytearray); 0041 s1 = true ? "foo" : "bar"; 0042 0043 QString s9(returns_byte_array() + bytearray); 0044 s1.append(returns_byte_array()); 0045 0046 receivesQString("test"); 0047 }