From 5c8e23d1db56312836e6c882686cdbc4a72bd5e5 Mon Sep 17 00:00:00 2001 From: "MA-LAPTOP\\apeltauer" Date: Mon, 22 Jun 2020 18:13:11 +0200 Subject: [PATCH] Gui: [skip ci] connect to the tabwidget and check if the task tab was changed --- src/Gui/ComboView.cpp | 6 ++++++ src/Gui/ComboView.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/Gui/ComboView.cpp b/src/Gui/ComboView.cpp index 17c54f7a00..6163581f45 100644 --- a/src/Gui/ComboView.cpp +++ b/src/Gui/ComboView.cpp @@ -62,6 +62,7 @@ ComboView::ComboView(bool showModel, Gui::Document* pcDocument, QWidget *parent) tabs->setTabPosition(QTabWidget::North); pLayout->addWidget( tabs, 0, 0 ); + connect(tabs, SIGNAL(currentChanged(int)), this, SLOT(onCurrentTabChanged(int))); if (showModel) { // splitter between tree and property view QSplitter *splitter = new QSplitter(); @@ -145,5 +146,10 @@ void ComboView::changeEvent(QEvent *e) DockWindow::changeEvent(e); } +void ComboView::onCurrentTabChanged(int index) +{ + if (index != taskIndex) + oldTabIndex = index; +} #include "moc_ComboView.cpp" diff --git a/src/Gui/ComboView.h b/src/Gui/ComboView.h index c9488805f7..e4385fc776 100644 --- a/src/Gui/ComboView.h +++ b/src/Gui/ComboView.h @@ -87,6 +87,9 @@ public: void showTreeView(); void showTaskView(); +private Q_SLOTS: + void onCurrentTabChanged(int index); + protected: void showDialog(Gui::TaskView::TaskDialog *dlg); void closeDialog();