Drop one usage of QSet::fromList(), and use QList::removeDuplicates()
instead, assuming the conversion for QList to QSet was to remove
duplicates.
Return early if nameValue is empty, this also guards against accesing
an out of bounds index.
Use QList::at() instead of [], to prevent detaching.