Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Strange behavior on PathView

    QML and Qt Quick
    3
    10
    4698
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      mario last edited by

      I'm observing a strange behavior on PathView. I'm using an AbstractItemModel as model for a PathView. The model is populated by using a QTimer after the initial app setup (after creating the view etc):
      @void MyModel::loadItems(const QString &file)
      {
      QList<Item> items;
      // Load, parse and put items into the list
      beginResetModel();
      m_items = items;
      endResetModel();
      }
      @

      Sadly, this fails. The PathView shows no entries, but if I call setItems() before I create the declarative view it works.

      What's really strange is that ListView works with the QTimer-solution. Any ideas?

      1 Reply Last reply Reply Quote 0
      • D
        DenisKormalev last edited by

        Looks like PathView simply doesn't use reset signals. Have you tried with beginInsertRows()/endInsertRows() ?

        1 Reply Last reply Reply Quote 0
        • M
          mbrasser last edited by

          PathView should work with the reset signals (autotest tst_QDeclarativePathView::resetModel() tests this). If you can provide an example to reproduce this (preferably in the "bug tracker":http://bugreports.qt.nokia.com) we can look into it further.

          1 Reply Last reply Reply Quote 0
          • M
            mario last edited by

            Thanks guys. I'll try to "scale down" the code to a simple example and see if it happens. If the problem persists I'll file a bug report.

            I'll also post the result here.

            1 Reply Last reply Reply Quote 0
            • M
              mario last edited by

              Ok, I have filed a bug on this which can be found at http://bugreports.qt.nokia.com/browse/QTBUG-13017

              The bug report contains a small C++/Quick app which demonstrates the issue.

              1 Reply Last reply Reply Quote 0
              • D
                DenisKormalev last edited by

                Tried by myself at Qt 4.7 beta1. Behavior is similar to what mario described. Maybe something with newer version can test (beta2 or not too old master build) and post results here?

                1 Reply Last reply Reply Quote 0
                • M
                  mario last edited by

                  Kinda feels good I'm not the only one :)

                  I tried it with both beta1 and beta2, same behavior.

                  1 Reply Last reply Reply Quote 0
                  • M
                    mbrasser last edited by

                    A fix has been pushed to the qt-qml staging repo. Thanks for the bug report!

                    1 Reply Last reply Reply Quote 0
                    • D
                      DenisKormalev last edited by

                      mbrasser, this fix will appear at 4.7.0?

                      1 Reply Last reply Reply Quote 0
                      • M
                        mbrasser last edited by

                        It's unlikely that it will appear in 4.7.0 at this point -- most likely 4.7.1 .

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post