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

QtQuick: SignalSpy connected to a QAbstractItemModel::dataChanged() does not store all arguments of the signal

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7.2
    • Testing: QuickTest
    • None
    • Linux/X11

    Description

      In my unit test I connnect a QML SignalSpy to a QAbstractItemModel::dataChanged() signal.

      According to the Qt documentation this signal has 3 arguments:

      void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QList<int> &roles = QList<int>())

      In my application the third argument "roles" should contain exactly one entry (a custom role with value 256). I need to verify this.

      But SignalSpy reports only 2 arguments of the received signal: topLeft and topRight (which are both correct in my unit test).

      console.log(spy.signalArguments[0].length) tells "2" and

      console.log(spy.signalArguments[0][2]) tells "undefined".

       

      Expected behavior:

      SignalSpy stores ALL arguments of the connected signal in its signalArguments list.

      In my case spy.signalArguments[i].length should be 3 for all received dataChanged() signals and spy.signalArguments[i][2] is a list of int which may be empty.{}

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            cyril Harald Prasser
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes