Skip to content

Commit

Permalink
Header Data Oopsie (#181)
Browse files Browse the repository at this point in the history
If the section or role is not supported, return an invalid QVariant, not an invalid QModelIndex. This fixes all of the headers across all of the editor views and makes them visible again.
  • Loading branch information
RobertBColton authored Sep 2, 2020
1 parent 97df14f commit 4e2e498
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Models/RepeatedModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class RepeatedModel : public ProtoModel {
auto data = ProtoModel::headerData(section, orientation, role);
if (data.isValid()) return data;
if (section <= 0 || role != Qt::DisplayRole || orientation != Qt::Orientation::Horizontal)
return QModelIndex();
return QVariant(); // << invalid
return QString::fromStdString(_field->message_type()->field(section - 1)->name());
}

Expand Down

0 comments on commit 4e2e498

Please sign in to comment.