1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-16 04:42:53 +08:00
QXlsx/HelloAndroid/main.qml

52 lines
1.1 KiB
QML
Raw Normal View History

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
import QtQuick.Controls.Styles 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 Android");
2018-07-13 13:56:11 +09:00
/* width: 640; height: 480; */
2018-07-12 18:15:23 +09:00
Component
{
2018-07-13 13:56:11 +09:00
id : columnComponent;
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
frameVisible : true;
highlightOnFocus : true;
horizontalScrollBarPolicy : Qt.ScrollBarAlwaysOn;
verticalScrollBarPolicy : Qt.ScrollBarAlwaysOn;
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