Skip to content
Permalink
Browse files
Use Item for column header instead of Layer
  • Loading branch information
nyalldawson committed Jul 15, 2021
1 parent 96be786 commit d34b9cabbfe783313544d51dccc3b94aeb8acec0
@@ -301,7 +301,7 @@ QVariant QgsProviderSublayerModel::headerData( int section, Qt::Orientation orie
switch ( static_cast< Column>( section ) )
{
case QgsProviderSublayerModel::Column::Name:
return tr( "Layer" );
return tr( "Item" );
case QgsProviderSublayerModel::Column::Description:
return tr( "Description" );
}
@@ -36,8 +36,8 @@ def test_model(self):
model = QgsProviderSublayerModel()
self.assertEqual(model.rowCount(QModelIndex()), 0)
self.assertEqual(model.columnCount(QModelIndex()), 2)
self.assertEqual(model.headerData(0, Qt.Horizontal, Qt.DisplayRole), 'Layer')
self.assertEqual(model.headerData(0, Qt.Horizontal, Qt.ToolTipRole), 'Layer')
self.assertEqual(model.headerData(0, Qt.Horizontal, Qt.DisplayRole), 'Item')
self.assertEqual(model.headerData(0, Qt.Horizontal, Qt.ToolTipRole), 'Item')
self.assertEqual(model.headerData(1, Qt.Horizontal, Qt.DisplayRole), 'Description')
self.assertEqual(model.headerData(1, Qt.Horizontal, Qt.ToolTipRole), 'Description')

@@ -202,8 +202,8 @@ def test_model_with_non_layer_items(self):
model = QgsProviderSublayerModel()
self.assertEqual(model.rowCount(QModelIndex()), 0)
self.assertEqual(model.columnCount(QModelIndex()), 2)
self.assertEqual(model.headerData(0, Qt.Horizontal, Qt.DisplayRole), 'Layer')
self.assertEqual(model.headerData(0, Qt.Horizontal, Qt.ToolTipRole), 'Layer')
self.assertEqual(model.headerData(0, Qt.Horizontal, Qt.DisplayRole), 'Item')
self.assertEqual(model.headerData(0, Qt.Horizontal, Qt.ToolTipRole), 'Item')
self.assertEqual(model.headerData(1, Qt.Horizontal, Qt.DisplayRole), 'Description')
self.assertEqual(model.headerData(1, Qt.Horizontal, Qt.ToolTipRole), 'Description')

@@ -309,8 +309,8 @@ def test_proxy(self):
proxy.setSourceModel(model)
self.assertEqual(model.rowCount(QModelIndex()), 0)
self.assertEqual(proxy.columnCount(QModelIndex()), 2)
self.assertEqual(proxy.headerData(0, Qt.Horizontal, Qt.DisplayRole), 'Layer')
self.assertEqual(proxy.headerData(0, Qt.Horizontal, Qt.ToolTipRole), 'Layer')
self.assertEqual(proxy.headerData(0, Qt.Horizontal, Qt.DisplayRole), 'Item')
self.assertEqual(proxy.headerData(0, Qt.Horizontal, Qt.ToolTipRole), 'Item')
self.assertEqual(proxy.headerData(1, Qt.Horizontal, Qt.DisplayRole), 'Description')
self.assertEqual(proxy.headerData(1, Qt.Horizontal, Qt.ToolTipRole), 'Description')

0 comments on commit d34b9ca

Please sign in to comment.