Replace deprecated toList() with values()
toList() throws a lot of deprecation warnings in the current Qt version and the replacement with values is also present in Qt 5.8.
Qt 5.14 offers range constructors that are preferred but that would require a change of the minimum version