Fix complation warning relative to PyDateTime_IMPORT.
This commit is contained in:
parent
6e9b7ffd59
commit
65d4cf2be4
1 changed files with 5 additions and 2 deletions
|
|
@ -1,3 +1,6 @@
|
||||||
|
#define PySideDateTime_IMPORT \
|
||||||
|
PyDateTimeAPI = (PyDateTime_CAPI*) PyCObject_Import((char*)"datetime", \
|
||||||
|
(char*)"datetime_CAPI")
|
||||||
namespace Shiboken {
|
namespace Shiboken {
|
||||||
|
|
||||||
inline bool Converter<QDateTime>::checkType(PyObject* pyObj)
|
inline bool Converter<QDateTime>::checkType(PyObject* pyObj)
|
||||||
|
|
@ -16,7 +19,7 @@ inline bool Converter<QDateTime>::isConvertible(PyObject* pyObj)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!PyDateTimeAPI)
|
if (!PyDateTimeAPI)
|
||||||
PyDateTime_IMPORT;
|
PySideDateTime_IMPORT;
|
||||||
|
|
||||||
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QDateTime >());
|
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QDateTime >());
|
||||||
return PyDateTime_Check(pyObj) || ObjectType::isExternalConvertible(shiboType, pyObj);
|
return PyDateTime_Check(pyObj) || ObjectType::isExternalConvertible(shiboType, pyObj);
|
||||||
|
|
@ -26,7 +29,7 @@ inline bool Converter<QDateTime>::isConvertible(PyObject* pyObj)
|
||||||
inline QDateTime Converter<QDateTime>::toCpp(PyObject* pyObj)
|
inline QDateTime Converter<QDateTime>::toCpp(PyObject* pyObj)
|
||||||
{
|
{
|
||||||
if (!PyDateTimeAPI)
|
if (!PyDateTimeAPI)
|
||||||
PyDateTime_IMPORT;
|
PySideDateTime_IMPORT;
|
||||||
|
|
||||||
if (pyObj == Py_None) {
|
if (pyObj == Py_None) {
|
||||||
return QDateTime();
|
return QDateTime();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue