File indexing completed on 2024-05-05 05:41:40
0001 #include <QtCore/QSize> 0002 #include <QtGui/QColor> 0003 #include <QtGui/QTextTableCell> 0004 #include <QtXml/QDomNode> 0005 #include <QtGui/QTextCursor> 0006 0007 0008 0009 0010 0011 0012 0013 0014 0015 0016 struct Foo 0017 { 0018 int m; 0019 void setM(int v) { m = v; } 0020 int setX(int v) { return 0; } 0021 void setY() const {} 0022 static void setM_static(int) {} 0023 }; 0024 0025 0026 Foo getFoo() { return Foo(); } 0027 Foo& getFooRef() { static Foo f; return f; } 0028 Foo* getFooPtr() { return new Foo(); } 0029 0030 void test() 0031 { 0032 getFoo().setM(1); // Warning 0033 getFoo().setM_static(1); 0034 getFoo().setX(1); // OK 0035 getFoo().setY(); // OK 0036 getFooRef().setM(1); // OK 0037 getFooPtr()->setM(1); // OK 0038 0039 Foo f; 0040 f.setM(1); // OK 0041 } 0042 0043 0044 0045 QSize getSize() { return QSize(); } 0046 0047 void testKnownTypes() 0048 { 0049 getSize().transpose(); // Warning 0050 } 0051 0052 QDomNode getNode() { return {}; } 0053 0054 void testDisallowedType() // bug #354363 0055 { 0056 getNode().firstChild(); // OK 0057 QDomNode node; 0058 node.firstChild().setPrefix(""); // OK 0059 } 0060 0061 void testQColor() 0062 { 0063 QColor col; 0064 int *c, *m, *y, *k, *a; 0065 col.toCmyk().getCmyk(c, m, y, k, a); 0066 } 0067 0068 0069 void test363428() 0070 { 0071 QTextCursor cursor; 0072 QTextTable *currentTable; 0073 currentTable->cellAt(cursor).setFormat(QTextCharFormat()); 0074 } 0075 0076 bool returnsBool() { return true; } 0077 0078 void testTernary() 0079 { 0080 QStringList list; 0081 (returnsBool() ? list : list).append(""); // OK 0082 }