PDA

View Full Version : How to achieve a kind of "View-Switching" with a single QML file?



chiru
10th November 2010, 06:36
Hello,
I am developing a mobile application where in I have to switch to different view on an user responce. For example, User is shown some content with a toolbar at the bottom to switch to another view, On clicking on that toolbar, I have to show different content.
How can I do this effectively? Do I need to write some C++ code to acheive this?

Thanks
Chiru

tbscope
10th November 2010, 06:41
Try this example:
http://doc.qt.nokia.com/4.7/declarative-ui-components-tabwidget-tabwidget-qml.html

I guess you can create something similar.

chiru
10th November 2010, 08:25
Thanks for the link. Now, I got the idea on how to do it.
But, If my views are very complex and I have diferent qml files for different views. So, In my main qml file, I have to instantiate the views. If those views are self independent without any input from mail qml file needed, then how should I use those views in my mail qml file?