Qt и STL алгоритмы

Если вы счастливый пользователь Qt 5, то спокойно используйте STL алгоритмы с Qt контейнерами.

Historically, Qt used to provide functions which were direct equivalents of many STL algorithmic functions. Starting with Qt 5.0, you are instead encouraged to use directly the implementations available in the STL; most of the Qt ones have been deprecated (although they are still available to keep the old code compiling).

RTFM

А иначе, если у вас тоже Qt 4-ой версии, невинное копирование приводит вас к злобнуму SegFault:

Но, как известно, если очень хочется, то можно: