Select the holes in a vector shapefile in QGIS
If you dont mind a two step process:
- Run "Delete Holes" from processing toolbox on your "PolygonWithHoles"
- Run "Difference" and use your "Cleaned" (Result from Delete Holes) as Input and your "PolygonWithHoles" as Overlay:
If you wish a one-step solution, you could also use "Geometry by Expression" with this expression:
or a "virtual layer" with this query:
select difference(make_polygon(exterior_ring(geometry)),geometry) from PolygonWithHoles
Both will return a multipolygon of the holes.