QLocationPermission: make enums have explicit underlying type

They can be smaller than an int, so use quint8. In a world of BC
guarantees, pinning the underlying type of enums is best practice.

Found during API review.

Pick-to: 6.5
Change-Id: I0c31fe4565329982c81173e3a265f73758aad257
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Marc Mutz 2023-01-10 13:23:12 +01:00
parent 595360506d
commit 3b0439379f

View File

@ -93,13 +93,19 @@ class QLocationPermission
{
QT_PERMISSION(QLocationPermission)
public:
enum Accuracy { Approximate, Precise };
enum Accuracy : quint8 {
Approximate,
Precise,
};
Q_ENUM(Accuracy)
Q_CORE_EXPORT void setAccuracy(Accuracy accuracy);
Q_CORE_EXPORT Accuracy accuracy() const;
enum Availability { WhenInUse, Always };
enum Availability : quint8 {
WhenInUse,
Always,
};
Q_ENUM(Availability)
Q_CORE_EXPORT void setAvailability(Availability availability);