This commit is contained in:
朱子楚\zhuzi 2023-06-03 08:27:32 +08:00
parent 5f2f127623
commit 1073efe423
4 changed files with 21 additions and 19 deletions

View File

@ -20,10 +20,12 @@ endif()
file(TO_CMAKE_PATH "/" PATH_SEPARATOR) file(TO_CMAKE_PATH "/" PATH_SEPARATOR)
# #
add_definitions(-DVERSION=1,3,1,0) add_definitions(-DVERSION=1,3,2,0)
find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED) find_package(Qt6 REQUIRED COMPONENTS Quick REQUIRED)
qt_standard_project_setup()
#Cpp #Cpp
file(GLOB_RECURSE CPP_FILES *.cpp *.h) file(GLOB_RECURSE CPP_FILES *.cpp *.h)
foreach(filepath ${CPP_FILES}) foreach(filepath ${CPP_FILES})

View File

@ -13,7 +13,7 @@ endif()
set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI) set(QML_PLUGIN_DIRECTORY ${CMAKE_PREFIX_PATH}/qml/FluentUI)
# #
add_definitions(-DVERSION=1,3,1,0) add_definitions(-DVERSION=1,3,2,0)
find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml ShaderTools) find_package(Qt6 REQUIRED COMPONENTS Core Quick Qml ShaderTools)

View File

@ -896,7 +896,7 @@ Item {
function getItems(){ function getItems(){
return nav_list.model return nav_list.model
} }
function push(url){ function push(url,argument={}){
if (nav_swipe.depth>0) if (nav_swipe.depth>0)
{ {
let page = nav_swipe.find(function(item) { let page = nav_swipe.find(function(item) {
@ -922,7 +922,7 @@ Item {
} }
} }
} }
nav_swipe.push(url,{url:url}) nav_swipe.push(url,Object.assign(argument,{url:url}))
} }
function getCurrentIndex(){ function getCurrentIndex(){
return nav_list.currentIndex return nav_list.currentIndex

View File

@ -17,27 +17,27 @@ Item {
implicitHeight: layout_table.height implicitHeight: layout_table.height
QtObject{ QtObject{
id:d id:d
property int coumnsWidth: parent.width property int columnsWidth: parent.width
} }
MouseArea{ MouseArea{
anchors.fill: parent anchors.fill: parent
preventStealing: true preventStealing: true
} }
ListModel{ ListModel{
id:model_coumns id:model_columns
} }
ListModel{ ListModel{
id:model_data_source id:model_data_source
} }
onColumnsChanged: { onColumnsChanged: {
model_coumns.clear() model_columns.clear()
model_coumns.append(columns) model_columns.append(columns)
var w = 0 var w = 0
for(var i=0;i<model_coumns.count;i++){ for(var i=0;i<model_columns.count;i++){
var item = model_coumns.get(i) var item = model_columns.get(i)
w=w+item.width w=w+item.width
} }
d.coumnsWidth = w d.columnsWidth = w
} }
onDataSourceChanged: { onDataSourceChanged: {
model_data_source.clear() model_data_source.clear()
@ -63,23 +63,23 @@ Item {
ListView{ ListView{
id:layout_table id:layout_table
height: contentHeight height: contentHeight
width: Math.max(layout_flickable.width,d.coumnsWidth) width: Math.max(layout_flickable.width,d.columnsWidth)
clip:true clip:true
interactive: false interactive: false
header: FluRectangle{ header: FluRectangle{
id:layout_coumns id:layout_columns
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: [5,5,0,0] radius: [5,5,0,0]
Row{ Row{
id:list_coumns id:list_columns
spacing: 0 spacing: 0
anchors.fill: parent anchors.fill: parent
Repeater{ Repeater{
model: model_coumns model: model_columns
delegate: Item{ delegate: Item{
height: list_coumns.height height: list_columns.height
width: model.width width: model.width
FluText{ FluText{
text:model.title text:model.title
@ -96,7 +96,7 @@ Item {
height: 40 height: 40
anchors.right: parent.right anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
visible: index !== model_coumns.count-1 visible: index !== model_columns.count-1
} }
} }
} }
@ -226,8 +226,8 @@ Item {
if(!obj) if(!obj)
return return
var data = [] var data = []
for(var i=0;i<model_coumns.count;i++){ for(var i=0;i<model_columns.count;i++){
var item = model_coumns.get(i) var item = model_columns.get(i)
data.push({itemData:obj[item.dataIndex],width:item.width}) data.push({itemData:obj[item.dataIndex],width:item.width})
} }
return data; return data;