From 17c5b2620178ce59d0d85d91c03880fc8b0d9992 Mon Sep 17 00:00:00 2001 From: Carlos Manuel Duclos Vergara Date: Thu, 4 Mar 2010 11:38:48 +0100 Subject: showFullscreen() broken if UnifiedTitleAndToolBarOnMac is enabled The problem here is caused by the fix to QTBUG-6200. For this fix we removed the lines that deleted the item because the iterator might be invalid at that point. However, we still need to delete the iterator. The solution is to not use the iterator and ask the hash to delete the item, since the remove function will not crash if the item is invalid. Task-number: QTBUG-8633 Reviewed-by: Prasanth --- src/gui/widgets/qmainwindowlayout_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/widgets/qmainwindowlayout_mac.mm b/src/gui/widgets/qmainwindowlayout_mac.mm index d92168a..9527057 100644 --- a/src/gui/widgets/qmainwindowlayout_mac.mm +++ b/src/gui/widgets/qmainwindowlayout_mac.mm @@ -463,6 +463,8 @@ void QMainWindowLayout::removeFromMacToolbar(QToolBar *toolbar) NSToolbarItem *item = static_cast(it.key()); [[qt_mac_window_for(layoutState.mainWindow->window()) toolbar] removeItemAtIndex:toolbarItemsCopy.indexOf(item)]; + unifiedToolbarHash.remove(item); + qtoolbarsInUnifiedToolbarList.removeAll(toolbar); #endif break; } -- cgit v0.12