【问题标题】:Qml not update button after model change模型更改后Qml不更新按钮
【发布时间】:2015-03-25 06:39:30
【问题描述】:

项目和代码在这里https://github.com/neochapay/radon

看: pages/PlaylistPage.qml

在 21 行 - 调用模型并设置播放曲目。进入模型:

src/model/playlistmodel.cpp

看 80 行 - 好像一切都正确,一切都已设置好。然后去

pages/PlayList/PlayListItem.qml

查看 85 行 - 结果问:为什么按钮不改变?

【问题讨论】:

  • 在此处添加一个显示您的问题的最小工作示例代码

标签: qml qt5 models


【解决方案1】:

因为您必须发出 dataChanged signal 才能让视图知道模型更改了它的一些数据。

【讨论】:

猜你喜欢
  • 2015-08-11
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-04-10
  • 2014-05-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多