Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
5.12.0
-
None
-
All of them
Description
QNetworkConfiguration::StateFlag contains various status codes for network configuration.
The term "flag" suggests that every item's value is a different single bit within the integer value so that individual flags can be or'ed together and the presence of a flag can be checked by and'ing the appropriate flag and check whether the result is zero, e.g.
if (config_flag & QNetworkConfiguration::Active !=)
{ // Do something when config_flag contained Active }However, as the values contain multiple bits, for example Active is 0x000000e which is binary 1110, testing is true against binary 1000, 0100 and 0010.
Fixing this will break binary compatibility, however, it should be clearly stated in the documentation that the usual behavior of bitflags does not apply here, especially as it is also declared as QFlags which explicitely states the OR-combination of flags.