fixing bugs in setting song attributes
This commit is contained in:
parent
13a592be51
commit
8acf57fc2b
2 changed files with 9 additions and 27 deletions
|
@ -10,7 +10,7 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property int songIndex
|
property int songIndex
|
||||||
property var song
|
property var song
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
id: mainLayout
|
id: mainLayout
|
||||||
|
@ -268,10 +268,13 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeSong(index) {
|
function changeSong(index) {
|
||||||
song = songsqlmodel.getSong(index);
|
const s = songsqlmodel.getSong(index);
|
||||||
|
print(s.font);
|
||||||
|
print(s.title);
|
||||||
|
song = s;
|
||||||
songIndex = index;
|
songIndex = index;
|
||||||
|
|
||||||
if (songBackgroundType == "image") {
|
if (song.backgroundType == "image") {
|
||||||
slideEditor.videoBackground = "";
|
slideEditor.videoBackground = "";
|
||||||
slideEditor.imageBackground = song.background;
|
slideEditor.imageBackground = song.background;
|
||||||
} else {
|
} else {
|
||||||
|
@ -319,15 +322,11 @@ Item {
|
||||||
|
|
||||||
|
|
||||||
function updateHorizontalTextAlignment(textAlignment) {
|
function updateHorizontalTextAlignment(textAlignment) {
|
||||||
if (alignmentSetTimer.running)
|
|
||||||
return;
|
|
||||||
changeSlideHAlignment(textAlignment);
|
changeSlideHAlignment(textAlignment);
|
||||||
songsqlmodel.updateHorizontalTextAlignment(songIndex, textAlignment);
|
songsqlmodel.updateHorizontalTextAlignment(songIndex, textAlignment);
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateVerticalTextAlignment(textAlignment) {
|
function updateVerticalTextAlignment(textAlignment) {
|
||||||
if (alignmentSetTimer.running)
|
|
||||||
return;
|
|
||||||
changeSlideVAlignment(textAlignment);
|
changeSlideVAlignment(textAlignment);
|
||||||
songsqlmodel.updateVerticalTextAlignment(songIndex, textAlignment)
|
songsqlmodel.updateVerticalTextAlignment(songIndex, textAlignment)
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,26 +128,9 @@ void SongSqlModel::deleteSong(const int &row) {
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap SongSqlModel::getSong(const int &row) {
|
QVariantMap SongSqlModel::getSong(const int &row) {
|
||||||
// QSqlRecord recordData = record(row);
|
// this whole function returns all data in the song
|
||||||
// if (recordData.isEmpty()) {
|
// regardless of it's length. When new things are added
|
||||||
// qDebug() << "this is not a song";
|
// it will still work without refactoring.
|
||||||
// QVariantList empty;
|
|
||||||
// return empty;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// QVariantList song;
|
|
||||||
// song.append(recordData.value("title"));
|
|
||||||
// song.append(recordData.value("lyrics"));
|
|
||||||
// song.append(recordData.value("author"));
|
|
||||||
// song.append(recordData.value("ccli"));
|
|
||||||
// song.append(recordData.value("audio"));
|
|
||||||
// song.append(recordData.value("vorder"));
|
|
||||||
// song.append(recordData.value("background"));
|
|
||||||
// song.append(recordData.value("backgroundType"));
|
|
||||||
// song.append(recordData.value("horizontalTextAlignment"));
|
|
||||||
|
|
||||||
// return song;
|
|
||||||
|
|
||||||
QVariantMap data;
|
QVariantMap data;
|
||||||
const QModelIndex idx = this->index(row,0);
|
const QModelIndex idx = this->index(row,0);
|
||||||
// qDebug() << idx;
|
// qDebug() << idx;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue