PDA

View Full Version : QStyledItemDelegate documentation is rather cryptic



pfeldman
30th October 2020, 22:25
I'm finding the QStyledItemDelegate documentation hard to follow. Part of this is because I use Python rather than C++. Part of the problem is that there isn't much explanation about the different abstract base class methods that can be overloaded, e.g., what they do, what their arguments mean, etc. Please consider a rewrite and expansion of this documentation!

ChrisW67
30th October 2020, 22:53
Please consider a rewrite and expansion of this documentation!
Qt Centre is not the author of the Qt library or its documentation. You need to be talking to The Qt Company (http://www.qt.io). You may be able to raise an issue asking for a rewrite.

Assuming a rewrite is not going to happen any time soon... are there specific issues you are having?

In general any method marked virtual in the docs is intended to be overridden if required in subclasses. Those also marked "= 0" (pure virtual) must be overridden in subclasses. This is C++ rather than Qt specific.
All the functions in QAbstractItemDelegate are virtual, and most will have been implemented in QStyledItemDelegate. The docs indicate which under the "Reimplemented" headings.

You should read Model/View programming (https://doc.qt.io/qt-5/model-view-programming.html), its section on delegates, and look at the examples listed at the bottom of that introduction.