【问题标题】:BB10 Cascades SystemDialogBB10 级联系统对话框
【发布时间】:2013-05-25 18:03:05
【问题描述】:

我对 SystemDialogs 有疑问?我需要在 QML 中实现一个,但 Github 上可用的示例项目(“对话框”)在使用 10.1 SDK 构建时显示为包含错误。但是它们确实运行正常。

感兴趣的代码如下:

    SystemDialog {
            id: dialog
            title: qsTr("DIALOG")
            body: qsTr("Dialog body")
            confirmButton.label: qsTr("Okay button")
            confirmButton.enabled: true
            cancelButton.label: qsTr("Cancel button")
            cancelButton.enabled: true
            buttons: [
                SystemUiButton {
                    id: random
                    label: qsTr("RANDOM")
                    enabled: true
                },
                SystemUiButton {
                    id: random2
                    label: qsTr("RANDOM2")
                    enabled: true
                }
            ]
…
}

“错误”属性是确认和取消按钮的label 和enabled 属性以及SystemDialog 的buttons 数组属性。如前所述,尽管 IDE 将它们突出显示为错误,但代码似乎按预期工作。

我的问题是,有没有办法在 SDK10.1 中做类似的事情?我需要在对话框中的按钮上设置文本。

【问题讨论】:

    标签: qml blackberry-10 blackberry-cascades


    【解决方案1】:

    名称“标签”和“启用”是正确的。

    你可以查看bbndk-10.1/target_10_1_0_1020/qnx6/usr/include/bb/system/SystemUiButton.hpp

    我认为 IDE 将这些名称视为错误是不正确的。

    【讨论】:

    • 更新 - 黑莓建议使用 Dialog 类而不是 SystemDialog
    • 巴里,他们可能会建议,但两者不是相关的类。 Dialog 是完全在您自己的应用程序中呈现的组件,而 SystemDialog 是操作系统提供的外部服务的接口,具有标准化的行为和外观。它们不可互换,因此请在您认为合适的情况下忽略他们的建议。
    猜你喜欢
    • 2013-12-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多