Good catch. But instead of doing strange casts the member type should simply be changed to int. Also applies to the similar errors in companionwindow.cpp, bookpage.cpp and inventorywindow.cpp.