Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems with QTreeview + QFileSystemModel

Problems with QTreeview + QFileSystemModel

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 603 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.
  • H Offline
    H Offline
    HankQ
    wrote on last edited by
    #1

    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
    0

    • Login

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