2018-07-06 17:50:49 +09:00
|
|
|
// main.qml
|
|
|
|
|
2018-07-06 16:10:36 +09:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Window 2.2
|
2018-07-12 18:15:23 +09:00
|
|
|
import QtQuick.Controls 1.4
|
2018-07-06 16:10:36 +09:00
|
|
|
|
|
|
|
Window {
|
2018-07-13 13:56:11 +09:00
|
|
|
id : mainWindow;
|
|
|
|
visible : true;
|
|
|
|
title : qsTr("Hello World");
|
|
|
|
/* width: 640; height: 480; */
|
2018-07-12 18:15:23 +09:00
|
|
|
|
|
|
|
Component
|
|
|
|
{
|
2018-07-13 13:56:11 +09:00
|
|
|
id : columnComponent;
|
2018-07-13 09:35:21 +09:00
|
|
|
TableViewColumn { resizable : true; movable : false; /*width: 100;*/ }
|
2018-07-12 18:15:23 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
TableView {
|
2018-07-13 13:56:11 +09:00
|
|
|
id : mainTableView;
|
|
|
|
anchors.fill : parent;
|
|
|
|
model : xlsxModel;
|
2018-07-12 18:15:23 +09:00
|
|
|
|
|
|
|
resources:
|
|
|
|
{
|
|
|
|
var roleList = xlsxModel.customRoleNames;
|
2018-07-13 13:56:11 +09:00
|
|
|
var temp = []; // empty object
|
2018-07-13 09:35:21 +09:00
|
|
|
for(var ic = 0 ; ic < roleList.length ; ic++ )
|
2018-07-12 18:15:23 +09:00
|
|
|
{
|
2018-07-13 09:35:21 +09:00
|
|
|
var role = roleList[ic];
|
|
|
|
var colObj = columnComponent.createObject( mainTableView, { "role": role, "title": role } );
|
|
|
|
temp.push(colObj);
|
2018-07-12 18:15:23 +09:00
|
|
|
}
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // TableView
|
|
|
|
|
|
|
|
} // Window
|