Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/assets/resource/panel_settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@
{
"key": "picformat",
"name": "Photo:",
"type":"formatLabel",
"default": " JPG"
"type":"combobox",
"default": 0
},
{
"key": "vidformat",
Expand Down
4 changes: 2 additions & 2 deletions src/assets/resource/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@
{
"key": "picformat",
"name": "Photo:",
"type":"formatLabel",
"default": " JPG"
"type":"combobox",
"default": 0
},
{
"key": "vidformat",
Expand Down
12 changes: 12 additions & 0 deletions src/src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ void Settings::init()
}
m_settings->option("outsetting.outformat.vidformat")->setData("items", videoFormatList);

QStringList photoFormatList;
photoFormatList << tr("JPG") << tr("PNG");
m_settings->option("outsetting.outformat.picformat")->setData("items", photoFormatList);

m_settings->setBackend(m_backend);

connect(m_settings, &DSettings::valueChanged, this, &Settings::onValueChanged);
Expand Down Expand Up @@ -269,6 +273,14 @@ void Settings::onValueChanged(const QString & key, const QVariant & value)
emit videoFormatChanged(videoFormat);
}
}

if (key.startsWith("outsetting.outformat.picformat")) {
QPointer<DSettingsOption> formatOpt = m_settings->option("outsetting.outformat.picformat");
if (value >= 0 && formatOpt->data("items").toStringList().size() > value.toInt()) {
QString photoFormat = formatOpt->data("items").toStringList()[value.toInt()];
emit photoFormatChanged(photoFormat);
}
}
}

Settings::~Settings()
Expand Down
6 changes: 6 additions & 0 deletions src/src/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@ public slots:
*/
void videoFormatChanged(QString format);

/**
* @brief photoFormatChanged 拍照照片格式
* @param format 照片格式
*/
void photoFormatChanged(QString format);

private:
Settings();
static Settings m_instance;
Expand Down
Loading