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

Sébastien Renaud neitsa at gmail.com
Sat Apr 4 18:44:37 BST 2015


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!
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tableview_problem.py
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150404/6f595ccc/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: tableview_problem.qml
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20150404/6f595ccc/attachment-0001.ksh>


More information about the PyQt mailing list