aboutsummaryrefslogtreecommitdiffstats
path: root/tests/connect-3arg-lambda/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/connect-3arg-lambda/main.cpp')
-rw-r--r--tests/connect-3arg-lambda/main.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/tests/connect-3arg-lambda/main.cpp b/tests/connect-3arg-lambda/main.cpp
index a9698bbb..ef36d9d3 100644
--- a/tests/connect-3arg-lambda/main.cpp
+++ b/tests/connect-3arg-lambda/main.cpp
@@ -1,6 +1,6 @@
#include <QtCore/QString>
-#include <QtCore/QObject>
-
+#include <QtWidgets/QMenu>
+#include <QtCore/QTimer>
void another_global();
void test()
{
@@ -74,3 +74,22 @@ public:
QObject *m_member;
QObject *m_member2;
};
+
+void testTimer()
+{
+ QObject *o;
+ QTimer::singleShot(0, [] {}); // Warn
+ QTimer::singleShot(0, o, [] {}); // OK
+
+ QTimer::singleShot(0, Qt::CoarseTimer, [] {}); // Warn
+ QTimer::singleShot(0, Qt::CoarseTimer, o, [] {}); // OK
+}
+
+void testQMenu()
+{
+ MyObject o;
+ QMenu menu;
+ menu.addAction("foo", &o, &MyObject::test); // OK
+ menu.addAction("foo", &o, []{}); // OK
+ menu.addAction("foo", []{}); // Warn
+}