Put all custom converters inside Shiboken namespace.
This commit is contained in:
parent
20077974e8
commit
3599b75f88
10 changed files with 20 additions and 0 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
template <>
|
template <>
|
||||||
struct Converter<QBool> : public ConverterBase<QBool>
|
struct Converter<QBool> : public ConverterBase<QBool>
|
||||||
{
|
{
|
||||||
|
|
@ -12,3 +13,4 @@ struct Converter<QBool> : public ConverterBase<QBool>
|
||||||
return QBool(pyobj == Py_True);
|
return QBool(pyobj == Py_True);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
template <typename qhash>
|
template <typename qhash>
|
||||||
struct Converter_qhash
|
struct Converter_qhash
|
||||||
{
|
{
|
||||||
|
|
@ -42,3 +43,4 @@ struct Converter_qhash
|
||||||
|
|
||||||
template<typename KT, typename VT>
|
template<typename KT, typename VT>
|
||||||
struct Converter<QHash<KT, VT> > : Converter_qhash<QHash<KT, VT> > {};
|
struct Converter<QHash<KT, VT> > : Converter_qhash<QHash<KT, VT> > {};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct Converter<QList<T> > : Converter_std_list<QList<T> > {};
|
struct Converter<QList<T> > : Converter_std_list<QList<T> > {};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
template <typename qmap>
|
template <typename qmap>
|
||||||
struct Converter_qmap
|
struct Converter_qmap
|
||||||
{
|
{
|
||||||
|
|
@ -42,3 +43,4 @@ struct Converter_qmap
|
||||||
|
|
||||||
template<typename KT, typename VT>
|
template<typename KT, typename VT>
|
||||||
struct Converter<QMap<KT, VT> > : Converter_qmap<QMap<KT, VT> > {};
|
struct Converter<QMap<KT, VT> > : Converter_qmap<QMap<KT, VT> > {};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
template<typename FT, typename ST>
|
template<typename FT, typename ST>
|
||||||
struct Converter<QPair<FT, ST> > : Converter_std_pair<QPair<FT, ST> > {};
|
struct Converter<QPair<FT, ST> > : Converter_std_pair<QPair<FT, ST> > {};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
template <typename qset>
|
template <typename qset>
|
||||||
struct Converter_qset
|
struct Converter_qset
|
||||||
{
|
{
|
||||||
|
|
@ -40,3 +41,4 @@ struct Converter_qset
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct Converter<QSet<T> > : Converter_qset<QSet<T> > {};
|
struct Converter<QSet<T> > : Converter_qset<QSet<T> > {};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
inline bool Converter< QString >::isConvertible(PyObject* pyobj)
|
inline bool Converter< QString >::isConvertible(PyObject* pyobj)
|
||||||
{
|
{
|
||||||
return PyString_Check(pyobj)
|
return PyString_Check(pyobj)
|
||||||
|
|
@ -51,3 +52,4 @@ inline QString Converter< QString >::toCpp(PyObject* pyobj)
|
||||||
#endif
|
#endif
|
||||||
return *SbkQString_cptr(pyobj);
|
return *SbkQString_cptr(pyobj);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ struct QMetaTypeId< PyObjectHolder >
|
||||||
};
|
};
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
|
||||||
|
namespace Shiboken {
|
||||||
// all types are convertible to QVariant
|
// all types are convertible to QVariant
|
||||||
inline bool Converter<QVariant>::isConvertible(PyObject* pyobj)
|
inline bool Converter<QVariant>::isConvertible(PyObject* pyobj)
|
||||||
{
|
{
|
||||||
|
|
@ -81,3 +82,4 @@ inline QVariant Converter<QVariant>::toCpp(PyObject* pyobj)
|
||||||
return QVariant(typeCode, reinterpret_cast<SbkBaseWrapper*>(pyobj)->cptr);
|
return QVariant(typeCode, reinterpret_cast<SbkBaseWrapper*>(pyobj)->cptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
template<typename T>
|
template<typename T>
|
||||||
struct Converter<QVector<T> > : Converter_std_list<QVector<T> > {};
|
struct Converter<QVector<T> > : Converter_std_list<QVector<T> > {};
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
namespace Shiboken {
|
||||||
inline bool Converter< QPixmap >::isConvertible(PyObject* pyobj)
|
inline bool Converter< QPixmap >::isConvertible(PyObject* pyobj)
|
||||||
{
|
{
|
||||||
bool isVariant = SbkQVariant_Check(pyobj);
|
bool isVariant = SbkQVariant_Check(pyobj);
|
||||||
|
|
@ -25,3 +26,4 @@ inline QPixmap Converter< QPixmap >::toCpp(PyObject* pyobj)
|
||||||
|
|
||||||
return *SbkQPixmap_cptr(pyobj);
|
return *SbkQPixmap_cptr(pyobj);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue