Define a window icon for a QML application
For me it only worked when using a PNG instead of an ICO file. Also you might want to test it with a full path:
app.setWindowIcon(QIcon("C:/path_to_ico/favicon.png"));
Or directly - if it resides in your working dir:
app.setWindowIcon(QIcon("favicon.png"));
As soon as this works you can try to use a relative path or resource access again :-)