title: How to respond to the photoSaved signal in Blackberry Cascades
body: <p>Ok, so I am using Blackberry 10 Cascades (QT, QML, C++), and I am trying to process photos that get taken by the camera.  I have been looking into how to do this on the internet, and figured out some things, but it's not working yet.  Here's what I have done (I have made a point to highlight the most relevant parts of the code with //---------------RELEVANT LINE(S) OF CODE--------------------------------- to begin and
  //------------------------------------------------------------------------ to end the relevant sections.</p>
  
  <p>//Camera.h</p>
  
  <pre><code>#ifndef CAMERA_H_
  #define CAMERA_H_
  
  #include &lt;QObject&gt;
  #include &lt;Page.h&gt;
  
  
  namespace bb {
      namespace cascades {
          class Container;
          namespace multimedia {
              class Camera;
          }
      }
  }
  
  namespace GDLiteBB {
  
      class Camera : public QObject, public Page_ {
          Q_OBJECT
  
          //-----------------RELEVANT LINE OF CODE---------------------
          bb::cascades::multimedia::Camera *cameraDevice_;
          //-----------------------------------------------------------
  
          static Camera *Camera_;
  
          Camera(
              QString *qmlFileName = new QString(""),
              QString *qmlVarName = new QString(""),
              QObject *parent = 0);
  
      public:
  
          static Camera *getInstance(
              QString *qmlFileName = new QString("main.qml"),
              QString *qmlVarName = new QString("camera"),
              QObject *parent = 0);
  
          virtual ~Camera();
  
      Camera *show(bb::cascades::Container *container = 0);
  
      void showCamera();
  
          //-----------------RELEVANT LINES OF CODE---------------------
          public slots:
          void onPhotoSaved(const QString &amp;fileName, quint64 length);
         //-------------------------------------------------------------
  };
  
  } /* namespace GDLiteBB */
  
  #endif /* CAMERA_H_ */
  </code></pre>
  
  <p>//Camera.cpp</p>
  
  <pre><code>Camera::Camera(
      QString *qmlFileName,
      QString *qmlVarName,
      QObject *parent)
  : QObject(parent),
      Page_(qmlFileName, qmlVarName) 
  {
      INIT_PAGE
  
      if (Root_) {
          //-----------------RELEVANT LINES OF CODE---------------------
          cameraDevice_ =
              Root_-&gt;findChild&lt;bb::cascades::multimedia::Camera *&gt;("camera1");
  
          connect(cameraDevice_, SIGNAL(photoSaved(const QString&amp;, quint64)), this,
              SLOT(onPhotoSaved(const QString&amp;, quint64)));
         //----------------------------------------------------------------
  
      } else {
          cameraDevice_ = 0;
      }
  }
  
  //-----------------RELEVANT LINES OF CODE---------------------
  void Camera::onPhotoSaved(
      const QString &amp;fileName,
      quint64 length)
  {
      disconnect(
          cameraDevice_,
          SIGNAL(photoSaved(const QString&amp;, quint64)),
          this,
          SLOT(onPhotoSaved(const QString&amp;, quint64)));
  
      qDebug() &lt;&lt; "onPhotoSaved";
      qDebug() &lt;&lt; "filename is " &lt;&lt; fileName &lt;&lt; ", length is " &lt;&lt; length &lt;&lt; "test";
  }
  //-----------------------------------------------------------------
  </code></pre>
  
  <p>But when I take a picture, the onPhotoSaved slot is not being triggered, for the qDebug is not happening.</p>
  
  <p>I know that the photo is being saved tho, because in the qml, I have: </p>
  
  <pre><code>Label {
      id: cameraDebug
  }
  Camera {
      ...
      onPhotoSaved: {
          photoBeingTaken = false;
          cameraDebug.text = "saved photo"
      } 
  }
  </code></pre>
  
  <p>and the label, cameraDebug, changes to "saved photo", after taking a photo., so I am catching the QML signal for saved photo, but I need to catch the C++ signal for saved photo, because I need the filename of the photo, and that is not working, as I said above.</p>