connect(selectionGroupModel,\
this,\
connect(selectionGroupModel,\
SIGNAL(currentRowChanged( const QModelIndex & , const QModelIndex & )),\
this,\
SLOT(selectionChanged( const QModelIndex & , const QModelIndex & )));
To copy to clipboard, switch view to plain text mode
{
qDebug()<<"selectionChanged";
// qDebug()<<"select change!"<<index.data().toString();
if ( current.data().toString() != "all music" ){
musicSettings4a6ConfigFile->beginGroup("GroupList");
qDebug()<<"current.data().toString()"<<current.data().toString();
musicNames = musicSettings4a6ConfigFile->value( current.data().toString() ).toString();
qDebug()<<"musicNames"<<musicNames;
musicList
= musicNames.
split(";",
QString::SkipEmptyParts);
musicList.removeDuplicates();
musicSettings4a6ConfigFile->endGroup();
mp3ListModel->setStringList(musicList);
ui->listView->setModel(mp3ListModel);
ui->listView->selectAll();
}else{
mp3ListInit();
ui->listView->selectAll();
}
}
void MusicSettingsWidget::selectionChanged( const QModelIndex & current, const QModelIndex & previous )
{
qDebug()<<"selectionChanged";
// qDebug()<<"select change!"<<index.data().toString();
if ( current.data().toString() != "all music" ){
musicSettings4a6ConfigFile->beginGroup("GroupList");
QStringList musicList;
qDebug()<<"current.data().toString()"<<current.data().toString();
QString musicNames;
musicNames = musicSettings4a6ConfigFile->value( current.data().toString() ).toString();
qDebug()<<"musicNames"<<musicNames;
musicList = musicNames.split(";",QString::SkipEmptyParts);
musicList.removeDuplicates();
musicSettings4a6ConfigFile->endGroup();
mp3ListModel->setStringList(musicList);
ui->listView->setModel(mp3ListModel);
ui->listView->selectAll();
}else{
mp3ListInit();
ui->listView->selectAll();
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks