Results 1 to 4 of 4

Thread: how implement different views

  1. #1
    Join Date
    Dec 2010
    Posts
    6
    Thanked 2 Times in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how implement different views

    I've a main.qml file, the UI looks like this:

    Qt Code:
    1. ############################################
    2. # FIRST_SCENE # SECOND_SCENE # THIRD_SCENE #
    3. ############################################
    To copy to clipboard, switch view to plain text mode 

    Each '*_SCENE' represents a button which redirects to a .qml file.
    my question is, how can I implement such a thing in QtQuick?
    I mean, how do I show a different .qml file with a nice effect while switching to the other .qml file?


    thanks


    Added after 1 9 minutes:


    My post is a bit confusing...

    I have 3 .qml file.
    Each file represents a totally different scene with its own widgets. If the user clicks on the button 'SECOND_SCENE' the second .qml file should be shown smooth. how do I realize that?
    I couldn't find anything in the examples.
    Last edited by Sunny31; 11th December 2010 at 12:21.

  2. #2
    Join Date
    Dec 2010
    Location
    Veszprém, Hungary
    Posts
    34
    Thanks
    2
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: how implement different views

    I created an item like this
    Qt Code:
    1. Item {
    2. id: loadedItem
    3. Loader {
    4. source
    5. }
    6. }
    To copy to clipboard, switch view to plain text mode 

    and used this item as a flippable.front, an other one as flippable.back.
    So i can change the qml in run-time.

  3. #3
    Join Date
    Dec 2010
    Posts
    6
    Thanked 2 Times in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how implement different views

    not really what I wanted.
    your solution works good if I just have 2 views. but I have over 3 views!
    but thanks for your answer!

    I have something like this:


    I want to switch between these tabs, each tab represents an INDIVIDUAL QML FILE, with its OWN WIDGETS.

    If the user clicks on TAB 1, a signal is triggered to the c++ application where I change the view. yeah I can call a 'view.setSource("tab1.qml")', but what happens with the Signal-Slot connections to the qml-Widgets?
    my other idea was to have multiple QDeclarativeViews, but every time if a QDeclarativeView is showed a new window pops up.
    I also want a nice effect while switching between these qml files (= tabs)
    Last edited by Sunny31; 11th December 2010 at 14:48.

  4. #4
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how implement different views

    There was some example in Qt demos.. or may be on Qt Labs / Dojo.
    Search for parallex qml .

Similar Threads

  1. DB changes not updating in views
    By Jeffb in forum Newbie
    Replies: 11
    Last Post: 11th May 2010, 10:00
  2. Blocking updates on views
    By NoRulez in forum Qt Programming
    Replies: 5
    Last Post: 4th May 2010, 20:28
  3. Model with two very different views
    By mholmes in forum Qt Programming
    Replies: 3
    Last Post: 7th April 2010, 23:19
  4. QAbstractItemModel to different views
    By ganeshshenoy in forum Qt Programming
    Replies: 3
    Last Post: 19th February 2008, 13:43
  5. 2 Views 1 Model
    By PrimeCP in forum Qt Programming
    Replies: 3
    Last Post: 2nd October 2007, 01:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.