diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 10a0ca089e..76a8858a60 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -1210,6 +1210,7 @@ TabWorkArea::TabWorkArea(QWidget * parent) QObject::connect(this, SIGNAL(currentChanged(int)), this, SLOT(on_currentTabChanged(int))); +#if QT_VERSION < 0x040500 closeBufferButton = new QToolButton(this); closeBufferButton->setPalette(pal); // FIXME: rename the icon to closebuffer.png @@ -1222,6 +1223,7 @@ TabWorkArea::TabWorkArea(QWidget * parent) QObject::connect(closeBufferButton, SIGNAL(clicked()), this, SLOT(closeCurrentBuffer())); setCornerWidget(closeBufferButton, Qt::TopRightCorner); +#endif // setup drag'n'drop QTabBar* tb = new DragTabBar; @@ -1234,6 +1236,10 @@ TabWorkArea::TabWorkArea(QWidget * parent) 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); } @@ -1255,7 +1261,9 @@ void TabWorkArea::showBar(bool show) { tabBar()->setEnabled(show); tabBar()->setVisible(show); +#if QT_VERSION < 0x040500 closeBufferButton->setVisible(show); +#endif } @@ -1642,6 +1650,16 @@ DragTabBar::DragTabBar(QWidget* parent) : 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)); } diff --git a/src/frontends/qt4/GuiWorkArea.h b/src/frontends/qt4/GuiWorkArea.h index e493a8ec33..c74a092302 100644 --- a/src/frontends/qt4/GuiWorkArea.h +++ b/src/frontends/qt4/GuiWorkArea.h @@ -285,8 +285,10 @@ private Q_SLOTS: private: /// int clicked_tab_; +#if QT_VERSION < 0x040500 /// QToolButton * closeBufferButton; +#endif }; // TabWorkArea @@ -321,6 +323,10 @@ private: Q_SIGNALS: /// void tabMoveRequested(int fromIndex, int toIndex); + +private Q_SLOTS: + /// + void on_tabCloseRequested(int index); }; } // namespace frontend diff --git a/status.16x b/status.16x index 4144db5442..fcfaf1f8ca 100644 --- a/status.16x +++ b/status.16x @@ -112,6 +112,8 @@ What's new - Support the optional argument of \chapter* in the memoir class. +- Move the buffer-close button into each tabbar for Qt 4.5 (bug 3724). + * WINDOWS INSTALLER