Op 04/03/2016 om 13:20 schreef william.croc...@analog.com:
On 03/04/2016 03:06 AM, Roshni Lalwani wrote:
I have application in which I am planning to use a QtreeWidget . The maxinum number of elements in the treeWidget can go uptp 500 . COuld you let me how will be performance of using QtreeWidget for 500 elements . Will it lead to some
performance degradation


Use a QTreeView with an underlying model and performance of the tree widget
will no longer be a concern.

Nonsense.
It all depends on your implementation of the model then, and writing good tree models is not trivial. I agree that generally a "real" model is much to be prefered, but your statement as-is doesn't make much sense to me.

I think the merrits of QTreeWidget (and all the view like Q*Widget classes) is debatable, but I don't think performance is the major pain point here. I would recommend to consider using QStandardItemModel with a QTreeView instead if you like the item-based API that much. Also, consider wrapping it up in your own model subclass with a sane API that suits your application, instead of filling and accessing your model from different places in otherwise unrelated code. This will make it easier to swap out the QStandardItemModel based model for a custom model later on if needed.

André

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to