Results 1 to 15 of 15

Thread: failed to assigned loader source component

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: failed to assigned loader source component

    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:
    1. ListView {
    2. id: wizardList
    3. anchors.fill: parent
    4. focus: true
    5. highlightRangeMode: ListView.StrictlyEnforceRange
    6. orientation: ListView.Horizontal
    7. snapMode: ListView.SnapOneItem
    8. model:
    9. ListModel {
    10. ListElement {
    11. page: "Wizard1.qml"
    12. }
    13. ListElement {
    14. page: "Wizard2.qml"
    15. }
    16. ListElement {
    17. page: "Wizard3.qml"
    18. }
    19. }
    20. delegate: WizardDelegate {}
    21. onMovementStarted: {
    22. if (wizardList.currentIndex == 2) { // i need to include in the condition to check if the swipe direction is to the right
    23. mainLoader.source = "Main.qml"
    24. }
    25.  
    26. }
    27. }
    To copy to clipboard, switch view to plain text mode 
    Last edited by joko; 9th January 2015 at 15:07.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: failed to assigned loader source component

    Why don't you just add Main.qml to your model?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: failed to assigned loader source component

    Quote Originally Posted by wysota View Post
    Why don't you just add Main.qml to your model?
    Because the Main page is completely different from the wizard pages and i don't want to go back to the wizard pages once it reaches the Main page.
    Is there a way to check the swipe movement? I still trying to use the contentX, if that is possible.

    Thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: failed to assigned loader source component

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: failed to assigned loader source component

    Quote Originally Posted by wysota View Post
    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.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: failed to assigned loader source component

    Quote Originally Posted by joko View Post
    loaded the wizard page with list view of wizard pages.
    I don't understand that. Wizard page with a view of wizard pages?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: failed to assigned loader source component

    Quote Originally Posted by wysota View Post
    I don't understand that. Wizard page with a view of wizard pages?
    The Wizard qml page, where I put the Listview using the ListModel of pages.

    Here is my Wizard qml page.

    Qt Code:
    1. ListView {
    2. id: wizardList
    3. anchors.fill: parent
    4. focus: true
    5. highlightRangeMode: ListView.StrictlyEnforceRange
    6. orientation: ListView.Horizontal
    7. snapMode: ListView.SnapOneItem
    8. model:
    9. ListModel {
    10. ListElement {
    11. page: "Wizard1.qml"
    12. }
    13. ListElement {
    14. page: "Wizard2.qml"
    15. }
    16. ListElement {
    17. page: "Wizard3.qml"
    18. }
    19. }
    20. delegate: WizardDelegate {}
    21. }
    To copy to clipboard, switch view to plain text mode 

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: failed to assigned loader source component

    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?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Oct 2014
    Posts
    104
    Thanks
    16
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: failed to assigned loader source component

    Quote Originally Posted by wysota View Post
    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?
    Basically, I only have 1 wizard, the list elements on List Model are just pages of the wizard.
    Yes, you are correct, after reaching the last page, I should be brought to main page.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: failed to assigned loader source component

    In that case in my opinion pages of the wizard should be handled on the same level as remaining pages of the application (i.e. without a separate list view).
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. update Loader source
    By codeman in forum Qt Quick
    Replies: 1
    Last Post: 25th July 2014, 16:21
  2. Geotechnical engineer and I have been assigned
    By Jackson Kulakowski in forum Qt Programming
    Replies: 1
    Last Post: 2nd June 2013, 18:22
  3. Replies: 2
    Last Post: 25th March 2013, 18:06
  4. Replies: 1
    Last Post: 23rd February 2013, 17:05
  5. Replies: 0
    Last Post: 23rd November 2011, 18:56

Tags for this Thread

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.