Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.1.1
-
None
-
qtquickcontrols/stable: 53fa52bb604ab28ee37aba26e155486e94c66dec
Description
The following example shows no tabs in the TabView:
import QtQuick 2.0 import QtQuick.Controls 1.0 Item { TabView { Repeater { id: repeater; Tab { title: "title " + index } } } Timer { interval: 1; running: true; repeat: false; onTriggered: repeater.model = 5 } }
It works fine for a Repeater with a static model, or even a timer interval of 0.
If I understand the implementation correctly, this is due to the Repeater being reparented to the internal tab stack due to the changed default data property on the TabView, while only TabView's children are monitored for new additions. The Repeater however will create new tabs as siblings to itself, ie. already reparented to the tab stack, which the TabView doesn't notice.