aboutsummaryrefslogtreecommitdiffstats
path: root/src/checks/level0/README-wrong-qevent-cast.md
diff options
context:
space:
mode:
Diffstat (limited to 'src/checks/level0/README-wrong-qevent-cast.md')
-rw-r--r--src/checks/level0/README-wrong-qevent-cast.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/checks/level0/README-wrong-qevent-cast.md b/src/checks/level0/README-wrong-qevent-cast.md
new file mode 100644
index 00000000..96244231
--- /dev/null
+++ b/src/checks/level0/README-wrong-qevent-cast.md
@@ -0,0 +1,11 @@
+# wrong-qevent-cast
+
+Warns when a QEvent is possibly cast to the wrong derived class via static_cast.
+
+Example:
+switch (ev->type()) {
+ case QEvent::MouseMove:
+ auto e = static_cast<QKeyEvent*>(ev);
+}
+
+Currently only casts inside switches are verified.