Replies: 3 comments 10 replies
|
|
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(); |
|
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? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
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/QtoA. Eg.ADataBase.hAin the beginning. Eg.class ADataBasea. Eg.aConquerTheWorld()aand snake_case to emphasise limited scope. Eg.void utility_function_one()const auto IMPORTANT_CONSTANT = ASecretOfUniverse(42);using NewType = QMap<QString, int>[?]Assume that
Acomes from Aviation :DRATIONALE
Through this we can maintain a consistent aesthetic that is able to, at a glance, give context to the reader.
AFooBarsuggests an important custom class.FooBarsuggests alias of important type. [?]aFooBar()suggests an important free functionfoo_bar()suggests a static "utility" functionniceVariablesuggests an important variablenice_variablesuggests a "consumable", limited scope variable.All reactions