File: main.qml

package info (click to toggle)
libqt5qxlsx 1.4.4-1.1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 15,304 kB
  • sloc: cpp: 17,870; ansic: 4,644; python: 15; makefile: 4
file content (51 lines) | stat: -rw-r--r-- 1,175 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// main.qml

import QtQuick 2.9
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Window {
    id : mainWindow;
    visible : true;
    title : qsTr("Hello Android");
    /* width: 640; height: 480; */

    Component
    {
        id : columnComponent;
        TableViewColumn {
            resizable : true;
            movable : false;
            /*width: 100;*/
        }
    }

    TableView
    {
        id : mainTableView;
        anchors.fill : parent;
        model : xlsxModel;

        frameVisible : true;
        highlightOnFocus : true;

        horizontalScrollBarPolicy : Qt.ScrollBarAlwaysOn;
        verticalScrollBarPolicy : Qt.ScrollBarAlwaysOn;

        resources:
        {
            var roleList = xlsxModel.customRoleNames;
            var temp = []; // empty object
            for(var ic = 0 ; ic < roleList.length ; ic++ )
            {
                var role  = roleList[ic];
                var colObj = columnComponent.createObject( mainTableView, { "role": role, "title": role } );
                temp.push(colObj);
            }
            return temp;
        }

    } // TableView

} // Window