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

QSpinBox in QTableWidget valueChanged not firing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 1.2.3
    • PySide
    • None
    • Windows 10; Python 2.7.16
    • Windows

    Description

      This bug presents when I put a whole lot of QSpinBox's inside a QTableWidget. When you run the attached example, the message "Row.print_str called" is displayed when the valueChanged event fires on rows 1 to 5 (and oddly row 10) of the table, but on rows 6 to 9, the valueChanged event doesn't fire and nothing is printed. The only difference between the QSpinBox's that work and don't is whether they are saved in a list after creation or not. So it seems like this is a garbage collection or reference counting problem, where the spinboxes that are not stored in a list are getting disposed of prematurely. See the following lines:

      # these are saved in a list
      # and so seem to work
      rows = []
      for x in range(0, 5):
          row = Row(t, x)
          row.add_to_table()
          rows.append(row)

      1. these rows don't work
        # presumably due to a garbage
        # collection/reference counting bug
        for x in range(5, 10):
            row = Row(t, x)
            row.add_to_table()

      Note: I'm using PySide._version_ 1.2.4 but this doesn't seem to be an option in the affects version dropdown.

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            user23846543 Tristan Aubrey-Jones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes