How to switch view using a button
-
Hi everyone,
I'm still new with Qt Quick. I want to know how to create list button that will link to another page. -
Could you elaborate please. What is a "list button"?
-
Also what do you mean by another page?
-
list button is just a normal button.
for example I create a button that have introduction text on it.
when we click that button it will direct to the introduction part -
Just make Image with Text and MouseArea inside it and set needed action for MouseArea.onClicked
-
ok.. so that image should be direct to where..
is it state or something else -
You can use "states" for display your pages. And your "list button" can be globally or page-only.
-
Hey, I think it i better to start with simple things to understand how QML works.
I would recommend checking and trying examples "here":http://jryannel.wordpress.com/Really good learning curve.
Also very nice materials here on this site in section for designers: "here":http://qt.nokia.com/developer/learning/online/training/materials/qt-quick-for-designers/
-
Indeed. Wise advice by cmer4.
-
Hello,
How can I switch view in qml -
thank you
-
Sorry, what are you mean "switch view", can you give us a more detailed description about this ?
-
for example I want to create a button and will direct me from view 1 to view 2
-
There are many ways to do this. For a transition from left to right you can create a row layout and put two screens next to each other. Then you simply shift the x-coordinate by one negative screen width. For a cross-fade transition you put two items on top of each other and you set the opacity of the topmost one to 0. I would recommend using a Behavior or Animation to ease out the transition for opacity or x coordinates. There is not a standard way of doing this in Qt Quick but I would recommend looking at examples such as the flickr demo.