This is how exactly Raster --> Extraction --> Clipper...
works. You can also use Clip raster by mask layer
from processing toolbox. Both running gdalwarp
command.
As mask layer you have to choose vector layer, the raster will by clipped to vector layer extent rectangle, but all values outside of shape will be nodata
if you leave the no data value option unchecked, it will remain 0
(intiger).
If you want to crop the extent to the shape check Crop the extent of the target dataset to the extent of the cutline
option.
update:
I thing there isn't build-in tool for clip raster and vector layer at once. But it can be easily created with graphical modeler or python custom processing tool. Create model with Clip raster by mask layer
for raster and Clip vectors by polygon
for vector. The model should looks like:
Once you have working model saved, you can run it as a batch process for as many different raster and vector inputs you want.
For creating models and batch processing see QGIS documentation:
The batch processing interface