Forráskód Böngészése

LibGUI: Fix bogus root index column_count() in FilteringProxyModel

The root index (ModelIndex()) should should have the same column count
as the root index in the underlying model.
Andreas Kling 3 éve
szülő
commit
e12d2f9a04
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      Userland/Libraries/LibGUI/FilteringProxyModel.cpp

+ 1 - 1
Userland/Libraries/LibGUI/FilteringProxyModel.cpp

@@ -25,7 +25,7 @@ int FilteringProxyModel::row_count(ModelIndex const&) const
 int FilteringProxyModel::column_count(ModelIndex const& index) const
 {
     if (!index.is_valid())
-        return {};
+        return m_model->column_count({});
 
     if ((size_t)index.row() > m_matching_indices.size() || index.row() < 0)
         return 0;