我的设备是带有Android 6.0的redmi note4,我的IDE是Qt 5.8。我用QZxing实现解码QRcode。但是当我打电话给相机扫描时,我得到了这个日志。 奇怪的是,它适用于另一部手机(带有Android 5.1的redmi2)。有人可以帮忙吗?
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
D MALI : gles_state_set_error_internal:75: [MALI] GLES ctx: 0xd9fc0008, error code:0x502
D MALI : gles_state_set_error_internal:76: [MALI] GLES error info: <type> is GL_UNSIGNED_SHORT_5_6_5 and <format> is not GL_RGB (or) <type> is GL_UNSIGNED_SHORT_4_4_4_4 or GL_UNSIGNED_SHORT_5_5_5_1 and <format> is not GL_RGBA
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
W GLConsumer: [SurfaceTexture-0-16419-0] bindTextureImage: clearing GL error: 0x502
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
V CameraFramework: set Key = focus-areas, value = (0,0,0,0,0)
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 16
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
I CameraFramework: handleMessage: 4096
I CameraFramework: CAMERA_MSG_META_DATA
我通过此按钮调用解码QML页面
IconButton {
id: sq_codeIconButton
anchors.topMargin: 28
anchors.top: parent.top
iconSource: "images/ScanQR_Code.png"
rippleColor: "#FF7F00"
onClicked: {
qrCodeReader.active = true;
rectangle.visible = false;
console.log("调用摄像头扫描二维码")
}
}
矩形是当前页面ID。 qrCodeReader的定义如下:
JQQRCodeReader {
id: qrCodeReader
width: parent.width
height: parent.height
onTagFound: {
patientNumText.text = "id:" + tag;
rectangle.visible = true;
}
}
我通过这个使用lib: https://github.com/188080501/JQQRCode