Files
qt-creator/src/plugins/qmljseditor/qmljsoutlinetreeview.cpp

31 lines
836 B
C++
Raw Normal View History

#include "qmljsoutlinetreeview.h"
#include "qmloutlinemodel.h"
#include <utils/annotateditemdelegate.h>
namespace QmlJSEditor {
namespace Internal {
QmlJSOutlineTreeView::QmlJSOutlineTreeView(QWidget *parent) :
Utils::NavigationTreeView(parent)
{
// see also CppOutlineTreeView
setFocusPolicy(Qt::NoFocus);
setExpandsOnDoubleClick(false);
setDragEnabled(true);
viewport()->setAcceptDrops(true);
setDropIndicatorShown(true);
setDragDropMode(InternalMove);
setRootIsDecorated(false);
Utils::AnnotatedItemDelegate *itemDelegate = new Utils::AnnotatedItemDelegate(this);
itemDelegate->setDelimiter(QLatin1String(" "));
itemDelegate->setAnnotationRole(QmlOutlineModel::AnnotationRole);
setItemDelegateForColumn(0, itemDelegate);
}
} // namespace Internal
} // namespace QmlJSEditor