Skip to content

Commit

Permalink
Update file(s): 2024-12-27
Browse files Browse the repository at this point in the history
  • Loading branch information
horsicq committed Dec 26, 2024
1 parent c5a802d commit e55e125
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions AbstractWidgets/xformatwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2242,12 +2242,30 @@ void XFormatWidget::adjustWidgetModeComboBox(QComboBox *pComboBox, XFW_DEF::WIDG

pComboBox->clear();

QList<XFW_DEF::WIDGETMODE> listModes;

listModes.append(XFW_DEF::WIDGETMODE_HEADER);
listModes.append(XFW_DEF::WIDGETMODE_TABLE);
listModes.append(XFW_DEF::WIDGETMODE_HEX);
listModes.append(XFW_DEF::WIDGETMODE_DISASM);

bool bBlockSignals=pComboBox->blockSignals(true);

pComboBox->addItem(widgetModeIdToString(XFW_DEF::WIDGETMODE_HEADER), XFW_DEF::WIDGETMODE_HEADER);
pComboBox->addItem(widgetModeIdToString(XFW_DEF::WIDGETMODE_TABLE), XFW_DEF::WIDGETMODE_TABLE);
pComboBox->addItem(widgetModeIdToString(XFW_DEF::WIDGETMODE_HEX), XFW_DEF::WIDGETMODE_HEX);
pComboBox->addItem(widgetModeIdToString(XFW_DEF::WIDGETMODE_DISASM), XFW_DEF::WIDGETMODE_DISASM);
qint32 nCount = listModes.count();
qint32 nIndex = -1;

for(int i=0;i<nCount;i++)
{
pComboBox->addItem(widgetModeIdToString(listModes.at(i)),listModes.at(i));

if (listModes.at(i) == widgetMode) {
nIndex = i;
}
}

if (nIndex != -1) {
pComboBox->setCurrentIndex(nIndex);
}

pComboBox->blockSignals(bBlockSignals);
}
Expand Down

0 comments on commit e55e125

Please sign in to comment.