Fixed gcc warning during QDate conversion compilation.
This commit is contained in:
parent
24838672f0
commit
1c4ebcbe8a
1 changed files with 6 additions and 2 deletions
|
|
@ -1,3 +1,7 @@
|
||||||
|
#define PySideDateTime_IMPORT \
|
||||||
|
PyDateTimeAPI = (PyDateTime_CAPI*) PyCObject_Import((char*)"datetime", \
|
||||||
|
(char*)"datetime_CAPI")
|
||||||
|
|
||||||
namespace Shiboken {
|
namespace Shiboken {
|
||||||
|
|
||||||
inline bool Converter<QDate>::checkType(PyObject* pyObj)
|
inline bool Converter<QDate>::checkType(PyObject* pyObj)
|
||||||
|
|
@ -16,7 +20,7 @@ inline bool Converter<QDate>::isConvertible(PyObject* pyObj)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!PyDateTimeAPI)
|
if (!PyDateTimeAPI)
|
||||||
PyDateTime_IMPORT;
|
PySideDateTime_IMPORT;
|
||||||
|
|
||||||
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QDate >());
|
SbkObjectType* shiboType = reinterpret_cast<SbkObjectType*>(SbkType< ::QDate >());
|
||||||
return PyDate_Check(pyObj) || ObjectType::isExternalConvertible(shiboType, pyObj);
|
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)
|
inline QDate Converter<QDate>::toCpp(PyObject* pyObj)
|
||||||
{
|
{
|
||||||
if (!PyDateTimeAPI)
|
if (!PyDateTimeAPI)
|
||||||
PyDateTime_IMPORT;
|
PySideDateTime_IMPORT;
|
||||||
|
|
||||||
if (pyObj == Py_None) {
|
if (pyObj == Py_None) {
|
||||||
return QDate();
|
return QDate();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue