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.