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 995 - QDeclarativeView.itemAt returns faulty reference. (leading to SEGFAULT)
: QDeclarativeView.itemAt returns faulty reference. (leading to SEGFAULT)
Status: CLOSED FIXED
Product: PySide
Classification: Unclassified
Component: QtDeclarative
: 1.0.6
: PC Linux
: P2 normal
Assigned To: Hugo Parente Lima
:
:
:
  Show dependency treegraph
 
Reported: 2011-09-02 11:35 EEST by Ulrik Mikaelsson
Modified: 2011-10-18 17:38 EEST (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 Ulrik Mikaelsson 2011-09-02 11:35:11 EEST
This program segfaults on the "print"-line when clicking on the rectangle in
the middle. Clicking outside is OK.

test.py:
  import sys

  from PySide import QtCore, QtGui, QtDeclarative
  from PySide.QtCore import Qt

  class MyView(QtDeclarative.QDeclarativeView):
    def mousePressEvent(self, event):
        if event.button() == Qt.LeftButton:
            print self.itemAt(event.pos())

  app = QtGui.QApplication("myapp")
  view = MyView("test.qml")
  view.show()
  view.resize(200, 200)
  sys.exit(app.exec_())

test.qml:
  import Qt 4.7

  Rectangle {
    width: 100
    height: 100
    color: "red"

    Text {
        text: "Hello World"
        anchors.centerIn: parent
    }
  }
Comment 1 Hugo Parente Lima 2011-09-14 02:27:03 EEST
Fixed in commit:

shiboken/b7bb6b242b790de89f6a5328f724192d06221e0f

PySide unit test in commit:

pyside/60f657f0174e8e95e1d30a605dd87d70d64f73cd

Thanks very much for the report!
Comment 2 renato filho 2011-09-21 20:49:20 EEST
Release 1.0.7
Comment 3 Hugo Parente Lima 2011-10-18 17:38:46 EEST
*** Bug 1015 has been marked as a duplicate of this bug. ***