C++ QAbstractItemModel 和 QTreeView
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4354515/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
QAbstractItemModel and QTreeView
提问by Dmitry
I need working examples (c++) of show own data model in QtreeView.
我需要在 QtreeView 中显示自己的数据模型的工作示例(c++)。
采纳答案by Nathan Pitman
There's a pretty good QTreeView/QAbstractItemModel example here. It's fairly straightforward once you get used to QT's ultra-generic model... just don't expect it to be as simple or obvious as Java's TreeModel.
有一个相当不错的QTreeView则/化QAbstractItemModel例子在这里。一旦你习惯了 QT 的超通用模型,它就相当简单了……只是不要期望它像 Java 的 TreeModel 一样简单或明显。