I'm setting up a custom widget in a QGIS3 plugin and include a QgsAttributeTableView like this:
layer = iface.activeLayer()
layer.getFeatures()
canvas = iface.mapCanvas()
vector_layer_cache = QgsVectorLayerCache(layer, 10000)
attribute_table_model = QgsAttributeTableModel(vector_layer_cache)
attribute_table_model.loadLayer()
attribute_table_filter_model = QgsAttributeTableFilterModel(canvas, attribute_table_model)
self.attribute_table_view = QgsAttributeTableView()
self.attribute_table_view.setModel(attribute_table_filter_model)
print("GIS-Layer: "+str(layer.allFeatureIds()))
self.layTab.addWidget(self.attribute_table_view)
But no data is shown in the QgsAttributeTableView. The print-output displays the list of all feature-ids of the loaded layer. So I think there are features, but not shown in my QgsAttributeTableView.