Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-154

Probable bug: two wrappers can have the same C pointer address

    XMLWordPrintable

Details

    Description

      Two different C++ objects may have the same C pointer address. An example is QTextEdit.ExtraSelection which is a fairly simple struct whose first member is a cursor. With pyside / shiboken:

      from PySide2 import shiboken2 as shiboken
      from PySide2.QtWidgets import *
      extra = QTextEdit.ExtraSelection()
      cursor = extra.cursor
      print(shiboken.getCppPointer(extra))
      print(shiboken.getCppPointer(cursor))
      

      Both will have the same address. The probable bug is that both are registered in binding manager's wrapperMapper and code looking up one or the other may get the wrong wrapper. I found this when I inserted local changes to ensure two wrappers aren't inserted in the wrapperaMapper; I don't know of an observable bug caused by this.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              kleint Friedemann Kleint
              jpe John Ehresman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes