2 * Copyright (C) 2014 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 //! \brief This component loads the widgets based on type.
24 //! The ScopeStyle component.
25 property var scopeStyle: null
27 //! Variable used to contain widget's data
28 property var widgetData: null
30 //! Triggered signal forwarded from the widgets.
31 signal updated(var value)
36 property url widgetSource: {
37 switch (widgetData.type) {
38 case "boolean": return "ScopeSettingBoolean.qml";
39 case "list": return "ScopeSettingList.qml";
40 case "number": return "ScopeSettingNumber.qml";
41 case "string": return "ScopeSettingString.qml";
48 if (item.hasOwnProperty("initialValue")) item.initialValue = root.widgetData.value;
49 item.widgetData = Qt.binding(function() { return root.widgetData; } )
50 item.scopeStyle = Qt.binding(function() { return root.scopeStyle; } )
55 onUpdated: if (value !== widgetData.value) root.updated(value)