[PyQt] abstractitemmodel (from examples\quick\models\) is not running

Phil Thompson phil at riverbankcomputing.com
Thu Mar 24 14:11:46 GMT 2016


On 20 Mar 2016, at 9:48 am, Daniel Krause <madakr at web.de> wrote:
> 
> Hi,
> 
> I have been looking into the qml-model-examles provided with pyqt (Python34\Lib\site-packages\PyQt5\examples\quick\models\).
> Objectlistmodel and Stringlistmodel I can run and view (the windows are created).
> 
> But abstractitemmodel does not open any window (Python34\Lib\site-packages\PyQt5\examples\quick\models\abstractitemmodel\abstractitemmodel.py).
> 
> I added some print()-statements, on my PC the script does not reach the print(view.show) statement.
> 
> >>> 
>  RESTART: C:\Python34\Lib\site-packages\PyQt5\examples\quick\models\abstractitemmodel\abstractitemmodel.py 
> AnimalModel
> Animal
> addAnimal
> rowCount
> rowCount
> rowCount
> view
> context
> view.source
> rowCount
> roleNames
> 
> 
> Could someone else please check, if abstractitemmodel is running somewhere else?
> Any ideas, why it is not working on my machine?

It's a bug. Change the strings in the _roles dict to be bytes objects.

Phil


More information about the PyQt mailing list