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. [Solved]Create icon by Qt
Forum Updated to NodeBB v4.3 + New Features

[Solved]Create icon by Qt

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.4k 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.
  • S Offline
    S Offline
    stereomatching
    wrote on last edited by
    #1

    "example...":http://www.freeimagehosting.net/okfsc

    When I using QDirModel(QFileSystem will stall the gui even I use QTask), the tableView
    will show the icons of differents automatically, how could I get the icon like QDirModel do
    manually.

    I don't know how to make the title become easier to understand, sorry about that.

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi there,
      Stated in the documentation it is recommended to use the QFileSystemModel instead of the QDirModel.
      In the model in the data function (which gives the view its information), there is also a FileIconRole role. Use that one to give the view a proper icon to display.
      Greetz

      Greetz, Jeroen

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stereomatching
        wrote on last edited by
        #3

        I tried QFileSystemModel before, but the QFileSystem will stall the gui even I run it on another
        thread when I need to rename a lot of files.QFileSystem will keep updating if the name of the files
        being changed, but QDirModel would not.

        Thanks, I will study and try FileIconRole.

        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