diff -r 764381756899 -r 62373840e33a src/basics.h --- a/src/basics.h Wed Mar 11 19:05:34 2020 +0200 +++ b/src/basics.h Tue Mar 17 23:13:29 2020 +0200 @@ -129,6 +129,17 @@ return static_cast(x); } +/** +* @brief casts floating point values to qreal, converting non-floating point values causes an error +* @param[in] x floating point value to cast +* @returns qreal +*/ +template +auto toQreal(T x) -> std::enable_if_t, qreal> +{ + return static_cast(x); +} + template inline QPoint toQPoint(const glm::vec& vec) {