From 29d3b9745b4ba57cd79c95a96659f97c85c3b4ee Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 20 Oct 2014 14:01:58 +0200 Subject: Item view: Update item positions when delegate changes In QComboBox, when you set editable to true on the QComboBox, the delegates will change from QComboBoxMenuDelegate to QComboBoxDelegate. In some styles, such as Fusion, the size of the delegates will be different. So when the delegate is updated, we need to redo the list view layout, otherwise the items will be positioned based on the size of the old delegates, but the popup for the combo box will be sized for the new. This caused the popup to be too small for its items and display a scroll bar. [ChangeLog][QComboBox] Fixed positions of items when QComboBox is set as editable in Fusion style. Change-Id: Ia43ef96efbeee4d6d596c0674bf3898ef94f89a1 Task-number: QTBUG-33537 Reviewed-by: Mitch Curtis Reviewed-by: Friedemann Kleint --- src/widgets/itemviews/qabstractitemview.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 88b16db93b..1d8be6398c 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -837,6 +837,7 @@ void QAbstractItemView::setItemDelegate(QAbstractItemDelegate *delegate) } d->itemDelegate = delegate; viewport()->update(); + d->doDelayedItemsLayout(); } /*! -- cgit v1.2.3