[PyQt] pyQt + QML: tableview.property("selection") fails

Phil Thompson phil at riverbankcomputing.com
Mon Apr 6 18:48:16 BST 2015


On 04/04/2015 6:44 pm, Sébastien Renaud wrote:
> Hello!
> 
> Test computer:
>     - Windows 8.1 (x64)
>     - Python 3.4.3
>     - PyQt [downloaded from website]: PyQt GPL v5.4.1 for Python v3.4 
> (x64)
> 
> I have a problem when retrieving the "selection" property from a QML
> tableview. This works with other properties but not with selection:
> 
>     # get a dummy property, this works!
>     rowcount = tableview.property("rowCount")
>     print("rowcount: {}".format(rowcount))
> 
>     # TypeError: unable to convert a C++ 
> 'TableViewSelection_QMLTYPE_32*'
> instance to a Python object
>     selection = tableview.property("selection")
> 
> Maybe I'm doing something wrong...I attached both the .py and .qml 
> files.
> 
> Could you tell me what's wrong?
> 
> Thank you very much!

This could take a while to fix...

Phil


More information about the PyQt mailing list