Replies: 3 comments 10 replies
-
|
Beta Was this translation helpful? Give feedback.
-
We should also have a convention for naming custom slots. The ones added by Qt Designer all follow this scheme:
This is so that 'QMetaObject::connectSlotsByName' can connect the signals with their respective slots automatically. For custom slots, in order to avoid errors around "connect slots by name no matching signals found" etc., I would suggest naming custom slots similar to the convention above, but without the initial underscore, like so: For example: 'Qt' slots:
void on_pushButton_clicked();
void on_lineEdit_editingFinished();
'custom slots'
void onADataBase_updated();
void onCustomSlot_triggered(); |
Beta Was this translation helpful? Give feedback.
-
Suggestion for formatting text displayed to the user, for example in Message Boxes, labels etc: Qt supports different text formatting standards. Of those, I would prefer to use one that supports text formatting like this, so that would eliminate Long story short, prefer What's your take? |
Beta Was this translation helpful? Give feedback.
-
It is important to maintain a convention for directory, file, function and variable names. While Qt is solid, it is a general guideline which i propose we specialise.
PROPOSAL:
-
for word separator if necessary. Eg.directory-of-doom/
Q
toA
. Eg.ADataBase.h
A
in the beginning. Eg.class ADataBase
a
. Eg.aConquerTheWorld()
a
and snake_case to emphasise limited scope. Eg.void utility_function_one()
const auto IMPORTANT_CONSTANT = ASecretOfUniverse(42);
using NewType = QMap<QString, int>
[?]Assume that
A
comes from Aviation :DRATIONALE
Through this we can maintain a consistent aesthetic that is able to, at a glance, give context to the reader.
AFooBar
suggests an important custom class.FooBar
suggests alias of important type. [?]aFooBar()
suggests an important free functionfoo_bar()
suggests a static "utility" functionniceVariable
suggests an important variablenice_variable
suggests a "consumable", limited scope variable.Beta Was this translation helpful? Give feedback.
All reactions