#include #include #include QList getList() {return {};} void test() { QList list; if (!list.isEmpty()) {} // Warning if (list.isEmpty()) {} // Warning bool b1 = !list.isEmpty(); // Warning bool b2 = !list.isEmpty(); // Warning if (list.indexOf(1)) {} // OK QMap map; if (!map.isEmpty()) {} // Warning if (map.contains(2)) {} // Warning QMultiMap multiMap; if (!multiMap.isEmpty()) {} // Warning if (multiMap.contains(2)) {} // Warning if (multiMap.contains(2)) {} // Warning if (!getList().isEmpty()) {} // Warning } void testExplicitConversion() { if (getList().isEmpty()) {} // Warning if (getList().isEmpty()) {} // Warning if (!getList().isEmpty()) {} // Warning const bool myCheck = !getList().isEmpty(); }