by W0lf · 6y ago · 0 comments
- naming things (e.g. should signals/slots be prefixed (sigFoo() -> onFooBared())
- how to deal with signal functions actually not implemented (clang-tidy warnings)
- how to break up large main window classes in a reasonable manner
and so on. Typically I immerse myself in one of the larger code bases I'm aware of (Android, Firefox, Chromium, Tensorflow, and some others) and regularly discover pretty useful patterns I can make use of. However, I was unlucky to find something for Qt based.There's an irony somewhere in there that Chromium is a descendant of KHTML, KDE's rendering engine, which became WebKit and was originally written using Qt. And Google and Apple's contributions were regularly derided for being relatively low quality.
Qt and KDE have always had a lot of cross-contribution, so KDE (its libraries, for example) is a good place to start:
https://github.com/KDE/kdelibs
There's also this old, but still relevant, article on designing Qt-style APIs (which had a big impact on me personally):
connect(contextShortcut, SIGNAL(activated()), this, SLOT(showContextDock()));
connect(m_messageView->selectionModel(),
SIGNAL(currentColumnChanged(QModelIndex,QModelIndex)),
SLOT(updateLatestModel(QModelIndex)));
Taken from https://github.com/qt/qttools/blob/7ec161d6f/src/linguist/li...https://github.com/qbittorrent/qBittorrent
not able to comment on code quality.