Ok. I guess this is a problem that people resolve by themselves.
The 'missing link' was actually the paintEvent() function.
The ingredients to make it work.
1. Take the camera files from the camera example.
2. Take the videowidgetsurface files from the videowidget exmaple.
3. In QT Designer, replace the viefinder widget from the camera example with a plain widget. Name it for instance uiWidget.
3. in the constructor of camera add
4. in setCamera() comment out the setViefinder line:
videoSurface = new VideoWidgetSurface(ui->uiWidget);
5. Add instead:
6. Add the paintEvent() function as is to the camera files.
QVideoRendererControl *control = camera->service()->requestControl<QVideoRendererControl *>();
if (control) control->setSurface(videoSurface);
7. in camera.cpp
8. in camera.h:
That should be it more or less.