Qt 6.11 is out! See what's new in the release
blog
int to quint8
-
Hi,
How can I convert "int" to "quint8" and "quint8" to "int"?
-
int a = 5;
quint8 b = a;
a = b; -
modern C++ has this really annoying warning called "narrowing conversions". you have to limit the range of the input value using bitwise AND 0xff... of whatever size the target is, then do a static_cast<> to the target type.