[Interest] QCamera flash modes

Jason H jhihn at gmx.com
Mon Jul 20 21:34:35 CEST 2015


I'm trying to identify if a QCamera  has a flash. Ideally, I'd like this done in QML, but there seems to be no support for it yet. So I'm making a QML type in C++.

So in C++:
qDebug() << "Default:" << QCameraInfo::defaultCamera().deviceName() << QCameraInfo::defaultCamera().position();
camera = new QCamera();
if (camera) {
	QCameraExposure *exp = camera->exposure();
	if (exp) {
		qDebug() << "QCamera ok, returning flash modes"
			<< exp->isFlashModeSupported(QCameraExposure::FlashOn)
			<< exp->isFlashModeSupported(QCameraExposure::FlashAuto)
			<< exp->isFlashModeSupported(QCameraExposure::FlashManual);
		return exp->isFlashModeSupported(QCameraExposure::FlashOn);
	}
}

Default: "com.apple.avfoundation.avcapturedevice.built-in_video:0" QCamera::BackFace
However all I ever get is false. This is being run on an iPhone 5S, which does have a backface flash, and I do use the flash successfully in QML. I'm attempting to also support iPads which do not have a flash at all, but I need to know that the flash does not work.

Does anyone know what I might be doing wrong?




More information about the Interest mailing list