i created QListView to show my model content like this.
Play
::Play( QWidget *parent, Qt
::WFlags f
){
QContentSet contentset;
contentset.addCriteria(QContentFilter::MimeType, "audio/*", QContentFilter::Or);
QContentSetModel model( &contentset );
listView->setModel( &model );
vboxLayout->addWidget(listView);
this->setLayout(vboxLayout);
this->show();
}
Play::Play( QWidget *parent, Qt::WFlags f )
: QWidget( parent, f )
{
QContentSet contentset;
contentset.addCriteria(QContentFilter::MimeType, "audio/*", QContentFilter::Or);
QContentSetModel model( &contentset );
listView= new QListView(this);
listView->setModel( &model );
vboxLayout = new QVBoxLayout(this);
vboxLayout->addWidget(listView);
this->setLayout(vboxLayout);
this->show();
}
To copy to clipboard, switch view to plain text mode
i added some other components in the vboxLayout.
but the list is not showing any content, even model(QContentSetModel) had content.
Bookmarks