gpt4 book ai didi

c++ - 黑莓10截图错误

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:47:32 26 4
gpt4 key购买 nike

我正在尝试像这样使用 bb:system::screenshot

request.setTarget("sys.pim.uib.email.previewer");

// Set the action that the target app should execute
request.setAction("bb.action.VIEW");

// Set the MIME type of the data
request.setMimeType("message/rfc822");

// Specify the location of the data
request.setUri(QUrl("pim:message/rfc822:" + QString::number(accountId) +":" + QString::number(messageId)));

InvokeTargetReply *reply = invokeManager.invoke(request);

sleep( 2 );

//Screenshot
bb::system::Screenshot screenshot;
QString filename = screenshot.captureDisplay();
if (filename.isEmpty()) {
// Something went wrong
bb::system::ScreenshotError::Type error = screenshot.error();
}

//Close Email
invokeManager.closeChildCard();

问题是文件名总是空的,screenshot.error() 总是有错误值。以下是调试器在“出错了”行中所说的内容:

screenshot.error() 错误:报告了多个错误。\无法执行 MI 命令:-var-create - * screenshot.error() 来自调试器后端的错误消息:找不到方法 bb::system::截图::错误\无法创建变量对象

不确定这是什么意思?

编辑:我将屏幕截图变量定义移到 if 语句之外并看到此错误:

Name : error
Details:bb::system::ScreenshotError::PermissionDenied
Default:bb::system::ScreenshotError::PermissionDenied
Decimal:2
Hex:0x2
Binary:10
Octal:02

问题是,我确实正确设置了权限:

  <!-- Request permission to execute native code.  Required for native applications. -->
<permission system="true">run_native</permission>
<permission>access_pimdomain_contacts</permission>
<permission>read_device_identifying_information</permission>
<permission>access_pimdomain_messages</permission>
<permission>bbm_connect</permission>
<permission>access_pimdomain_calendars</permission>
<permission>use_camera</permission>
<permission>use_camera_desktop</permission>
<permission>use_gamepad</permission>
<permission>access_internet</permission>
<permission>access_location_services</permission>
<permission>record_audio</permission>
<permission>read_personally_identifiable_information</permission>
<permission>access_pimdomain_notebooks</permission>
<permission>access_notify_settings_control</permission>
<permission>access_phone</permission>
<permission system="true">_sys_inject_voice</permission>
<permission>read_phonecall_details</permission>
<permission>access_pimdomain_calllogs</permission>
<permission>control_phone</permission>
<permission>post_notification</permission>
<permission system="true">_sys_use_consumer_push</permission>
<permission>run_when_backgrounded</permission>
<permission system="true">_sys_run_headless</permission>
<permission system="true">_sys_headless_nostop</permission>
<permission>access_shared</permission>
<permission>access_sms_mms</permission>
<permission>access_wifi_public</permission>

从文档中,我需要“权限:应用程序必须具有 use_camera_desktop 和 access_shared 权限才能使用此功能。”

最佳答案

这显然是 Blackberry 模拟器中的一个错误,可以追溯到 10.2 模拟器(10.2 模拟器是在引入屏幕截图库的时候,所以你不能再追溯到那个时候。)我与 Blackberry Developer 确认了这一点顾问。 (在这里找到,需要登录 http://supportforums.blackberry.com/t5/Native-Development/Error-Capturing-and-saving-a-screen-shot-in-BB10-c/td-p/3112490 )

关于c++ - 黑莓10截图错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31006079/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com