Commit aa8c6de0 authored by CABEL Tristan's avatar CABEL Tristan

Merge branch 'release/1.6.4'

parents c5b2e496 e7e73408
# ChangeLog # ChangeLog
## version 1.6.4 - 2018-11-09
- fix for QVariant wrapper mapping
## version 1.6.3 - 2018-11-08 ## version 1.6.3 - 2018-11-08
- fix for conda and DTK_INSTALL_PREFIX - fix for conda and DTK_INSTALL_PREFIX
## version 1.6.2 - 2018-11-08 ## version 1.6.2 - 2018-11-08
......
...@@ -24,7 +24,7 @@ project(dtk) ...@@ -24,7 +24,7 @@ project(dtk)
set(dtk_VERSION_MAJOR 1) set(dtk_VERSION_MAJOR 1)
set(dtk_VERSION_MINOR 6) set(dtk_VERSION_MINOR 6)
set(dtk_VERSION_PATCH 3) set(dtk_VERSION_PATCH 4)
set(dtk_VERSION set(dtk_VERSION
${dtk_VERSION_MAJOR}.${dtk_VERSION_MINOR}.${dtk_VERSION_PATCH}) ${dtk_VERSION_MAJOR}.${dtk_VERSION_MINOR}.${dtk_VERSION_PATCH})
......
...@@ -177,6 +177,103 @@ namespace Namespace { ...@@ -177,6 +177,103 @@ namespace Namespace {
} }
} }
%typemap(out) QVariant {
QVariant val = $1;
PyObject *v;
int type = val.type();
if (type == QMetaType::Int ||
type == QMetaType::UInt ||
type == QMetaType::Long ||
type == QMetaType::ULong ||
type == QMetaType::LongLong ||
type == QMetaType::ULongLong) {
v = PyInt_FromLong(val.value<long>());
} else if (type == QMetaType::Float ||
type == QMetaType::Double) {
v = PyFloat_FromDouble(val.value<double>());
} else if (type == QMetaType::QString) {
v = PyString_FromString(qPrintable(val.value<QString>()));
} else if (type == QMetaType::Bool) {
bool b = val.value<bool>();
v = b ? Py_True : Py_False;
}
$result = v;
}
%typemap(out) const QVariant& {
QVariant val = *($1);
PyObject *v;
int type = val.type();
if (type == QMetaType::Int ||
type == QMetaType::UInt ||
type == QMetaType::Long ||
type == QMetaType::ULong ||
type == QMetaType::LongLong ||
type == QMetaType::ULongLong) {
v = PyInt_FromLong(val.value<long>());
} else if (type == QMetaType::Float ||
type == QMetaType::Double) {
v = PyFloat_FromDouble(val.value<double>());
} else if (type == QMetaType::QString) {
v = PyString_FromString(qPrintable(val.value<QString>()));
} else if (type == QMetaType::Bool) {
bool b = val.value<bool>();
v = b ? Py_True : Py_False;
}
$result = v;
}
%typemap(directorin) QVariant {
QVariant val = $1;
PyObject *v;
int type = val.type();
if (type == QMetaType::Int ||
type == QMetaType::UInt ||
type == QMetaType::Long ||
type == QMetaType::ULong ||
type == QMetaType::LongLong ||
type == QMetaType::ULongLong) {
v = PyInt_FromLong(val.value<long>());
} else if (type == QMetaType::Float ||
type == QMetaType::Double) {
v = PyFloat_FromDouble(val.value<double>());
} else if (type == QMetaType::QString) {
v = PyString_FromString(qPrintable(val.value<QString>()));
} else if (type == QMetaType::Bool) {
bool b = val.value<bool>();
v = b ? Py_True : Py_False;
}
$input = v;
}
%typemap(directorin) const QVariant& {
QVariant val = $1;
PyObject *v;
int type = val.type();
if (type == QMetaType::Int ||
type == QMetaType::UInt ||
type == QMetaType::Long ||
type == QMetaType::ULong ||
type == QMetaType::LongLong ||
type == QMetaType::ULongLong) {
v = PyInt_FromLong(val.value<long>());
} else if (type == QMetaType::Float ||
type == QMetaType::Double) {
v = PyFloat_FromDouble(val.value<double>());
} else if (type == QMetaType::QString) {
v = PyString_FromString(qPrintable(val.value<QString>()));
} else if (type == QMetaType::Bool) {
bool b = val.value<bool>();
v = b ? Py_True : Py_False;
}
$input = v;
}
%typemap(in) QStringList { %typemap(in) QStringList {
if (PyList_Check($input)) { if (PyList_Check($input)) {
int i = 0; int i = 0;
...@@ -604,10 +701,10 @@ namespace Namespace { ...@@ -604,10 +701,10 @@ namespace Namespace {
v = PyInt_FromLong(val.value<long>()); v = PyInt_FromLong(val.value<long>());
} else if (type == QMetaType::Float || } else if (type == QMetaType::Float ||
type == QMetaType::Double) { type == QMetaType::Double) {
v = PyFloat_AsDouble(val.value<double>()); v = PyFloat_FromDouble(val.value<double>());
} else if (type == QMetatype::QString) { } else if (type == QMetaType::QString) {
v = PyString_FromString(qPrintable(val.value<QString>())) v = PyString_FromString(qPrintable(val.value<QString>()))
} else if (type == QMetatype::Bool) { } else if (type == QMetaType::Bool) {
bool b = val.value<bool>(); bool b = val.value<bool>();
v = b ? Py_True : Py_False; v = b ? Py_True : Py_False;
} }
...@@ -634,10 +731,10 @@ namespace Namespace { ...@@ -634,10 +731,10 @@ namespace Namespace {
v = PyInt_FromLong(val.value<long>()); v = PyInt_FromLong(val.value<long>());
} else if (type == QMetaType::Float || } else if (type == QMetaType::Float ||
type == QMetaType::Double) { type == QMetaType::Double) {
v = PyFloat_AsDouble(val.value<double>()); v = PyFloat_FromDouble(val.value<double>());
} else if (type == QMetatype::QString) { } else if (type == QMetaType::QString) {
v = PyString_FromString(qPrintable(val.value<QString>())) v = PyString_FromString(qPrintable(val.value<QString>()))
} else if (type == QMetatype::Bool) { } else if (type == QMetaType::Bool) {
bool b = val.value<bool>(); bool b = val.value<bool>();
v = b ? Py_True : Py_False; v = b ? Py_True : Py_False;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment