Details
-
Bug
-
Resolution: Fixed
-
Not Evaluated
-
None
-
6.7.2
-
None
-
Win11 MSVC
Description
When directly subclassing QAbstractItemModel, HorizontalHeaderView does not call headerData(). However, by subclassing QAbstractTableModel, it can fetch data correctly.
I quote from the documentation: "If you assign a model that is a QAbstractItemModel, its header data will be used. Otherwise, the data in the model will be used directly (for instance, if you assign a model that's simply an array of strings)."
Here is the result when subclassing from QAbstractItemModel:
And the results when inheriting from QAbstractTableModel:
Please download the attachment and replicate the problem.
Attachments
Issue Links
- duplicates
-
QTBUG-120315 HorizontalHeaderView displaying c++ headerData not working
-
- Closed
-