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
Code:
videoSurface = new VideoWidgetSurface(ui->uiWidget);
4. in setCamera() comment out the setViefinder line:
Code:
//camera->setViewfinder(ui->viewfinder);
5. Add instead:
Code:
QVideoRendererControl *control = camera->service()->requestControl<QVideoRendererControl *>();
if (control) control->setSurface(videoSurface);
6. Add the paintEvent() function as is to the camera files.
7. in camera.cpp
Code:
#include <QVideoRendererControl.h>
8. in camera.h:
Code:
#include "videowidgetsurface.h"
That should be it more or less.
Good luck.