ros-visualization / python_qt_binding

http://wiki.ros.org/python_qt_binding
BSD 3-Clause "New" or "Revised" License
34 stars 54 forks source link

fails to provide QString / QStringList #8

Closed dirk-thomas closed 11 years ago

dirk-thomas commented 11 years ago

While these types are accessible when using e.g. PyQt4 directly:

from PyQt4 import QtCore
QtCore.QStringList

the same does not work thorugh python_qt_binding.

The user can usually use native Python strings and list of strings. But it would be nice if the same way which works for the native bindings would also work with python_qt_binding.

DorianScholz commented 11 years ago

This is not a bug as it behaves the same way as the native bindings do on SIP API version 2. PyQt4 with SIP API version 2 as well as PySide in general do not support the use of Qt's string and list classes as they are transparently replaced by the appropriate Python types: http://qt-project.org/wiki/Differences_Between_PySide_and_PyQt#b7669e9ad9355d8b4e8fdccade317b2b

You will get the same result when importing PyQt4 manually and setting the SIP API version to 2. Is there any use case where you would need those classes?

dirk-thomas commented 11 years ago

I filled the ticket because of http://answers.ros.org/question/86746/python_qt_binding-and-qstringlistqstringlistmodel-missing/. I suggested to use plain Python strings / list there.

When I did a quick test I did not set the API version - you are absolutely right - the current behavior is intended.