def _mock_view_index(model, category_idx, child_idx, qtbot):
 view = QTreeView()
 qtbot.add_widget(view)
 view.setModel(model)
 idx = model.indexFromItem(model.item(category_idx).child(child_idx))
 view.setCurrentIndex(idx)
 return view

def _mock_view_index ( model , category_idx , child_idx , qtbot ) : view = QTreeView ( ) qtbot . add_widget ( view ) view . setModel ( model ) idx = model . indexFromItem ( model . item ( category_idx ) . child ( child_idx ) ) view . setCurrentIndex ( idx ) return view
create a tree view from a model and set the current index .