Use QueryTreeModelBase to access the roles.
This allows to change the number of template arguments for QueryTreeModel without having to touch all these lines again.