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-12 18:15:23 +09:00
|
|
|
id: mainWindow;
|
|
|
|
|
|
|
|
visible: true;
|
|
|
|
|
|
|
|
width: 640; height: 480;
|
|
|
|
|
|
|
|
title: qsTr("Hello World");
|
|
|
|
|
|
|
|
Component
|
|
|
|
{
|
|
|
|
id: columnComponent
|
|
|
|
|
2018-07-13 09:17:28 +09:00
|
|
|
TableViewColumn { width: 100; }
|
2018-07-12 18:15:23 +09:00
|
|
|
}
|
|
|
|
|
|
|
|
TableView {
|
|
|
|
id: mainTableView;
|
|
|
|
|
|
|
|
anchors.fill: parent;
|
|
|
|
|
|
|
|
model: xlsxModel;
|
|
|
|
|
|
|
|
resources:
|
|
|
|
{
|
|
|
|
var roleList = xlsxModel.customRoleNames;
|
|
|
|
var temp = [];
|
|
|
|
for(var i=0; i<roleList.length; i++)
|
|
|
|
{
|
|
|
|
var role = roleList[i];
|
|
|
|
temp.push(columnComponent.createObject(mainTableView, { "role": role, "title": role}));
|
|
|
|
}
|
|
|
|
return temp;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // TableView
|
|
|
|
|
|
|
|
} // Window
|