PDA

View Full Version : how to implement the flickr demo page swap



scarleton
14th December 2010, 14:16
I am new to QML and am working on the top level navigation. The goal is to have 6 icons on the homepage, when one icon is selected, the homepage will move to the left while the new screen moves in from the left. This is the behavior of the flickr example when you click on the <View mode> button. For some reason, it isn't working for me. The project source code can be found at the links below:

Main page: This contains everything and where I think the problem lies, code is below.

Home page: This is the page that has the 6 icons, it does contain a property/signal which the Main page is getting and correctly setting a status text, so I am 99% sure this is working fine.

6 different app pages: For now they are all simple rectangles with text in the center of them to reprocent each of the pages that should be loaded once an icon is clicked on. These pages should be off the screen on the start of the app, but they are all visible. The logic that controls their position is all in the Main page. Below is source to one of them, maybe it is the wrong type of control.

http://www.miltonstreet.com/download_examples/NavExample.zip (73,728 bytes)

or

http://www.miltonstreet.com/download_examples/NavExample.7z (63,852 bytes)

Sam

Added after 33 minutes:

Figured it out, there where two issues:

1: The when clause in the States where referenceing the wrong thing, it said main.currentPage, not container.currentPage
2: On all the pages, the x, y, width, height and anchors.fill properties had to be commented out.

it works like a charm now!