ucam-department-of-psychiatry / camcops

Cambridge Cognitive and Psychiatric Test Kit (CamCOPS)
Other
12 stars 8 forks source link

CHI-T task update #276

Closed martinburchell closed 1 year ago

martinburchell commented 1 year ago

I've updated CHI-T to add the extra response and remove Q16. Closes #269

RudolfCardinal commented 1 year ago

Thanks; looks great.

Thinking about potential version incompatibility:

I also looked at trying to fix the clazy linter comments, e.g. about string literals, but some of the suggested performance fixes for Qt5 then instantly fall foul of warnings for Qt6. For example:

const QString spacer = " ";  // bad: QString(const char*) being called [clazy-qstring-allocations]
const QString spacer = QStringLiteral(" ");  // good

as per https://doc.qt.io/qt-5/qstring.html#more-efficient-string-construction and https://github.com/KDE/clazy/blob/master/docs/checks/README-qstring-allocations.md, but

const QString suffix = "";  // bad: QString(const char*) being called [clazy-qstring-allocations]
const QString suffix = QStringLiteral("");  // bad: Use an empty QLatin1String instead of an empty QStringLiteral [clazy-empty-qstringliteral]
const QString suffix = QLatin1String("");  // bad: QLatin1Char or QLatin1String is being called [clazy-qt6-qlating1stringchar-to-u]

so presumably the best thing is to move directly to Qt6, e.g. this sort of framework: https://doc.qt.io/qt-6/qt-literals-stringliterals.html ?

martinburchell commented 1 year ago

Your changes for version compatibility seem entirely reasonable to me.

so presumably the best thing is to move directly to Qt6, e.g. this sort of framework: https://doc.qt.io/qt-6/qt-literals-stringliterals.html ?

That appears to be new in Qt6.4 which isn't LTS. I'm currently targeting 6.2, which is LTS.