adding a way to get modelIndex from songProxyModel
This commit is contained in:
parent
aba253559c
commit
5cc531f046
2 changed files with 14 additions and 0 deletions
|
@ -710,6 +710,13 @@ void SongSqlModel::updateFontSize(const int &row, const int &fontSize) {
|
|||
submitAll();
|
||||
emit fontSizeChanged();
|
||||
}
|
||||
|
||||
QModelIndex SongSqlModel::idx(int row) {
|
||||
QModelIndex idx = index(row, 0);
|
||||
// qDebug() << idx;
|
||||
return idx;
|
||||
}
|
||||
|
||||
// SongProxyModel
|
||||
|
||||
SongProxyModel::SongProxyModel(QObject *parent)
|
||||
|
@ -734,6 +741,11 @@ QModelIndex SongProxyModel::idx(int row) {
|
|||
return idx;
|
||||
}
|
||||
|
||||
QModelIndex SongProxyModel::modelIndex(int row) {
|
||||
QModelIndex idx = m_songModel->idx(mapToSource(index(row, 0)).row());
|
||||
return idx;
|
||||
}
|
||||
|
||||
QStringList SongProxyModel::getLyricList(const int &row) {
|
||||
QStringList lyrics = m_songModel->getLyricList(mapToSource(index(row, 0)).row());
|
||||
return lyrics;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue