简体   繁体   English

在 QListView 中使用 Qt animation 框架进行自定义委托

[英]Using Qt animation framework for custom delegate in a QListView

I would like to add an effect of moving rows, like a store, in a QListView using QAnimation.我想使用 QAnimation 在 QListView 中添加移动行的效果,例如商店。 I use a custom delegate to render things from a QStandardItemModel.我使用自定义委托从 QStandardItemModel 呈现事物。 My delegate is a custom widget.我的委托是一个自定义小部件。

The paint method in the delegate creates the widget, paints it and destroys it.委托中的paint方法创建小部件,绘制它并销毁它。 I have no direct access to each custom widget displayed.我无法直接访问显示的每个自定义小部件。 Nevertheless, I would like to use setPos() within the animation to move this "not accessible" widget.不过,我想在 animation 中使用 setPos() 来移动这个“不可访问”的小部件。

Any ideas?有任何想法吗?

Thank you谢谢

Your description of what you want to achieve is not very clear.您对要实现的目标的描述不是很清楚。 Have you thought of moving the animation into the QListView?你有没有想过将 animation 移到 QListView 中? It should have visibility of all items in it's model.它应该可以看到 model 中的所有项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM