Skip to content

Commit

Permalink
Fix setheaderdata! in JuliaItemModel
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Jul 11, 2024
1 parent e5fa1ec commit de00112
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/itemmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,9 @@ function defaultsetheaderdata!(data, row_or_col, orientation, value, role)
return
end

function setheaderdata!(itemmodel::JuliaItemModel, row_or_col, orientation, value, role)
@cxxdereference function setheaderdata!(itemmodel::JuliaItemModel, row_or_col, orientation, value, role)
m = get_julia_data(itemmodel)
m.setheaderdata(m.values[], row_or_col, orientation[], value, role)
m.setheaderdata(m.values[], row_or_col, orientation[], QML.value(value), role)
emit_header_data_changed(itemmodel, orientation[], row_or_col, row_or_col)
end

Expand Down
2 changes: 1 addition & 1 deletion test/containers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ let numbers = [1,2,3,4], model = JuliaItemModel(numbers)
@test QML.setdata!(model, QVariant(5), QML.EditRole, 3, 1)
@test QML.value(QML.data(modeldata, QML.DisplayRole,3,1)) == "5"
@test QML.value(QML.headerdata(modeldata, 2, QML.Vertical, QML.DisplayRole)) == 2
@test_logs (:warn,"Setting header data is not supported in this model") QML.setheaderdata!(model, 1, QML.Vertical, QML.EditRole, "One")
@test_logs (:warn,"Setting header data is not supported in this model") QML.setheaderdata!(model, 1, QML.Vertical, QVariant("One"), QML.EditRole)
end

0 comments on commit de00112

Please sign in to comment.