Hi,
Actually, ids are unique within a component scope. In most cases, this means "within a file" (since a QML document is a QML type definition which can be instantiated via a component, and thus a given instantiation of the type has its own component scope), but there are some subtleties.
See http://doc-snapshot.qt-project.org/qt5-stable/qtqml-syntax-objectattributes.html#the-id-attribute and http://doc-snapshot.qt-project.org/qt5-stable/qtqml-documents-scope.html for more information. Delegates are interesting, because they implicitly define a component scope.
Cheers,
Chris.