Qt Forum

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

    Problems with QTreeview + QFileSystemModel

    General and Desktop
    1
    1
    536
    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.
    • H
      HankQ last edited by

      Hello,

      I use QFileSystemModel and Qtreeview for a directoryview. If a folder has a subfolder and the subfolder was expanded anytime before, I can`t rename this folder.
      Any hints how I could fix that?

      @#include <QtGui>

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

      QFileSystemModel filemodel;
      filemodel.setRootPath("");
      QTreeView treeview;
      treeview.setModel(&filemodel);
      filemodel.setReadOnly(false);
      
      treeview.setIndentation(20);
      treeview.setSortingEnabled(true);
      filemodel.setReadOnly(false);
      
      treeview.setWindowTitle(QObject::tr("Dir View"));
      

      #if defined(Q_OS_SYMBIAN) || defined(Q_WS_MAEMO_5)
      tree.showMaximized();
      #else
      treeview.resize(640, 480);
      treeview.show();
      #endif

      return app.exec();
      

      }
      @

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