Fix compilation with strict iterators

Setting -DQT_STRICT_ITERATORS allows catching unwanted detaching
when using begin() on Qt container which isn't const.