ImportError: cannot import name 'QStringList' in PyQt5
In PyQt5, there is no QString
and hence no need for QStringList
.
Any Qt API that would normally return a QString
, will automatically return a Python string instead. Similarly, any Qt APIs that would normally return a QStringList
will return a Python list containing Python strings. And the opposite also applies: any Qt API that would normally accept a QString
or QStringList
will accept the Python equivalents instead.
This is the same as the default behaviour when using PyQt4 with Python 3, or when explicitly setting the API to version 2 using sip.setapi
.
For more details, see: Differences Between PyQt4 and PyQt5 in the PyQt5 Reference.