support both Qt5 and Qt6

This commit is contained in:
pls.153 2022-01-25 14:41:35 +01:00
parent 07f5fd05a0
commit 4440c06e70
6 changed files with 21 additions and 11 deletions

View file

@ -225,7 +225,11 @@ TO_CL_FLOAT_4 (QRectF, qrectf, x, y, width, height)
cl_object from_qvariant(const QVariant& var) {
cl_object l_obj = ECL_NIL;
#if QT_VERSION < 0x060000
const int type = var.type();
#else
const int type = var.typeId();
#endif
switch (type) {
case QMetaType::Bool: l_obj = var.toBool() ? ECL_T : ECL_NIL; break;
case QMetaType::Double: l_obj = ecl_make_doublefloat(var.toDouble()); break;