Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt5.2 cannot show the viewfinder on android screen
Forum Updated to NodeBB v4.3 + New Features

Qt5.2 cannot show the viewfinder on android screen

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    wood1986
    wrote on 4 May 2014, 05:28 last edited by
    #1

    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 = @

    1 Reply Last reply
    0
    • P Offline
      P Offline
      peterlin82
      wrote on 5 May 2014, 06:30 last edited by
      #2

      The Qt Multimedia Widgets module is not supported on Android.

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

      1 Reply Last reply
      0
      • W Offline
        W Offline
        wood1986
        wrote on 5 May 2014, 16:15 last edited by
        #3

        thanks!!! Will it be fixed in 5.3?

        1 Reply Last reply
        0

        1/3

        4 May 2014, 05:28

        • Login

        • Login or register to search.
        1 out of 3
        • First post
          1/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved