From e6037286d7a04fbb9b038374d18308613d89c89c Mon Sep 17 00:00:00 2001 From: Tobias Markmann Date: Tue, 31 Mar 2015 11:57:11 +0200 Subject: Disable signals when adding a tab to the trellis layout Due ot the way Qt implements widgets and the events, the windowOpening signal of a QtTabbable is emitted before the QtTabbable is a member of a QTabWidget when adding a QtTabbable to a QTabWidget. Disabling the signals when adding the widget will prevent these signals to be called and will prevent and endlress recursion. This has originally been reported by Pavol Babincak. Test-Information: Without this patch the reporter had Swift crash after a day or two. With this patch the reporter does not experience the endless recursion (crash) anymore. Change-Id: I8b3d791d79e9ab8f42dd1a1cba30d118f620f15d diff --git a/Swift/QtUI/QtChatTabs.cpp b/Swift/QtUI/QtChatTabs.cpp index e869028..5aca804 100644 --- a/Swift/QtUI/QtChatTabs.cpp +++ b/Swift/QtUI/QtChatTabs.cpp @@ -169,7 +169,9 @@ void QtChatTabs::handleWidgetShown() { handleTabTitleUpdated(widget); return; } + widget->blockSignals(true); addTab(widget); + widget->blockSignals(false); show(); } -- cgit v0.10.2-6-g49f6