adding a way to get modelIndex from songProxyModel

This commit is contained in:
Chris Cochrun 2023-03-02 05:56:21 -06:00
parent aba253559c
commit 5cc531f046
2 changed files with 14 additions and 0 deletions

View file

@ -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;