QFixed: add implicit conversion from long long

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

Task-number: QTBUG-104818
Change-Id: I426a4f425ebd7a9fdc2d2bba97dae4c640ded97e
Reviewed-by: Lars Knoll <lars.knoll@gmail.com>
(cherry picked from commit 13764280b450c90ed65197d86cb8887d62fb13cc)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Marc Mutz 2022-07-07 16:30:38 +02:00
parent bb07d03e2a
commit 3ddcb2b33e

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