So I successfully create them, but have trouble deleting them. 
Rectangle {
        property var indicators: []
        function updateIndicators() {
                var i;
                var indicator;

                var component = Qt.createComponent("LastLocationIndicator.qml");
                var last;
                for (i=0; i< control.last.length; i++)
                {
                        last = control.last[i];
                        indicator = component.createObject(control, {model: 
control.source, dotColor: App.colors.orange, centerX: last.x,  centerY: 
last.y});
                        indicator.clicked.connect(indicatorClicked);
                        indicators.push(indicator);
                }
                
                console.log("ADD INDICATORS:",source, indicators.length)
        }
----------------
But then to delete:
        function clearIndicators() {
                console.log("CLEAR INDICATORS:",source, indicators.length)
                for (var i=0; i< indicators.length; i++)
                {
                        var indicator = indicators[i];
                        indicator.destroy();
                        //delete indicators[i];
                }
        }

--------------
However on the indicator.destroy() line I get:
TypeError: Property 'destroy' of object TypeError: Type error is not a function

What am I doing wrong?
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to