changed all double data types to qreal (except thirdparty code)