Qt5 ListView switch items animation
-
Hi
is there is a way to change animation of switching items in ListView?
thanks
-
I think addDisplaced and displaced is what you are looking for
-
Hi Jens
thanks for you reply
tried to add
@displaced: Transition {}
addDisplaced: Transition {}@but the behavior is still the same
-
Transition{} itself doesnt do any animation. You need to add something to it. i.e:
@add: Transition {
NumberAnimation { properties: "x,y"; from: 100; duration: 1000 }
}@See the ListView docs for fore examples.
-
Exactly!
I do not want any animation :) -
Does it work with self implemented QAbstractListModel?
I tried, but no animation happens on add, remove, etc...@ beginInsertRows( QModelIndex(), rowCount(), rowCount() );
m_list << entity;
endInsertRows();@@add: Transition {
SequentialAnimation {
NumberAnimation { property: "opacity"; from: 1; to: 0.0; duration: 400 }
NumberAnimation { property: "scale"; from: 1; to: 0.0; duration: 400 }
}
}@