1/* 2 * Copyright (C) 2016, 2017 3 * Jean-Luc Barriere <jlbarriere68@gmail.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 3. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program. If not, see <http://www.gnu.org/licenses/>. 16 */ 17 18import QtQuick 2.9 19import QtQuick.Controls 2.2 20 21Row { 22 property alias column: columnComponent.sourceComponent 23 24 spacing: units.gu(2) 25 26 Loader { 27 id: columnComponent 28 anchors { 29 verticalCenter: parent.verticalCenter 30 } 31 width: parent.width - parent.spacing 32 33 onSourceComponentChanged: { 34 for (var i=0; i < item.children.length; i++) { 35 // binds to width so it is updated when screen size changes 36 item.children[i].width = Qt.binding(function () { return width; }) 37 } 38 } 39 } 40} 41 42