diff options
Diffstat (limited to 'Swift')
-rw-r--r-- | Swift/QtUI/Trellis/QtDNDTabBar.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Swift/QtUI/Trellis/QtDNDTabBar.cpp b/Swift/QtUI/Trellis/QtDNDTabBar.cpp index 5b042d8..a6806c6 100644 --- a/Swift/QtUI/Trellis/QtDNDTabBar.cpp +++ b/Swift/QtUI/Trellis/QtDNDTabBar.cpp @@ -1,8 +1,8 @@ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2015 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ #include <Swift/QtUI/Trellis/QtDNDTabBar.h> @@ -137,13 +137,16 @@ bool QtDNDTabBar::event(QEvent* event) { dragWidget = dynamic_cast<QTabWidget*>(parent())->widget(dragIndex); assert(dragWidget); dynamic_cast<QTabWidget*>(parent())->removeTab(currentIndex()); Qt::DropAction dropAction = drag->exec(); if (dropAction == Qt::IgnoreAction) { // aborted drag, put tab back in place + // disable event handling during the insert for the tab to prevent infinite recursion (stack overflow) + dragWidget->blockSignals(true); dynamic_cast<QTabWidget*>(parent())->insertTab(dragIndex, dragWidget, dragText); + dragWidget->blockSignals(false); } return true; } } return QTabBar::event(event); } |