aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2011-08-29 15:02:27 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:48 -0300
commit1c4ebcbe8a79c7b5c9a9db8164493926009831db (patch)
treebac83127b8c888caac432ac744282d11f3d0cf79 /PySide
parent24838672f0b8256a4fddcb04cf30d7a4d53b7d52 (diff)
Fixed gcc warning during QDate conversion compilation.
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtCore/qdate_conversions.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/PySide/QtCore/qdate_conversions.h b/PySide/QtCore/qdate_conversions.h
index 7c45eece9..586fc3ce4 100644
--- a/PySide/QtCore/qdate_conversions.h
+++ b/PySide/QtCore/qdate_conversions.h
@@ -1,3 +1,7 @@
+#define PySideDateTime_IMPORT \
+ PyDateTimeAPI = (PyDateTime_CAPI*) PyCObject_Import((char*)"datetime", \
+ (char*)"datetime_CAPI")
+
namespace Shiboken {
inline bool Converter<QDate>::checkType(PyObject* pyObj)
@@ -16,7 +20,7 @@ inline bool Converter<QDate>::isConvertible(PyObject* pyObj)
return true;
if (!PyDateTimeAPI)
- PyDateTime_IMPORT;
+ PySideDateTime_IMPORT;
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QDate >());
return PyDate_Check(pyObj) || ObjectType::isExternalConvertible(shiboType, pyObj);
@@ -25,7 +29,7 @@ inline bool Converter<QDate>::isConvertible(PyObject* pyObj)
inline QDate Converter<QDate>::toCpp(PyObject* pyObj)
{
if (!PyDateTimeAPI)
- PyDateTime_IMPORT;
+ PySideDateTime_IMPORT;
if (pyObj == Py_None) {
return QDate();