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. declarative-camera vs. widget based camera (QML to c++ breakout)
Forum Updated to NodeBB v4.3 + New Features

declarative-camera vs. widget based camera (QML to c++ breakout)

Scheduled Pinned Locked Moved Mobile and Embedded
2 Posts 2 Posters 932 Views 2 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.
  • Flaming MoeF Offline
    Flaming MoeF Offline
    Flaming Moe
    wrote on last edited by Flaming Moe
    #1

    Hello community,

    since i have a Sony smartphone i have the same issue like many other to get the widget based camera example to run. I tried a lot around with permission setting in the manifest, but noting to do.
    Instead the declarative example works fine, So i try to do a QML->C++ breakout like this
    http://doc.qt.io/qt-5/qtqml-cppintegration-interactqmlfromcpp.html
    at the "Invoking QML Methods" headline.
    I allways get a component Error when calling "create".
    Here is the snippt from the constructor (i made a widget project and instanciate the example from the widget, because when i tried that in the original project structure, the programm crashes somehow):

    view.setSource(QUrl("qrc:///declarative-camera.qml"));
    view.resize(800, 480);
    view.setResizeMode(QQuickView::SizeRootObjectToView);
    view.show();
    QQmlEngine engine;
    QQmlComponent component(&engine, "qrc:///declarative-camera.qml");
    if(component.status() == QQmlComponent::Error)qDebug() << "Error";
    if(component.status() == QQmlComponent::Ready)qDebug() << "Ready";
    if(component.status() == QQmlComponent::Null)qDebug() << "Null";
    object = component.create();

    Has someone a hint?
    (except to do the App in QML, i´m not familiar with QML and i have a case where i need a fast solution, even it is not perfect or even good)

    best reg.
    Moe

    A lovely day for a ̶g̶̶u̶̶i̶̶n̶̶n̶̶e̶̶s̶ DUFF^^

    1 Reply Last reply
    0
    • L Offline
      L Offline
      LuGRU
      wrote on last edited by
      #2

      You can try to do bring QML context into WIdget world. To do so use off-screen renderer class and then just retrieve QImage on update and paint it.
      PROS: It will work even with rester widget engine (of course HW OGL support is required but Your app don't need to "use" OGL - it will but window will be not visible)
      CONS: converting FBO to QImage is considered slow operation (said that I can easily achieve smooth playback - depending on Android device CPU and capture resolution - on Camera QML module)

      QCamera is broken, IIRC viewfinder do work - although I don't remember if this was for Android or iOS - probably for iOS. Other modes no.

      1 Reply Last reply
      0

      • Login

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