File indexing completed on 2024-04-28 05:38:41

0001 #include <QtGui/QColor>
0002 
0003 extern void takingColor(QColor);
0004 
0005 void test()
0006 {
0007     QColor c1; // OK
0008     QColor c2("#001020"); // Warning
0009     QColor c3(QString("#001020")); // Warning. TODO
0010     QColor c4(QLatin1String("#001020")); // Warning. TODO
0011     QColor c5("#023"); // Warning
0012     QColor c6("#00112233"); // 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("#001122"); // 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 }