Results 1 to 3 of 3

Thread: [Resolved] How can I add a column with Image into the model

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Chengdu, China
    Posts
    8
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question [Resolved] How can I add a column with Image into the model

    Hi everyone,
    I have rewrite the QDirModel by myslef. I want to add a column to show some images.

    In the QDirModel, there is only 'Name', 'Size', 'Type', 'Date Modified'. And all of them are QString type.
    Qt Code:
    1. QString name(const QModelIndex &index) const;
    2. QString size(const QModelIndex &index) const;
    3. QString type(const QModelIndex &index) const;
    4. QString time(const QModelIndex &index) const;
    5.  
    6. case 0: return d->name(index);
    7. case 1: return d->size(index);
    8. case 2: return d->type(index);
    9. case 3: return d->time(index);
    To copy to clipboard, switch view to plain text mode 

    So, I want to know what type can I set that it can show the images in the additional column. I have tried 'QPixmap' and 'QIcon', but they are not work.

    What can I do? I need your help. Thanks.
    Last edited by lovehouye; 12th February 2009 at 04:58. Reason: Resolved

Similar Threads

  1. Replies: 1
    Last Post: 23rd November 2008, 14:11
  2. can Qlabel display a series of image one by one ?
    By jirach_gag in forum Qt Tools
    Replies: 3
    Last Post: 11th August 2008, 15:36
  3. Finding marks on scanned image for alignment
    By caduel in forum Qt Programming
    Replies: 1
    Last Post: 23rd September 2007, 02:10
  4. Replies: 0
    Last Post: 10th November 2006, 13:46
  5. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.