Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] Uppon including QCamera i have "mediacontrol.h: No such file or directory" error.
Forum Updated to NodeBB v4.3 + New Features

[SOLVED] Uppon including QCamera i have "mediacontrol.h: No such file or directory" error.

Scheduled Pinned Locked Moved General and Desktop
6 Posts 3 Posters 7.8k 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.
  • L Offline
    L Offline
    Leon
    wrote on last edited by
    #1

    I am on ubuntu 13.04
    with qt 5.

    i have run the command
    @sudo apt-get install qtmobility-dev@

    and my mainwindow.cpp
    @#include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include "QtMultimediaKit/QCamera"
    #include "QtMultimediaKit/QCameraViewfinder"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    camera = new QCamera;
    viewfinder = new QCameraViewfinder;
    camera->setViewfinder(viewfinder);
    viewfinder->show();

    camera->start(); // to start the viewfinder
    

    }

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

    What am i doing wrong?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Aren't you mixing Qt 4 and Qt 5 libraries here ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        alexisdm
        wrote on last edited by
        #3

        Try the package qtmultimedia5-dev instead.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Leon
          wrote on last edited by
          #4

          [quote author="alexisdm" date="1370035042"]Try the package qtmultimedia5-dev instead.[/quote]

          done that,

          @QtMultimedia/QCameraViewfinder: No such file or directory@

          and the code i have added before is taken from here
          http://qt-project.org/doc/qt-5.0/qtmultimedia/cameraoverview.html

          1 Reply Last reply
          0
          • A Offline
            A Offline
            alexisdm
            wrote on last edited by
            #5

            The files to include to get those classes are "QtMultimediaWidgets/QCameraViewfinder" and "QtMultimedia/QCamera".

            And in case you haven't done so yet, if your are using qmake, you need to add @QT += multimedia multimediawidgets@ in the .pro file.

            1 Reply Last reply
            0
            • L Offline
              L Offline
              Leon
              wrote on last edited by
              #6

              [quote author="alexisdm" date="1370040344"]The files to include to get those classes are "QtMultimediaWidgets/QCameraViewfinder" and "QtMultimedia/QCamera".

              And in case you haven't done so yet, if your are using qmake, you need to add @QT += multimedia multimediawidgets@ in the .pro file.[/quote]

              Thank you :)

              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