Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Strange behavior on PathView
QtWS25 Last Chance

Strange behavior on PathView

Scheduled Pinned Locked Moved QML and Qt Quick
10 Posts 3 Posters 5.3k Views
  • 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 Offline
    M Offline
    mario
    wrote on last edited by
    #1

    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
    0
    • D Offline
      D Offline
      DenisKormalev
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mbrasser
        wrote on last edited by
        #3

        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
        0
        • M Offline
          M Offline
          mario
          wrote on last edited by
          #4

          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
          0
          • M Offline
            M Offline
            mario
            wrote on last edited by
            #5

            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
            0
            • D Offline
              D Offline
              DenisKormalev
              wrote on last edited by
              #6

              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
              0
              • M Offline
                M Offline
                mario
                wrote on last edited by
                #7

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

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

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mbrasser
                  wrote on last edited by
                  #8

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

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    DenisKormalev
                    wrote on last edited by
                    #9

                    mbrasser, this fix will appear at 4.7.0?

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mbrasser
                      wrote on last edited by
                      #10

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

                      1 Reply Last reply
                      0

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved