×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    5

    Question How to Set different Icons for file List

    Hi!
    I'm new to Qt platform ,i'm trying to implement FileListModel, which is inherited from QFileSystemModel,
    so that it should show the FileList on the ListView with different Icons , please let me know how to set the different Icons and which functions need to be implement in the FileListModel class.
    Thanks in advance

    NyamathUlla Khan

  2. #2
    Registered User
    Join Date
    Oct 2007
    Posts
    178

    Post Re: How to Set different Icons for file List

    How about something like this, for one item.

    Code:
        // Get icon from current file
        QFileSystemModel fileSystem;
        QModelIndex indexItem = fileSystem.index("c:/data/testfile.bmp");
        QIcon fileIcon = fileSystem.fileIcon(indexItem);
    
        // Put the icon to list view
        QListView list;
        QActionGroup group;
        QAction* newAction = group.addAction(fileIcon,"c:/data/testfile.bmp");
        list.addAction(newAction);

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    5

    Re: How to Set different Icons for file List

    Thanks for your suggestion ,but while creating the file name or new string then how to set the Icon . on the ListView.
    and how to show two(2) lines on the ListView , let's say
    Line 1: Icon with text
    Line2: text .
    plase help me out,
    Thanks in advance
    NyamathUlla Khan

  4. #4
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: How to Set different Icons for file List

    Tell us your problem in detail.
    Code given by ManuMies had solved your problem or not ?

    And I understand your question that want to add ICON to the list then CLICK HERE.

    Best regards,
    RaHuL

Similar Threads

  1. Replies: 1
    Last Post: 2010-03-22, 07:54
  2. How to set *scalable* icons in resource files?
    By svdwal in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-07-14, 16:02
  3. How to set different icons in ListBox?
    By daip02 in forum Symbian User Interface
    Replies: 4
    Last Post: 2004-07-05, 11:17
  4. How to set icons for softkeys?
    By sreenivasuluy in forum Symbian User Interface
    Replies: 0
    Last Post: 2003-11-27, 09:37

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×