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. Dir View Example is not working correctly
Qt 6.11 is out! See what's new in the release blog

Dir View Example is not working correctly

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 445 Views 1 Watching
  • 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
    megapro17
    wrote on last edited by
    #1

    Problem is, that there is no icons, as in example. I tried even writing own icon provider, and seems that it don't work correctly anyway. Qt version is 6.0.4

    How it looks from example:
    example
    And mine:
    Annotation 2021-08-21 023302.png

    #include <QApplication>
    #include <QFileSystemModel>
    #include <QFileIconProvider>
    #include <QTreeView>
    #include <QCommandLineParser>
    #include <QCommandLineOption>
    
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QFileSystemModel model;
        QFileIconProvider iconProvider;
        model.setIconProvider(&iconProvider);
        model.setRootPath("");
    
        QTreeView tree;
        tree.setModel(&model);
        tree.resize(800,500);
        tree.setWindowTitle(QObject::tr("Dir View"));
        tree.show();
    
        return app.exec();
    }
    
    
    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      The same code shows icons in 5.12.2 so seems to be a Qt6 thing.
      I tried to search https://bugreports.qt.io/ but didnt see a report.

      1 Reply Last reply
      1

      • Login

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