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. Android camera widget aplication
Forum Updated to NodeBB v4.3 + New Features

Android camera widget aplication

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
13 Posts 4 Posters 1.3k 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.
  • Pablo J. RoginaP Pablo J. Rogina

    @slavisac what if you try the QML camera example?

    S Offline
    S Offline
    slavisac
    wrote on last edited by
    #3

    @Pablo-J.-Rogina how to implement with qt widget app

    jsulmJ J.HilkJ Pablo J. RoginaP 3 Replies Last reply
    0
    • S slavisac

      @Pablo-J.-Rogina how to implement with qt widget app

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #4

      @slavisac https://doc.qt.io/qt-5/qcamera.html

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • jsulmJ jsulm

        @slavisac https://doc.qt.io/qt-5/qcamera.html

        S Offline
        S Offline
        slavisac
        wrote on last edited by
        #5

        @jsulm
        Qcamera viewfinder not working on android

        jsulmJ 1 Reply Last reply
        0
        • S slavisac

          @jsulm
          Qcamera viewfinder not working on android

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #6

          @slavisac Then I guess you can't do it with Qt widgets

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          0
          • S slavisac

            @Pablo-J.-Rogina how to implement with qt widget app

            J.HilkJ Online
            J.HilkJ Online
            J.Hilk
            Moderators
            wrote on last edited by
            #7

            @slavisac

            create a qml file with a Camera component, make sure to give it some object name eg: objectName: "camera"

            Load the qml file via QQuickWidget

            do the following inside your c++ class to get access to the QML Camera component

            ui->quickWidget->setSource(QUrl(QStringLiteral("qrc:/Camera/FrontCam.qml")));
                camera = ui->quickWidget->rootObject()->findChild<QObject*>("camera")->property("mediaObject").value<QCamera*>();
            //camera is a QCamera  pointer
            

            Example taken from one of my projects


            Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


            Q: What's that?
            A: It's blue light.
            Q: What does it do?
            A: It turns blue.

            S 1 Reply Last reply
            1
            • jsulmJ jsulm

              @slavisac Then I guess you can't do it with Qt widgets

              S Offline
              S Offline
              slavisac
              wrote on last edited by
              #8

              @jsulm
              i use jnl code to open camera and see, can shot but could not save photo

              1 Reply Last reply
              0
              • J.HilkJ J.Hilk

                @slavisac

                create a qml file with a Camera component, make sure to give it some object name eg: objectName: "camera"

                Load the qml file via QQuickWidget

                do the following inside your c++ class to get access to the QML Camera component

                ui->quickWidget->setSource(QUrl(QStringLiteral("qrc:/Camera/FrontCam.qml")));
                    camera = ui->quickWidget->rootObject()->findChild<QObject*>("camera")->property("mediaObject").value<QCamera*>();
                //camera is a QCamera  pointer
                

                Example taken from one of my projects

                S Offline
                S Offline
                slavisac
                wrote on last edited by
                #9

                @J.Hilk said in Android camera widget aplication:

                objectName: "camera"

                hi

                i have error :
                C:\Users\cole\Documents\R-Nalog\kamera.cpp:13: error: error: undefined reference to 'QQuickWidget::setSource(QUrl const&)'

                0_1560415629759_problem.png

                J.HilkJ 1 Reply Last reply
                0
                • S slavisac

                  @J.Hilk said in Android camera widget aplication:

                  objectName: "camera"

                  hi

                  i have error :
                  C:\Users\cole\Documents\R-Nalog\kamera.cpp:13: error: error: undefined reference to 'QQuickWidget::setSource(QUrl const&)'

                  0_1560415629759_problem.png

                  J.HilkJ Online
                  J.HilkJ Online
                  J.Hilk
                  Moderators
                  wrote on last edited by
                  #10

                  @slavisac
                  did you add
                  QT += quickwidgets to your project file ?

                  and clean & rerun qmake afterwards?


                  Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                  Q: What's that?
                  A: It's blue light.
                  Q: What does it do?
                  A: It turns blue.

                  S 1 Reply Last reply
                  1
                  • J.HilkJ J.Hilk

                    @slavisac
                    did you add
                    QT += quickwidgets to your project file ?

                    and clean & rerun qmake afterwards?

                    S Offline
                    S Offline
                    slavisac
                    wrote on last edited by
                    #11

                    @J.Hilk
                    now is ok but QQuickWidget dont show on android (no rendering image)
                    Thank you

                    1 Reply Last reply
                    0
                    • S slavisac

                      @Pablo-J.-Rogina how to implement with qt widget app

                      Pablo J. RoginaP Offline
                      Pablo J. RoginaP Offline
                      Pablo J. Rogina
                      wrote on last edited by
                      #12

                      @slavisac said in Android camera widget aplication:

                      qt widget app

                      could you elaborate about this requirement? Why you cannot use QML approach?

                      Upvote the answer(s) that helped you solve the issue
                      Use "Topic Tools" button to mark your post as Solved
                      Add screenshots via postimage.org
                      Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                      S 1 Reply Last reply
                      0
                      • Pablo J. RoginaP Pablo J. Rogina

                        @slavisac said in Android camera widget aplication:

                        qt widget app

                        could you elaborate about this requirement? Why you cannot use QML approach?

                        S Offline
                        S Offline
                        slavisac
                        wrote on last edited by
                        #13

                        @Pablo-J.-Rogina

                        i finished app just need implement camera to take photos

                        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