QFixed: add implicit conversion from long long

This will come in handy when porting some GUI code to qsizetype.

Pick-to: 6.4
Task-number: QTBUG-104818
Change-Id: I426a4f425ebd7a9fdc2d2bba97dae4c640ded97e
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
This commit is contained in:
Marc Mutz 2022-07-07 16:30:38 +02:00
parent 44653cdf4c
commit 13764280b4

View File

@ -29,6 +29,7 @@ public:
constexpr QFixed() : val(0) {}
constexpr QFixed(int i) : val(i * 64) {}
constexpr QFixed(long i) : val(i * 64) {}
constexpr QFixed(long long i) : val(i * 64) {}
constexpr static QFixed fromReal(qreal r) { return fromFixed((int)(r*qreal(64))); }
constexpr static QFixed fromFixed(int fixed) { return QFixed(fixed,0); } // uses private ctor