adding a getLyricList function to songProxyModel
This commit is contained in:
parent
bac52666c8
commit
a80cad73eb
2 changed files with 7 additions and 0 deletions
|
@ -760,6 +760,12 @@ QModelIndex SongProxyModel::idx(int row) {
|
||||||
return idx;
|
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) {
|
QVariantMap SongProxyModel::getSong(const int &row) {
|
||||||
auto model = qobject_cast<SongSqlModel *>(sourceModel());
|
auto model = qobject_cast<SongSqlModel *>(sourceModel());
|
||||||
QVariantMap song = model->getSong(mapToSource(index(row, 0)).row());
|
QVariantMap song = model->getSong(mapToSource(index(row, 0)).row());
|
||||||
|
|
|
@ -129,6 +129,7 @@ public:
|
||||||
public slots:
|
public slots:
|
||||||
Q_INVOKABLE QVariantMap getSong(const int &row);
|
Q_INVOKABLE QVariantMap getSong(const int &row);
|
||||||
Q_INVOKABLE void deleteSong(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 select(int row);
|
||||||
// Q_INVOKABLE void selectSongs(int row);
|
// Q_INVOKABLE void selectSongs(int row);
|
||||||
// Q_INVOKABLE bool setSelected(const int &row, const bool &select);
|
// Q_INVOKABLE bool setSelected(const int &row, const bool &select);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue