PySide Bugzilla Closed for New Bugs

PySide is now a Qt Add-on and uses the Qt Project's JIRA Bug Tracker instead of this Bugzilla instance. This Bugzilla is left for reference purposes.

Bug 1070 - Crash when accessing property from QML when the wrong type is specified
: Crash when accessing property from QML when the wrong type is specified
Status: NEW
Product: PySide
Classification: Unclassified
Component: QtCore
: HEAD
: PC All
: P2 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-11-27 04:44 EET by Ed Page
Modified: 2012-03-08 16:57 EET (History)
9 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Page 2011-11-27 04:44:30 EET
Steps to reproduce:
1. Declare a QProperty with the type as QObject rather than str.
2. Evaluate the contents of that property from QML

Expected Behavior

An exception or warning

Actual behavior:

Crash

See example code: https://github.com/epage/QmlFaq/tree/master/SegFault
Comment 1 Ed Page 2011-11-27 04:48:43 EET
I had spent some time debugging this.  Only after a couple month break did I
make the connection needed to find the problem.

A programmer using Python is not usually equipped to deal with segfaults,
usually problems are reported in more friendly ways.

I can understand making this safe could have performance risk.  A possible way
to mitigate some of the overhead is for there to be a runtime flag to toggle
extra safety checks.  This way a developer seeing a crash could just run with
that flag set and know what the problem is and move on.
Comment 2 lauer3912 2011-12-22 14:39:43 EET

from PySide import  QtCore


class MyObject(QtCore.QObject):
    def __init__(self):
        self._x = None


    def getX(self):
        return self._x


    def setX(self, value):
        self._x = value


    proerX = QtCore.Property(str, getX, setX)


if __name__ == "__main__":

    obj = MyObject()
    obj.proerX = "Hello"

    print obj.proerX  #print <Property object at 0x01EC23F0>
    print obj.getX()  #print Hello
Comment 3 Hugo Parente Lima 2011-12-22 15:56:37 EET
Works for me, using PySide from git HEAD
(86c6261dac472b623d5799a11dee6c8956daf600)
Comment 4 Matti Airas 2012-03-08 16:57:24 EET
PySide is now a Qt-addon and uses Qt Project's JIRA tool for tracking bugs.
Please verify that the bug is still valid and re-submit it in the address
below:

https://bugreports.qt-project.org/

Sorry for the inconvenience!