diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-10-04 18:59:17 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-10-05 14:19:59 -0300 |
commit | 254d365d5c8017a63916bf524c69313cefdeccb2 (patch) | |
tree | 78822cdc365898a6f90259b53852823f086604cc | |
parent | 4adb686fc15dc3dfdb872157df27b534f1ca7f98 (diff) |
Use QByteArray instead of QString in some internal QLayout functions.
As only latin1 chars are expected, we don't need waste memory with QString.
-rw-r--r-- | PySide/QtGui/glue/qlayout_help_functions.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/PySide/QtGui/glue/qlayout_help_functions.h b/PySide/QtGui/glue/qlayout_help_functions.h index 9e07ff5d3..e62077a73 100644 --- a/PySide/QtGui/glue/qlayout_help_functions.h +++ b/PySide/QtGui/glue/qlayout_help_functions.h @@ -3,10 +3,10 @@ void addLayoutOwnership(QLayout *layout, QLayoutItem *item); -inline QString retrieveObjectName(PyObject *obj) +inline QByteArray retrieveObjectName(PyObject *obj) { Shiboken::AutoDecRef objName(PyObject_Str(obj)); - return QString(PyString_AsString(objName)); + return PyString_AsString(objName); } inline void addLayoutOwnership(QLayout *layout, QWidget *widget) @@ -18,7 +18,7 @@ inline void addLayoutOwnership(QLayout *layout, QWidget *widget) //keep the reference while the layout is orphan Shiboken::AutoDecRef pyParent(Shiboken::Converter<QWidget*>::toPython(layout)); Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(widget)); - Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pyParent.object()), qPrintable(retrieveObjectName(pyParent)), pyChild, true); + Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true); } else { Shiboken::AutoDecRef pyParent(Shiboken::Converter<QWidget*>::toPython(parent)); Shiboken::AutoDecRef pyChild(Shiboken::Converter<QWidget*>::toPython(widget)); @@ -34,7 +34,7 @@ inline void addLayoutOwnership(QLayout *layout, QLayout *other) //keep the reference while the layout is orphan Shiboken::AutoDecRef pyParent(Shiboken::Converter<QLayout*>::toPython(layout)); Shiboken::AutoDecRef pyChild(Shiboken::Converter<QLayout*>::toPython(other)); - Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pyParent.object()), qPrintable(retrieveObjectName(pyParent)), pyChild, true); + Shiboken::keepReference(reinterpret_cast<Shiboken::SbkBaseWrapper*>(pyParent.object()), retrieveObjectName(pyParent).data(), pyChild, true); return; } |