Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Call for Presentations - Qt World Summit

    Qt5.2 cannot show the viewfinder on android screen

    Mobile and Embedded
    2
    3
    1085
    Loading More Posts
    • 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
      wood1986 last edited by

      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 Reply Quote 0
      • P
        peterlin82 last edited by

        The Qt Multimedia Widgets module is not supported on Android.

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

        1 Reply Last reply Reply Quote 0
        • W
          wood1986 last edited by

          thanks!!! Will it be fixed in 5.3?

          1 Reply Last reply Reply Quote 0
          • First post
            Last post