Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.0
-
None
-
-
5
-
93c5fedba1618bad1e6e3aaeff279a51c75f5e81 (qt/qtserialbus/dev)
-
Qt6_Foundation_Sprint 30, Qt6_Foundation_Sprint 31
Description
`valueCount()` returns an unsigned value - fair enough the number of values can never be negative.
However, all the other accessor functions take `index` as an int - signed by default.
This means there will always have to be a messy static_cast somewhere when looping through the values. Even the example code for `readReady()` is not warning free...
Some consistency would be great please, all signed, or all unsigned, and warning free compiles.
TODO:
- change value()/setValue() to use qsizetype
- change valueCount()/setValueCount() to use qsizetype
- adapt example code and documention to use qsizetype
Attachments
Issue Links
- is duplicated by
-
QTBUG-81702 QModbusDataUnit has inconsistent types for valueCount() and value()
- Closed
- relates to
-
QTBUG-64145 Qt SerialBus Changes in Qt 6
- Closed