m_ui.editorList->setTextElideMode(Qt::ElideMiddle);
m_ui.editorList->installEventFilter(this);
m_ui.editorList->setFrameStyle(QFrame::NoFrame);
+ m_ui.editorList->setAttribute(Qt::WA_MacShowFocusRect, false);
EditorManager *em = EditorManager::instance();
- foreach (IEditor *editor, em->openedEditors()) {
- registerEditor(editor);
- }
- connect(em, SIGNAL(editorOpened(Core::IEditor*)),
- this, SLOT(registerEditor(Core::IEditor*)));
- connect(em, SIGNAL(editorsClosed(QList<Core::IEditor*>)),
- this, SLOT(unregisterEditors(QList<Core::IEditor*>)));
- connect(em, SIGNAL(editorGroupsChanged()),
- this, SLOT(updateEditorList()));
+ m_ui.editorList->setModel(em->openedEditorsModel());
connect(em, SIGNAL(currentEditorChanged(Core::IEditor*)),
- this, SLOT(updateCurrentItem()));
- connect(m_ui.editorList, SIGNAL(itemActivated(QTreeWidgetItem*, int)),
- this, SLOT(selectEditor(QTreeWidgetItem*)));
- updateEditorList();
+ this, SLOT(updateCurrentItem(Core::IEditor*)));
+ connect(m_ui.editorList, SIGNAL(activated(QModelIndex)),
+ this, SLOT(selectEditor(QModelIndex)));
}
OpenEditorsWidget::~OpenEditorsWidget()