Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-94208

Calling setData directly on the QTableWidget's model randomly flips QVariant userType between int and bool

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.9.3
    • Core: Item Models
    • None
    • Windows

      Test Case:

      I was using a model returned by QTableWidget::model and inserted two rows of QVariant data of type 'bool' to the UserData role. (I also set a string to their Display role.)

      Immediately before calling setData, I confirm and assert that the userType of the data I am setting is 'bool' (typeID=1)

      Immediately after calling setData on the second row (row=1 col=0), the data which is returned by model->index(1, 0).data(Qt::UserData) now shows a userType of 'int' (typeID=2).

      Note: this does not happen on all program runs. It happens sporadically on some program runs. You have to completely shut down and restart. When it's happening, it is repeatable during that program run.

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

            dfaure_kdab David Faure
            sapient Patrick Parker
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes