From 83565cc7deb823db444ba2e47e33467a0dcbe3f6 Mon Sep 17 00:00:00 2001 From: itsmattkc <34096995+itsmattkc@users.noreply.github.com> Date: Thu, 25 Nov 2021 15:13:56 -0800 Subject: [PATCH] fixed widget bridge issue with comboboxes --- .../nodeparamview/nodeparamviewwidgetbridge.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/widget/nodeparamview/nodeparamviewwidgetbridge.cpp b/app/widget/nodeparamview/nodeparamviewwidgetbridge.cpp index e54350ef4..ca983c581 100644 --- a/app/widget/nodeparamview/nodeparamviewwidgetbridge.cpp +++ b/app/widget/nodeparamview/nodeparamviewwidgetbridge.cpp @@ -520,13 +520,8 @@ void NodeParamViewWidgetBridge::UpdateWidgetValues() QComboBox* cb = static_cast(widgets_.first()); cb->blockSignals(true); int index = input_.GetValueAtTime(node_time).toInt(); - int real_row = -1; for (int i=0; icount(); i++) { - if (!cb->itemText(i).isEmpty()) { - real_row++; - } - - if (real_row == index) { + if (cb->itemData(i).toInt() == index) { cb->setCurrentIndex(i); } } @@ -728,11 +723,14 @@ void NodeParamViewWidgetBridge::PropertyChanged(const QString& input, const QStr cb->clear(); QStringList items = input_.GetComboBoxStrings(); + int index = 0; foreach (const QString& s, items) { if (s.isEmpty()) { cb->insertSeparator(cb->count()); + cb->setItemData(cb->count()-1, -1); } else { - cb->addItem(s); + cb->addItem(s, index); + index++; } }