I've built Qt Mobility 1.0 Beta1 for Qt 4.6.1 on Ubuntu, attached a webcam and showing the camera output in a QVideoWidget works - but only if I don't add it to a stacked widget or set it as the MainWindow's central widget. If I do that, the widget shows up completely black in the MainWindow and when I close the app I get an X Error:

X Error: BadWindow (invalid Window parameter) 3
Major opcode: 2 (X_ChangeWindowAttributes)
Resource id: 0x3600012

The code can be seen below. I've used parts from this example, though it's S60 and thus uses the Symbian window server: http://qt.gitorious.org/qt-mobility/...eracapture.cpp


Code:
    

QByteArray cameraDevice;

    foreach(const QByteArray &deviceName, QCamera::availableDevices()) {
         cameraDevice = deviceName;
    }

    m_camera = new QCamera(cameraDevice);

    connect(m_camera, SIGNAL(error(QCamera::Error)), this, SLOT(cameraError(QCamera::Error)));

    m_viewFinder = new QVideoWidget();
    m_viewFinder->setMediaObject(m_camera);
    ui->stackedWidget->addWidget(m_viewFinder);
    m_viewFinder->show();
    m_camera->setCaptureMode(QCamera::CaptureStillImage);
    m_imageCapture = new QStillImageCapture(m_camera);

    connect(m_imageCapture, SIGNAL(imageCaptured(QString,QImage)), this, SLOT(imageCaptured(QString,QImage)));
    connect(this, SIGNAL(captureImageWithFilename(QString)), m_imageCapture, SLOT(capture(QString)));
    connect(m_imageCapture, SIGNAL(error(QStillImageCapture::Error)), this, SLOT(stillImageError(QStillImageCapture::Error)));

    m_camera->start();
Any idea what could be causing this? I'd like to have the camera output in the main window and not hovering beside it in its own window. I realize I'm out on a limb when I'm using the beta but it's been working well for me so far, apart from this issue.