From be37bed7bda0c3779a2019dda6e89439b6a1345f Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 27 Apr 2026 12:13:16 +0700 Subject: [PATCH] [ai] Add rule about u""_q literal. --- AGENTS.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index ec1650302b..78db1ff125 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -156,6 +156,18 @@ QString currentTitle = tr::lng_settings_title(tr::now); rpl::producer nameProducer = GetNameProducer(); ``` +**Use `_q` for QString literals:** + +Prefer the project literal `u"..."_q` instead of the verbose `QStringLiteral("...")` macro when creating `QString` values: + +```cpp +// Prefer this: +auto text = u"Settings"_q; + +// Instead of this: +auto text = QStringLiteral("Settings"); +``` + ## API Usage ### API Schema Files