some changes

This commit is contained in:
Dorian Zedler 2019-03-23 09:36:50 +01:00
parent 11d0f5a06c
commit 5c4cc9aedb
4 changed files with 47 additions and 7 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.pro.user

View file

@ -30,10 +30,10 @@ signals:
void themeChanged(); void themeChanged();
public slots: public slots:
Q_INVOKABLE QString read(const QString &key); Q_INVOKABLE QString read(QString key);
// function to read values from the settings file // function to read values from the settings file
Q_INVOKABLE void write(const QString &key, const QVariant &value); Q_INVOKABLE void write(QString key, QVariant value);
// function to write values to the settings file // function to write values to the settings file
Q_INVOKABLE void setDefault(const QString &key, const QVariant &defaultValue); Q_INVOKABLE void setDefault(const QString &key, const QVariant &defaultValue);

View file

@ -31,13 +31,52 @@ Popup {
topMargin: -topImg.anchors.bottomMargin topMargin: -topImg.anchors.bottomMargin
} }
Column { ListView {
anchors.fill: parent anchors.fill: parent
ShopDelegate { model: ListModel {
ListElement {
iconSource: "qrc:/icons/cookie.png"
costIconSource: "qrc:/icons/cookie.png"
title: "Titel"
cost: "10"
levelLabel: "Level:"
level: "10"
useLabel: "Cps:"
use: "+10"
}
ListElement {
iconSource: "qrc:/icons/cookie.png"
costIconSource: "qrc:/icons/cookie.png"
title: "Titel2"
cost: "100"
levelLabel: "Level:"
level: "10"
useLabel: "Cps:"
use: "+10"
}
ListElement {
iconSource: "qrc:/icons/cookie.png"
costIconSource: "qrc:/icons/cookie.png"
title: "Titel3"
cost: "1000"
levelLabel: "Level:"
level: "10"
useLabel: "Cps:"
use: "+10"
}
} }
delegate: ShopDelegate {
iconSource: model.iconSource
costIconSource: model.costIconSource
title: model.title
cost: model.cost
levelLabel: model.levelLabel
level: model.level
useLabel: model.useLabel
use: model.use
}
} }
} }
} }

View file

@ -20,7 +20,7 @@ AppSettings::AppSettings(QObject* parent)
this->themeSettingsManager = new QSettings(":/themes/" + this->read("theme") + ".ini", QSettings::IniFormat); this->themeSettingsManager = new QSettings(":/themes/" + this->read("theme") + ".ini", QSettings::IniFormat);
} }
QString AppSettings::read(const QString &key) QString AppSettings::read(QString key)
{ {
// function to read values from the settings file // function to read values from the settings file
@ -34,7 +34,7 @@ QString AppSettings::read(const QString &key)
return(value); return(value);
} }
void AppSettings::write(const QString &key, const QVariant &value) void AppSettings::write(QString key, QVariant value)
{ {
// function to write values to the settings file // function to write values to the settings file