Results 1 to 2 of 2

Thread: Display a list view with icon, progress bar, text, ...

  1. #1
    Join Date
    May 2019
    Qt products
    MacOS X Unix/X11 Windows

    Default Display a list view with icon, progress bar, text, ...


    i'm using Qt5 (win64) and i want to display a list of files with icon, text, progress bar and button. You can see the wanted result in the bellow joined screenshot. I've seen a lot of post but i still don't know the control i need to use : QListView, QListWidget.

    Tableview item must be updated on real time (progress bar indicator and status text)

    The doc say : Use QListView and subclass QItemDelegate instead.

    I can't find any example. How can I do it ?



  2. #2
    Join Date
    Jan 2006
    Graz, Austria
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Unix/X11 Windows

    Default Re: Display a list view with icon, progress bar, text, ...

    For the widgets I would say a QTreeView with a QTableModel as the data source or a QTreeView.

    Displaying multiple lines of text could potentially be done by having such text as the cell value, but the progressbar will definitely need a custom delegate.

    Your subclass will need to override two methods
    - QStyledItemDelegate::sizeHint()

    - QStyledItemDelegate::paint()

    The first needs to return dimensions large enough to fit the cell's content, e.g. to have enough space for the progressbar and the status underneath.
    The second then gets called whenever a cell needs to be drawn. For example of a progressbar see ViewDelegate::paintProgressBar() of KTorrent's delegate.


Similar Threads

  1. Replies: 1
    Last Post: 24th October 2015, 17:20
  2. Cannot display qsqlquerymodel to a qml list view
    By ironexmaiden in forum Newbie
    Replies: 8
    Last Post: 2nd September 2014, 12:45
  3. Creating a list with icon and text in the center of icon
    By prophet0 in forum Qt Programming
    Replies: 2
    Last Post: 15th December 2011, 04:03
  4. Replies: 3
    Last Post: 10th November 2010, 14:27
  5. Replies: 8
    Last Post: 6th May 2010, 12:17

Tags for this Thread


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.