Fix build with Qt 5.6 or lower
qAsConst() is only available since Qt 5.7.0, but the specified minimum
Qt version is 5.2.0.
This partially reverts commit d671f62febfe2bedeae9c427c58a02675dabd9cb
in case of building with a lower Qt version to avoid the usage of
qAsConst() and make it compile.
Differential Revision: https://phabricator.kde.org/D7634