model.page is a string, Loader.sourceComponent wants a Component.
The property you are most likely looking for is Loader.source, each "page" containing the name of a QML file containing that page
Cheers,
_
model.page is a string, Loader.sourceComponent wants a Component.
The property you are most likely looking for is Loader.source, each "page" containing the name of a QML file containing that page
Cheers,
_
joko (9th January 2015)
I would like to know the signal used by either Listview or Flickable to determine if the last element was flicked, if there's an available signal.
As mentioned i have a main loader that loads the Wizard.qml, I wanted to display another page once the last item was flicked/swiped to right.
I would like to change the main loader source so that the new page will display.
Thanks.
I have found this signal onMovementStarted to trigger the changing of loader source.
However I need to know if the user swipe to right before it changes the source.
Is this a correct way to trigger the change of page or there's a better option.
Any suggestions? Thanks
Qt Code:
ListView { id: wizardList anchors.fill: parent focus: true highlightRangeMode: ListView.StrictlyEnforceRange orientation: ListView.Horizontal snapMode: ListView.SnapOneItem model: ListModel { ListElement { page: "Wizard1.qml" } ListElement { page: "Wizard2.qml" } ListElement { page: "Wizard3.qml" } } delegate: WizardDelegate {} onMovementStarted: { if (wizardList.currentIndex == 2) { // i need to include in the condition to check if the swipe direction is to the right mainLoader.source = "Main.qml" } } }To copy to clipboard, switch view to plain text mode
Last edited by joko; 9th January 2015 at 15:07.
I completely fail to understand why you want to act on a flick. Whatever you are trying to do, I don't think the approach you have taken is a proper one. Maybe you could restate your problem in a descriptive way and we'll try to suggest an approach to solve it.
Thank you for your response.
I have a main loader which loaded the wizard page with list view of wizard pages.
I used list view so that the user can flick on those pages back and forth.
At the last item, when the user flick to the right, it will exit on the list view (wizard) and will display the main page.
Once on main page, the user cannot go back to the wizard anymore.
Let me know if you have further questions on my implementation.
Thanks a lot for your time.
The Wizard qml page, where I put the Listview using the ListModel of pages.
Here is my Wizard qml page.
Qt Code:
ListView { id: wizardList anchors.fill: parent focus: true highlightRangeMode: ListView.StrictlyEnforceRange orientation: ListView.Horizontal snapMode: ListView.SnapOneItem model: ListModel { ListElement { page: "Wizard1.qml" } ListElement { page: "Wizard2.qml" } ListElement { page: "Wizard3.qml" } } delegate: WizardDelegate {} }To copy to clipboard, switch view to plain text mode
Let's summarize -- you have a number of wizards, each composed of a number of wizard pages. You want to advance the wizard by flicking until you reach the last page of the wizard and if you flick again you should be brought to the main page where you can do some other actions (e.g. choose another wizard). Is that correct?
Bookmarks