Qt5.2 cannot show the viewfinder on android screen



  • Qt is new to me. I followed their example Camera Example and QML Camera Example to build my own app. I am using pure C++ language instead of QML. The app is able to show the viewfinder on screen in Desktop version but it shows nothings in Android. Everything(OSX, NDK, Android SDK, QT) is in latest version

    @//widget.h
    #ifndef WIDGET_H
    #define WIDGET_H

    #include <QVideoWidget>
    #include <QCamera>
    #include <QCameraViewfinder>

    namespace Ui {
    class Widget;
    }

    class Widget : public QVideoWidget
    {
    Q_OBJECT

    public:
    explicit Widget(QWidget *parent = 0);
    ~Widget();

    private:
    Ui::Widget *ui;
    QCamera *camera;
    };

    #endif // WIDGET_H@

    @//widget.cpp
    #include "widget.h"
    #include "ui_widget.h"

    Widget::Widget(QWidget *parent) :
    QVideoWidget(parent),
    ui(new Ui::Widget)
    {
    ui->setupUi(this);

    camera = new QCamera(this);
    camera->setCaptureMode(QCamera::CaptureStillImage);
    camera->setViewfinder(this);
    camera->start();
    }

    Widget::~Widget()
    {
    delete ui;
    }@

    @//camera.pro
    QT += core gui widgets multimedia multimediawidgets

    TARGET = opencv
    TEMPLATE = app

    SOURCES += main.cpp
    widget.cpp

    HEADERS += widget.h

    FORMS += widget.ui

    CONFIG += mobility console
    MOBILITY = @



  • The Qt Multimedia Widgets module is not supported on Android.

    http://qt-project.org/wiki/Qt_for_Android_known_issues



  • thanks!!! Will it be fixed in 5.3?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.