I think I found a solution. I roughly quadrupled the QCameraViewfinder size and repositioned it to the middle.
Its all done with "cameraVf->setGeometry(x,y,x,y);". And I parented the viewfinder to a new QFrame
to have a frame and to have the viewfinder not overlaying the start button.
alt text
mainwindow.cpp
...
QFrame *frameVideo = new QFrame(frame4); // extra frame where the video is in
frameVideo->setGeometry(5,35,375,380);
camera = new QCamera("/dev/video0");
cameraVf = new QCameraViewfinder(frameVideo);
camera->setViewfinder(cameraVf);
cameraVf->setGeometry(0,0,375,380);
QCameraViewfinderSettings vfsettings;
vfsettings.setPixelFormat(QVideoFrame::Format_YUV420P);
vfsettings.setResolution(640,480);
camera->setViewfinderSettings(vfsettings);
cameraVf->show();
...
void MainWindow::onZoomClicked(){
if(cameraVf->width() != 1600)
{
cameraVf->setGeometry(-590,-490,1600,1440); // zoom in
}
else
{
cameraVf->setGeometry(0,0,375,380); // zoom out
}
}