2012-12-11 195 views
1

我已經在Sign.qml頁面中使用了NavigationPane,用戶登錄後,它將在Homescreen.qml中轉到Homescreen.qml 我已經使用TabbedPane,同時單擊登錄按鈕(Signin.qml),我越來越響應,但不能能去Homescreen.qml黑莓10級聯Tabbedpane

在此我附上我的代碼 Signin.qml

NavigationPane { 
       id: navigationPane 
      Page { 

    attachedObjects: ComponentDefinition { 
     id: pageDefinition 
     source: "HomeScreen.qml" 
    } 
    Container { 
     Button { 
      text: "Login" 
      onClicked: { 
       //check if is credentials are valid or not 
       if(isValidUser()) 
       { 
        var page = pageDefinition.createObject(); 
        navigationPane.push(page); 
       } 
       else 
       { 
        //show error message 
       } 
      } 
     } 
    } 
}} 

和我Homescreen.qml代碼

 import bb.cascades 1.0 

      TabbedPane { 
      id: mainTab 
      showTabsOnActionBar: true 

Tab { 
     title: "Home" 
     imageSource: "asset:///menuicons/home.png" 

     Signin { 
      id: signin 
     } 
    } 
Tab { 
    title: "Home" 
    imageSource: "asset:///menuicons/home.png" 

    Editnew { 
     id: homepage 
    } 
} 
Tab { 
    title: "Messages" 

    Messages { 

    } 
} 

Tab { 
    title: "Search" 

    Search{ 

    } 
} 
Tab { 
    title: "Feeds" 

    Feeds { 

    } 
} 

Tab { 
    title: "Nearby" 

    Nearby{ 

    } 
} 
Tab { 
    title: "Followers" 

    Followers { 
     id: foll 
    } 
} 
Tab { 
    title: "Group" 

    Groups { 
     id: groups 
    } 
} 

我無法查看Homescreen.qml,同時點擊登錄按鈕登錄,任何人都可以給我一些想法如何做到這一點..?

回答

3

您無法在NavigationPane內推送TabbedPane。在應用程序流頂部使用TabbedPane是最好的做法,如果您想深入瞭解,可以在TabbedPane中使用NavigationPane。

仍然有一個解決方法給你。您可以將TabbedPane放在工作表內,然後打開該工作表,而不是在NavigationPane上推入。

attachedObjects: Sheet { 
      id: tabbedPaneSheet 
      Homescreen{ 
      } 
    } 
... 
onClicked{ 
    tabbedPaneSheet.open() 
} 
... 
+0

感謝這個@Sorry老闆 – rfsk2010

0

做出一個更加功能像這樣和通話標誌此功能在 ....

void xxxx::homescreen() 
    { 



     // create scene document from main.qml asset 
     // set parent to created document to ensure it exists for the whole application lifetime 
     QmlDocument *qml = QmlDocument::create("asset:///homescreen.qml").parent(this); 

     qml->setContextProperty("_app", this); 


     AbstractPane *root = qml->createRootObject<AbstractPane>(); 



     // set created root object as a scene 


     app1->setScene(root); 

    }