def get_modeltree(model=None): """Alias to :func:`get_tree`.""" if model is None: model = mx.cur_model() treemodel = ModelTreeModel(model._baseattrs) view = QTreeView() view.setModel(treemodel) view.setWindowTitle("Model %s" % model.name) view.setAlternatingRowColors(True) return view
def get_tree(model=None): """Get QTreeView object containing the model tree. Args: model: :class:`Model <modelx.core.model.Model>` object. Defaults to the current model. """ if model is None: model = mx.cur_model() treemodel = ModelTreeModel(model._baseattrs) view = QTreeView() view.setModel(treemodel) view.setWindowTitle("Model %s" % model.name) view.setAlternatingRowColors(True) return view