Details
-
Bug
-
Resolution: Invalid
-
P1: Critical
-
None
-
5.15.8, 6.2.4
Description
class CustomHeaderView : public QHeaderView { Q_OBJECT public: CustomHeaderView(Qt::Orientation orientation, QWidget *parent = nullptr) : QHeaderView(orientation, parent) {} } // ... QTableView view; view->setHorizontalHeader(new CustomHeaderView(Qt::Horizontal), &view);
This causes the following functionality to disappear:
- Hover effects
- Bold header text on selected column
- Clicking the header selects the whole column
Since no new behaviour was implemented and no methods were overridden, I would expect it to behave exactly like a vanilla QHeaderView.
EDIT: Actually not a bug. QTableView calls `setSectionsClickable(true)` and `setHighlightSections(true)` on the QHeaderViews upon initialization. Custom header views must do the same to retain the default behaviour.
Attachments
For Gerrit Dashboard: QTBUG-102034 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
402823,5 | QTableView: Document the customizations applied to QHeaderView | dev | qt/qtbase | Status: MERGED | +2 | 0 |
403004,2 | QTableView: Document the customizations applied to QHeaderView | 6.2 | qt/qtbase | Status: MERGED | +2 | 0 |
403005,2 | QTableView: Document the customizations applied to QHeaderView | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
403008,2 | QTableView: Document the customizations applied to QHeaderView | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |