Property with a list as possible values for custom widget?
-
@Panoss
Well give it some hours. Maybe a Qt python user know the secret of
how to have it available. -
wrote on 17 Jan 2017, 12:48 last edited by Panoss
https://hub.qgis.org/wiki/17/Python_plugin_API_changes_from_18_to_20#Replace-QStringList-with-list
"Replace QList methods with python list function"
So both Qlist and QStringList are replaced by list.
-
https://hub.qgis.org/wiki/17/Python_plugin_API_changes_from_18_to_20#Replace-QStringList-with-list
"Replace QList methods with python list function"
So both Qlist and QStringList are replaced by list.
But is that no QGIS API ?
is that the same as
https://sourceforge.net/projects/pyqt/It looks as some other binding. So i Guess that is why its not there.
-
wrote on 17 Jan 2017, 14:26 last edited by
Well now I'm confused, I don't really know.
I 'll have to 'dig' more. -
I tried this:
QList = []
ContainersWidgets = QtCore.pyqtProperty(QList, getContainersWidgets, setContainersWidgets)
But I get an error:
"ContainersWidgets = QtCore.pyqtProperty(QList, getContainersWidgets, setContainersWidgets)
TypeError: bytes or ASCII string expected not 'list'"It doesn't accept a List, only bytes or ASCII.
@Panoss said in Property with a list as possible values for custom widget?:
QList = []
Should be
QList = type([])
-
@Panoss said in Property with a list as possible values for custom widget?:
QList = []
Should be
QList = type([])
wrote on 17 Jan 2017, 15:02 last edited by Panoss@jsulm said in Property with a list as possible values for custom widget?:
@Panoss said in Property with a list as possible values for custom widget?:
QList = []
Should be
QList = type([])
You re right!!!
Now the error is gone!But my property doesn't appear in Qt Designer.
21/26