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

C++ model crashes QML

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.7.0
    • 4.7.0
    • None
    • Linux, Kubuntu 9.10, Qt from the 4.7 branch as of 2010-03-18, g++ (Ubuntu 4.4.1-4ubuntu9) 4.4.1
    • 55ffc0f27638485803f29d985a57deb5b3db4584

    Description

      Setting a QList<QObject *> model as the model for a GridView causes a crash when a new model is set. Basic idea is:

      QtDeclarative view;
      QList<QObject *> model1;
      model1 << ....;
      view.rootContext()->setContextProperty("modle", QVariant::fromValue( model ) );

      No problems here, the model data is used without an problems. Create a new list with data of the same type, but with fewer elements than in model1:

      QList<QObject *> model2;
      model2 << ....;
      view.rootContext()->setContextProperty("modle", QVariant::fromValue( model ) );

      This will crash. If model2 contains more elements than model1 it works ok, so the key seems to be that the second model must have less items.

      Attachments

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

        Activity

          People

            martjone Martin Jones (closed Nokia identity) (Inactive)
            chakie Jan Ekholm
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes