Skip to content
Open
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
14 changes: 12 additions & 2 deletions sealtk/noaa/gui/TrackTypeDelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,26 @@ QWidget* TrackTypeDelegate::createEditor(
QWidget* parent, QStyleOptionViewItem const& option,
QModelIndex const& index) const
{
QComboBox* box = new QComboBox{parent};
auto* const box = new QComboBox{parent};
box->setEditable(true);
box->setFocusPolicy(Qt::StrongFocus);
box->setFrame(false);

// Get collection of type names
auto types = QStringList{};
for (auto const& type : kv::detected_object_type::all_class_names())
{
box->addItem(qtString(type));
types.append(qtString(type));
}

// Sort names according to locale
auto compare =
qOverload<QString const&, QString const&>(&QString::localeAwareCompare);
std::sort(types.begin(), types.end(), compare);

// Populate combo box
box->addItems(types);

return box;
}

Expand Down