From 6cee54f1b0c4ea45b1befc0868499be0555ae62f Mon Sep 17 00:00:00 2001 From: yangjiaxuan <171295266@qq.com> Date: Tue, 4 Jul 2023 16:37:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=85=8D=E7=BD=AE=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E9=BB=98=E8=AE=A4=E6=96=B0=E5=A2=9E=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E5=90=8E=E4=B8=80=E4=B8=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/twainui/hg_settingdialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/twainui/hg_settingdialog.cpp b/modules/twainui/hg_settingdialog.cpp index 34103712..24550d27 100644 --- a/modules/twainui/hg_settingdialog.cpp +++ b/modules/twainui/hg_settingdialog.cpp @@ -2896,6 +2896,7 @@ void hg_settingdialog::slot_pushButton_scheme_management(void) { int id = 0; QString text(find_current_scheme_menu(&id)); + int index = comb_->count(); if(!text.isEmpty() && id >= 0) { Dialog_Input dlg(this); @@ -2915,7 +2916,7 @@ void hg_settingdialog::slot_pushButton_scheme_management(void) } disconnect(comb_, SIGNAL(currentTextChanged(const QString)), this, SLOT(on_current_scheme_changed())); - comb_->insertItem(id + 1, newCfgName); + comb_->insertItem(index, newCfgName); connect(comb_, SIGNAL(currentTextChanged(const QString)), this, SLOT(on_current_scheme_changed())); gb::sane_config_schm *scheme = cur_scheme_->copy(); @@ -2929,7 +2930,7 @@ void hg_settingdialog::slot_pushButton_scheme_management(void) cur_cfg_->select_scheme(cur_scheme_->get_scheme_name().c_str()); cur_cfg_->save(); disconnect(comb_, SIGNAL(currentTextChanged(const QString)), this, SLOT(on_current_scheme_changed())); - comb_->setCurrentIndex(id + 1); + comb_->setCurrentIndex(index); connect(comb_, SIGNAL(currentTextChanged(const QString)), this, SLOT(on_current_scheme_changed())); changed_count_++;