Qt how to add torch / flash in your phone

Are you getting QCameraExposure is not found???
Then goto your project file and add the following:


CONFIG += mobility
MOBILITY += contacts
    messaging
    multimedia
    systeminfo
# Self-signing capabilities
symbian:TARGET.CAPABILITY += NetworkServices
        ReadUserData
        WriteUserData
        LocalServices
        UserEnvironment
// in header file
QCamera *qcam;
    QCameraFlashControl *qcamflash;
    QCameraExposure *qcamexp;
// in cpp file
qcam = new QCamera();
    qcamexp = qcam->exposure(); // get exposure object
    qcamexp->setFlashMode(QCameraExposure::FlashTorch);

Then compile it will work..

In

Leave a Reply

Your email address will not be published. Required fields are marked *