diff options
author | Thanos Doukoudakis <thanos.doukoudakis@isode.com> | 2017-06-28 15:29:56 (GMT) |
---|---|---|
committer | Tobias Markmann <tm@ayena.de> | 2017-07-06 08:37:24 (GMT) |
commit | ba67437900cfabb1ce9e115c0ec5029c76696b8b (patch) | |
tree | 91a4422c214bb4453f6fdf9e2ea0dbdee031bbde /Swift/QtUI | |
parent | 1f69a24bc609ce40bab2bcb40b29438b63c9bc73 (diff) | |
download | swift-ba67437900cfabb1ce9e115c0ec5029c76696b8b.zip swift-ba67437900cfabb1ce9e115c0ec5029c76696b8b.tar.bz2 |
Fix a crash that occurs when resizing chat layout
This patch fixes a client crash that was caused when the chat layout was
resized to a size that would make some of the chat window out of range.
Test-Information:
Tested on Ubuntu 16.04 LTS (Qt5.5.1) and Windows 10 (Qt5.7.1)
Change-Id: I900c1efcf3c9ae3c416fb4e2d19bd47bf27bbaee
Diffstat (limited to 'Swift/QtUI')
-rw-r--r-- | Swift/QtUI/Trellis/QtDynamicGridLayout.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp b/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp index 5600cc8..b753ffa 100644 --- a/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp +++ b/Swift/QtUI/Trellis/QtDynamicGridLayout.cpp @@ -290,7 +290,12 @@ void QtDynamicGridLayout::setDimensions(const QSize& dim) { while(oldTabWidget->count()) { QIcon icon = oldTabWidget->tabIcon(0); QString text = oldTabWidget->tabText(0); - newTabWidget->addTab(oldTabWidget->widget(0), icon, text); + QWidget* movingTab = oldTabWidget->widget(0); + //If handling was allowed, QtChatTabs::handleWidgetShown() would be triggered when newTabWidget has no tabs. + //That would access indices of the gridLayout_ that are null because they have been migrated to the newLayout. + movingTab->blockSignals(true); + newTabWidget->addTab(movingTab, icon, text); + movingTab->blockSignals(false); } delete oldTabWidget; } |