This commit is contained in:
朱子楚\zhuzi 2023-05-05 22:45:02 +08:00
parent a1c8672a5a
commit cff6aaf6f4

View File

@ -14,7 +14,12 @@ Item {
signal requestPage(int page,int count) signal requestPage(int page,int count)
id:control id:control
implicitHeight: layout_coumns.height + layout_table.height implicitHeight: layout_table.height
QtObject{
id:d
property int coumnsWidth: parent.width
}
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
@ -32,6 +37,13 @@ Item {
onColumnsChanged: { onColumnsChanged: {
model_coumns.clear() model_coumns.clear()
model_coumns.append(columns) model_coumns.append(columns)
var w = 0
for(var i=0;i<model_coumns.count;i++){
var item = model_coumns.get(i)
w=w+item.width
console.debug(item.width)
}
d.coumnsWidth = w
} }
onDataSourceChanged: { onDataSourceChanged: {
@ -39,12 +51,35 @@ Item {
model_data_source.append(dataSource) model_data_source.append(dataSource)
} }
FluRectangle{ Flickable{
id:layout_flickable
height: layout_table.height
anchors{
top: parent.top
left: parent.left
right: parent.right
}
contentWidth: layout_table.width
ScrollBar.horizontal: FluScrollBar {
}
Rectangle{
anchors.fill: layout_table
radius: 5
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
}
ListView{
id:layout_table
height: contentHeight
width: Math.max(layout_flickable.width,d.coumnsWidth)
clip:true
interactive: false
header: FluRectangle{
id:layout_coumns id:layout_coumns
height: control.itemHeight height: control.itemHeight
width: parent.width width: parent.width
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1) color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
radius: [12,12,0,0] radius: [5,5,0,0]
Row{ Row{
id:list_coumns id:list_coumns
@ -77,20 +112,6 @@ Item {
} }
} }
Rectangle{
anchors.fill: layout_table
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
}
ListView{
id:layout_table
anchors{
top: layout_coumns.bottom
left: parent.left
right: parent.right
}
height: contentHeight
clip:true
footer: Item{ footer: Item{
height: 50 height: 50
width: layout_table.width width: layout_table.width
@ -157,6 +178,10 @@ Item {
} }
} }
}
Component{ Component{
id:com_text id:com_text
Item{ Item{