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

QAbstractItemModel should register the QVector<int> metatype

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.4.2
    • Core: Other
    • None

    Description

      While running my application I saw this in the logs:

      QObject::connect: Cannot queue arguments of type 'QVector<int>'
      (Make sure 'QVector<int>' is registered using qRegisterMetaType().)

      I was a bit startled, because I'm not even using QVector in my application, at all. After some debugging, I believe that the cause for this warning is that I'm emitting the QAbstractItemModel::dataChanged() signal from a QThread. While I'm passing only two parameters to this signal (the QModelIndex'es of the changed items), the signal has an optional third parameter, which is "const QVector<int> &roles".

      While it's easy to workaround this issue by just registering the QVector<int> metatype in my app, I believe that Qt's QAbstractItemModel should do it, since it's the one defining the signal.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            mardy Alberto Mardegan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes