adding a getLyricList function to songProxyModel

This commit is contained in:
Chris Cochrun 2023-02-24 15:02:05 -06:00
parent bac52666c8
commit a80cad73eb
2 changed files with 7 additions and 0 deletions

View file

@ -760,6 +760,12 @@ QModelIndex SongProxyModel::idx(int row) {
return idx;
}
QStringList SongProxyModel::getLyricList(const int &row) {
auto model = qobject_cast<SongSqlModel *>(sourceModel());
QStringList lyrics = model->getLyricList(mapToSource(index(row, 0)).row());
return lyrics;
}
QVariantMap SongProxyModel::getSong(const int &row) {
auto model = qobject_cast<SongSqlModel *>(sourceModel());
QVariantMap song = model->getSong(mapToSource(index(row, 0)).row());

View file

@ -129,6 +129,7 @@ public:
public slots:
Q_INVOKABLE QVariantMap getSong(const int &row);
Q_INVOKABLE void deleteSong(const int &row);
Q_INVOKABLE QStringList getLyricList(const int &row);
// Q_INVOKABLE void select(int row);
// Q_INVOKABLE void selectSongs(int row);
// Q_INVOKABLE bool setSelected(const int &row, const bool &select);