Skip to content

Commit

Permalink
Fix win32 test
Browse files Browse the repository at this point in the history
  • Loading branch information
barche committed Jun 18, 2024
1 parent 609b056 commit 0ae9cd9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
CMakeLists.txt.user
/Manifest.toml
/docs/build
.vscode
1 change: 1 addition & 0 deletions src/itemmodel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Base.:+(a::QML.ItemDataRole, b::Integer) = convert(Int32,a) + b
# Allow roles as keys in Dicts:
Base.trailing_zeros(role::ItemDataRole) = Base.trailing_zeros(convert(Int32,role))
Base.:(>>)(a::ItemDataRole, b::Int64) = convert(Int32, a) >> b
Base.:(>>)(a::ItemDataRole, b::Int32) = convert(Int32, a) >> b
mutable struct ItemModelData{DataT}
values::Observable{DataT}
roles::RoleNames
Expand Down
4 changes: 2 additions & 2 deletions test/containers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ let h = QML.QHash{Int32,QML.QByteArray}()
@test isempty(h)
end

let numbers = Int32[1,2,3,4], model = JuliaItemModel(numbers)
let numbers = [1,2,3,4], model = JuliaItemModel(numbers)
modeldata = QML.get_julia_data(model)
@test QML.rowcount(modeldata) == 4
@test QML.colcount(modeldata) == 1
@test QML.value(QML.data(modeldata, QML.DisplayRole,3,1)) == "3"
@test QML.setdata!(model, QVariant(Int32(5)), QML.EditRole, 3, 1)
@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")
Expand Down

0 comments on commit 0ae9cd9

Please sign in to comment.