Handling a ListModel



  • Hi to all,

    I am a beginner on QtQuick, and i need your help about the following problem

    !http://imagizer.imageshack.us/v2/800x600q90/540/fMjzw7.png(Image)!

    as described in the image:

    1. I want to create two circular List [Circular List A] & [Circular List B] ; for this i used a PathView @(could you tell me if using PathView is the best way to create a circular List?@

    2. I want to use a drag on each element on a circular List A so that each element of the List A will be dragged on the list B and will be delete on the A list .
      @For this i do not know how to use a list to handle each element of the list separately.@

    3. @Is it possible to assign to each element of the list an action different to action assigned to other elements when we Use onClicked on every element?@

    someone could give me directions how to do?

    Best Regards;

    Mias21


  • Moderators

    Hi,

    bq. could you tell me if using PathView is the best way to create a circular List?

    Yes. Use the PathView and set it a Model.

    bq. I want to use a drag on each element on a circular List A so that each element of the List A will be dragged on the list B and will be delete on the A list.

    Set a "delegate":http://qt-project.org/doc/qt-5/qml-qtquick-pathview.html#delegate-prop to the PathView and in that Component use "Drag":http://qt-project.org/doc/qt-5/qml-qtquick-drag.html to drag the Items and set also DropArea to the PathViews. And since Model is used you can remove/add Items from the PathView.

    bq. Is it possible to assign to each element of the list an action different to action assigned to other elements when we Use onClicked on every element?

    If a delegate is used you can do it. Each Component of the Delegate is assigned a unique index using which you can use.

    Hope this helps you ...


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.