aboutsummaryrefslogtreecommitdiffstats
path: root/docs/checks/README-qcolor-from-literal.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/checks/README-qcolor-from-literal.md')
-rw-r--r--docs/checks/README-qcolor-from-literal.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/checks/README-qcolor-from-literal.md b/docs/checks/README-qcolor-from-literal.md
new file mode 100644
index 00000000..cd2d28fe
--- /dev/null
+++ b/docs/checks/README-qcolor-from-literal.md
@@ -0,0 +1,10 @@
+# qcolor-from-literal
+
+Warns when a `QColor` is being constructed from a string literal such as "#RRGGBB".
+This is less performant than calling the ctor that takes `int`s, since it creates temporary `QString`s.
+
+Example:
+
+`QColor c("#000000");` // Use QColor c(0, 0, 0) instead
+
+`c.setNamedColor("#001122");` // Use c = QColor(0, 0x11, 0x22) instead