1

我在 BB-10 中尝试了 onClick 功能,而单击时我无法通过单击功能推送另一个 qml 文件

Button {
                text: "LOG IN"
                onClicked: {
                    var test = screen.createObject();
                     navigationPane.push(test);
                }
                attachedObjects: ComponentDefinition {
                    id: screen
                    source: "y.qml"
                }
            } 

代码y.qml如下

             TabbedPane {
showTabsOnActionBar: true
Tab {
    title: "Home"
    Page {
        id: page1
        actions: [
            ActionItem {
                title: "New"
            },
            ActionItem {
                title: "Delete"
            }
        ]
    }
}
Tab {
    title: "Options"
    Page {
        id: page2
        actions: [
            ActionItem {
                title: "Edit"
            },
            ActionItem {
                title: "Save"
            }
        ]
    }
}

单击(文本:“登录”)按钮时我无法查看“y.qml”,任何人都可以发送一些解决方案来解决这个问题吗?

4

2 回答 2

0

您不能从导航页面推送选项卡式窗格,您只能推送一个页面;但在 TabbedPane 中,您可以拥有导航窗格。

于 2012-11-28T15:13:46.180 回答
0

您无法将导航窗格推送到选项卡式窗格,您可以在选项卡内添加导航窗格,如下所示

 Tab {
    id: loginregisterTab
    NavigationPane {
             peekEnabled: false
         id: test
        y{//here u can go to y.qml
        }
    }
}

在 y.qml 中,你已经包含了类似的 id

NavigationPane{
 id: navigationPane
   Page {
    Container {
        id: test
  }
  }
 }
于 2013-02-11T09:24:53.280 回答