icon.name works in Qt5 too; no need to conditionalize this by Qt version, which slightly simplifies the code.
Tested the Qt5 and Qt6 builds of the app with this change; all icons show up as expected.
@alex @sitter @mart