Warning, /sdk/clazy/tests/qcolor-from-literal/main.cpp.fixed.expected is written in an unsupported language. File is not indexed.
0001 #include <QtGui/QColor>
0002
0003 extern void takingColor(QColor);
0004
0005 void test()
0006 {
0007 QColor c1; // OK
0008 QColor c2(0x001020); // Warning
0009 QColor c3(QString("#001020")); // Warning. TODO
0010 QColor c4(QLatin1String("#001020")); // Warning. TODO
0011 QColor c5(0x002233); // Warning
0012 QColor c6(0x11, 0x22, 0x33, 0); // Warning
0013 QColor c7("#000111222"); // Warning
0014 QColor c8("#000011112222"); // Warning
0015 c4.setNamedColor("red"); // OK
0016 c4.setNamedColor("#001020"); // Warning
0017 c4.setNamedColor(QLatin1String("#001020")); // Warning
0018 takingColor(0x001122); // Warning
0019
0020 // Invalid patterns
0021 QColor invalidPattern1("#0000011112222"); // Warning, one digit too much
0022 QColor invalidPattern2("#G00011112222"); // Warning, not a proper hex code
0023 }