QMetaObject 的 QAbstractItemModel,我必须自己编写吗?
建立在 Qt 反射系统之上的一套数据模型似乎是一种自然的协同作用,但我还没有在 Qt 库本身或第三方中找到这样的野兽。有谁知道这样的事情是否存在?
我正在寻找用于编辑和显示 QObjects QMetaObject 属性集合的数据模型。我可以理解为什么这不包含在 Qt 库中(因为不可能以干净的方式公开所有 QMetaObject),但我希望我不必编写一堆数据模型和代理模型来显示 QObject 的层次结构和属性。
A suite of data models built on top of Qt's reflection system seems like a natural synergy, but I haven't found such a beast in the Qt library itself or from a 3rd party. Does anyone know if such a thing exists?
I'm look for data models for editing and displaying a collection of QObjects QMetaObject properties. I can kind of understand why this isn't included in the Qt library (as it would not be possible to expose all of QMetaObject in a clean way) but I'm hoping I don't have to write a bunch of data models and proxy models to display the hierarchies and properties of QObjects.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您表示
QObjects
树,则 QStandardItemModel 将可能适合您的需求。如果没有,您可能会对其进行子类化,而不是QAbstractItemModel
。If you are representing a tree of
QObjects
then QStandardItemModel will probably suit your needs. If not, you would probably subclass that instead ofQAbstractItemModel
.