0

I have used a TabbedPane in this while clicking i need to call an another qml file here is the code am using but its not working

TabbedPane {
  showTabsOnActionBar: tabs
  sidebarState: SidebarState.VisibleCompact
  Tab {
    imageSource: "asset:///msg.png"
    Page {
      id: page1                 
      actions: [
        ActionItem {
          onTriggered: {
            var page = pageDefinition.createObject();
            navigationPane.push(page);
          }
          attachedObjects: ComponentDefinition {
            id: pageDefinition;
            source: "x.qml"
          }
        }
      ]
      actionBarVisibility: ChromeVisibility.Visible
    }
}

can anyone send me code how to add Click event inside this function Thanks

scunliffe
  • 62,582
  • 25
  • 126
  • 161
Apple
  • 121
  • 2
  • 12
  • I reformatted your code for readability, however there is a stray semi-colon `;` after your `id: pageDefinition` line. (Semi-Colons only appear at the end of the JavaScript statements within the "event handlers" like `onTriggered`). That said I'm not sure if you are trying to create another Tab? or push another page onto the stack? – scunliffe Dec 11 '12 at 00:33
  • Where do you have navigationPane defined? – Tomáš Hubálek Dec 28 '12 at 21:47

1 Answers1

2

Here is an example for creating tabs for a different screen. You are in main tab to go next qml as follows:

Tab {
  title: "Puppies"
  NavigationPane {
    id: navigationPane
    Sample //this is one qml page as like Sample.qml
    {
    }
  }
}

Tab {
  title: "Kittens"
  NavigationPane
  {
    id: testpage
    Test //this is one qml page as like Test.qml
    {
    }
  }
}

You can access other QML files by setting the id.

Jonathan
  • 6,507
  • 5
  • 37
  • 47
Vendetta
  • 513
  • 2
  • 16