Qt6 QML Book/模型视图/模型-视图-委托

Model-View-Delegate

模型-视图-委托

As soon as the amount of data goes beyond the trivial, it is no longer feasible to keep a copy of the data with the presentation. This means that the presentation layer, what is seen by the user, needs to be separated by the data layer, the actual contents. In Qt Quick, data is separated from the presentation through a so called model-view separation. Qt Quick provides a set of premade views in which each data element is the visualization by a delegate. To utilize the system, one must understand these classes and know how to create appropriate delegates to get the right look and feel.

一旦数据量太过琐碎,就不适合直接保留数据副本。这意味着表示层,即用户看到的内容,需要要离出数据层,即实际数据内容。在Qt Quick中,通过所谓的模型-视图分离将数据与表示分离。Qt Quick提供了一组预制视图,其中每个数据元素都是由委托进行可视化的。要使用该系统,必须了解这些类,并知道如何创建适当的委托以获得正确的外观。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值