aboutsummaryrefslogtreecommitdiffstats
path: root/docs/checks/README-wrong-qevent-cast.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/checks/README-wrong-qevent-cast.md')
-rw-r--r--docs/checks/README-wrong-qevent-cast.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/checks/README-wrong-qevent-cast.md b/docs/checks/README-wrong-qevent-cast.md
new file mode 100644
index 00000000..96244231
--- /dev/null
+++ b/docs/checks/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.