Topic: Codestyle Qet
Martin(e-mail) showed that there is a need for Code Style for Qet, which is there but hard to find.
He suggested the tool clang format.
https://doc.qt.io/qtcreator/creator-indenting-code.html
This topic will mainly be about installing clang in QT and usage.
Where that I further explain the usefulness of clang.
or watch this video:
https://www.youtube.com/watch?v=Cz36YveDI2E
I will complete this post later.
Edit:
- add clang file
- add code
- QString txt=QTime::currentTime().toString("hh:mm:ss.zzz");
- QByteArray dbs =txt.toLocal8Bit();
- QByteArray localMsg = msg.toLocal8Bit();
- const char *file = context.file ? context.file : "";
- const char *function = context.function ? context.function : "";
to
+ QString txt = QTime::currentTime().toString("hh:mm:ss.zzz");
+ QByteArray dbs = txt.toLocal8Bit();
+ QByteArray localMsg = msg.toLocal8Bit();
+ const char* file = context.file ? context.file : "";
+ const char* function = context.function ? context.function : "";
- Qt Creator enable the plugin:
To enable the plugin, select Help > About Plugins > C++ > ClangFormat. Then select "Restart Now" to restart Qt Creator and load the plugin.
- update clang file
mod
IndentWidth 8->4
TabWidth 8-> 4
BreakConstructorInitializers BCIS_BeforeColon->BCIS_AfterColon
BreakInheritanceList BCIS_BeforeColon->BCIS_AfterColon
still to be tested
-add clang file in to git repo
https://git.tuxfamily.org/qet/qet.git/c … 351c3e737b