Hi to all,
I built a dialog with designer to create an audiotrack list.
With the dialog the user can add/remove audio tracks. In the dialog there is a QListWidget so the user can see the list of the sounds he added.
I would show an "audio" icon near the name of the audio track but it doesn't work.
I set the viewmode to QListView::IconMode so:

Qt Code:
  1. ui.trackList->setViewMode(QListView::IconMode);
To copy to clipboard, switch view to plain text mode 

but it doesn't work. I only see the name of the tracks and not the icon.
This is the ctor of the dialog:

Qt Code:
  1. TrackListDlg::TrackListDlg(QStringList& trackList_, QString& srcDir_, QWidget *parent)
  2. : QDialog(parent),
  3. m_trackList(trackList_),
  4. m_srcDir(srcDir_)
  5. {
  6. ui.setupUi(this);
  7.  
  8. ui.trackList->setSortingEnabled( true );
  9. ui.trackList->setViewMode(QListView::IconMode); //<-- doesn't work
  10. ui.trackList->setStyleSheet("* { background-color:rgb(199,147,88); padding: 7px ; color:rgb(255,255,255)}");
  11.  
  12. for (int i = 0; i < m_trackList.size(); ++i)
  13. {
  14. QFileInfo fi( m_trackList.at(i) );
  15. ui.trackList->addItem(fi.fileName());
  16. }
  17.  
  18. connect( ui.cancelBtn, SIGNAL( released() ), this, SLOT( slotCancel() ) );
  19. connect( ui.addBtn, SIGNAL( released() ), this, SLOT( slotAdd() ) );
  20. }
To copy to clipboard, switch view to plain text mode 

The audio tracks can only be *.mp3 or *.wav and I think windows should set the right icon for such files or I'm wrong?
Do I have to set the icons manually?

I hope to get help.
Best Regards,
Franco