making songeditor funcitonal but not yet
This commit is contained in:
parent
d5515d4c52
commit
f755190e40
6 changed files with 39 additions and 16 deletions
|
@ -7,6 +7,10 @@
|
|||
#include <QSqlQuery>
|
||||
#include <QSql>
|
||||
#include <QSqlDatabase>
|
||||
#include <qabstractitemmodel.h>
|
||||
#include <qdebug.h>
|
||||
#include <qobjectdefs.h>
|
||||
#include <qsqlrecord.h>
|
||||
|
||||
static const char *songsTableName = "songs";
|
||||
|
||||
|
@ -110,6 +114,18 @@ void SongSqlModel::setLyrics(const QString &lyrics) {
|
|||
emit lyricsChanged();
|
||||
}
|
||||
|
||||
void SongSqlModel::setLyrics(const int &row, const QString &lyrics) {
|
||||
qDebug() << "Row is " << row;
|
||||
QSqlRecord rowdata = record(row);
|
||||
rowdata.setValue("lyrics", lyrics);
|
||||
setRecord(row, rowdata);
|
||||
submitAll();
|
||||
|
||||
select();
|
||||
emit lyricsChanged();
|
||||
|
||||
}
|
||||
|
||||
QString SongSqlModel::ccli() const {
|
||||
return m_ccli;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue