tb->setContextMenuPolicy(Qt::CustomContextMenu);
connect(tb, SIGNAL(customContextMenuRequested(const QPoint &)),
this, SLOT(showContextMenu(const QPoint &)));
+#if QT_VERSION >= 0x040500
+ connect(tb, SIGNAL(tabCloseRequested(int)),
+ tb, SLOT(on_tabCloseRequested(int)));
+#endif
setUsesScrollButtons(true);
}
: QTabBar(parent)
{
setAcceptDrops(true);
+#if QT_VERSION >= 0x040500
+ setTabsClosable(true);
+#endif
+}
+
+
+void DragTabBar::on_tabCloseRequested(int index)
+{
+ setCurrentIndex(index);
+ lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE));
}