Use the optimised name_list also for the Qt UI.

Use the same optimised algorithm of name_list also in the Qt UI.