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

QFileSystemModel::setRootPath does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: P4: Low P4: Low
    • None
    • 4.7.0
    • Widgets: Itemviews
    • None

      #include <QApplication>

      #include <QFileSystemModel>
      #include <QTreeView>

      #include "mainwidget.h"

      int main(int argc, char **argv) {
      QApplication app(argc, argv);

      QFileSystemModel fsm;
      fsm.setRootPath("/home");

      QTreeView tree;
      tree.setModel(&fsm);
      tree.show();

      return app.exec();
      }

      Result : The model is not rooted at '/home', but at the imaginary item above '/'

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

            vfm Thierry Bastian (closed Nokia identity) (Inactive)
            steveire Stephen Kelly (Personal)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes