diff --git a/Gui/CustomerTables.qml b/Gui/CustomerTables.qml index 9e0c015..0312c8d 100644 --- a/Gui/CustomerTables.qml +++ b/Gui/CustomerTables.qml @@ -106,7 +106,7 @@ Item { TableView { - property var customWidths: [0.2, 0.5, 0.3, 05, 0.2, 0.2] + //property var customWidths: [0.2, 0.5, 0.3, 05, 0.2, 0.2] property real newWidth: 0 id: testTable @@ -139,18 +139,19 @@ Item { // return newWidth // } - // Timer - // { - // running: true - // interval: 3000 - // repeat: true - // onTriggered: - // { - // //testTable.columnWidths[2] = 150 - // console.log("Timing..") - // testTable.forceLayout(); - // } - // } + Timer + { + id: redrawTable + running: true + interval: 1 + repeat: false + onTriggered: + { + //testTable.columnWidths[2] = 150 + //console.log("Timing..") + testTable.forceLayout(); + } + } @@ -158,9 +159,11 @@ Item { { required property bool selected required property bool current - implicitWidth: tableColumn.width / testTable.columns - Layout.fillWidth: true + implicitWidth: testTable.width / testTable.columns + //Layout.fillWidth: true implicitHeight: 25 + //border.color: "yellow" + //border.width: 1 //color: selected? "lightblue": palette.base color: selected ? addBusinessBtn.palette.highlight //palette.highlight @@ -170,7 +173,6 @@ Item { Text { - //Layout.fillWidth: true text: model.display elide: Text.ElideRight width: parent.width @@ -202,6 +204,12 @@ Item { } } } + + onContentWidthChanged: + { + //console.log("Model changed!!") + redrawTable.start() + } } diff --git a/lib/DB/BusinessModel.py b/lib/DB/BusinessModel.py index 75340c4..5a52115 100644 --- a/lib/DB/BusinessModel.py +++ b/lib/DB/BusinessModel.py @@ -22,16 +22,6 @@ CUSTOMER_COLUMN_INDEX = \ "gecos": 5 } -CUSTOMER_COLUMN = \ -{ - 0: "userid", - 1: "username", - 2: "password", - 3: "enabled", - 4: "roleid", - 5: "gecos" -} - class BusinessModel(QAbstractTableModel): __visible_index = {} __col_name = ""