From 4e2e4984328bea357ade253b4c28c7783e270bc1 Mon Sep 17 00:00:00 2001 From: Robert Colton Date: Wed, 2 Sep 2020 11:45:41 -0400 Subject: [PATCH] Header Data Oopsie (#181) 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. --- Models/RepeatedModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Models/RepeatedModel.h b/Models/RepeatedModel.h index 1b820ead3..21b9fc551 100644 --- a/Models/RepeatedModel.h +++ b/Models/RepeatedModel.h @@ -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()); }