Details
-
Task
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
QTBUG-133234 talks about fixing build issues when QT_NO_CAST_FROM_BYTEARRAY is defined. A lot of places in qtdeclarative rely on the QByteArray -> `const char *` implicit conversion when calling QMetaObject's functions, indexOfProperty() and co.
The build can be fixed by appending `.constData()` in those method calls, but that is a lot of churn. It would be simpler to add overloads to QMetaObect that take a view, then the build issues will disappear.
There was a previous trial, see the chain starting with https://codereview.qt-project.org/c/qt/qtbase/+/514588, to add such overloads, but it got stuck on deciding which view type to use:
- QByteArrayView: best candidate
- QUtf8StringView: missing some API, e.g. indexOf(), so can be in the public API, but internally it'll have to be QBAV
- QAnyStringView: can accept various types of strings, UTF16/8, but some developers thought it's overkill for QMetaObject, where the method names are typically ASCII and rarely Utf8
Attachments
Issue Links
- is required for
-
QTBUG-133234 Fix build issues with QT_NO_CAST_FROM_BYTEARRAY
-
- Reported
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-133235 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
637937,2 | QMetaObject: add QByteArrayView overloads [4/4] | dev | qt/qtbase | Status: NEW | -1 | 0 |