ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cvMultiColumnHeaderView.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #ifndef CV_MULTI_COLUMN_HEADER_VIEW_H
9 #define CV_MULTI_COLUMN_HEADER_VIEW_H
10 
11 #include <QHeaderView>
12 #include <QPair>
13 
33 class cvMultiColumnHeaderView : public QHeaderView {
34  Q_OBJECT
35  typedef QHeaderView Superclass;
36 
37 public:
38  cvMultiColumnHeaderView(Qt::Orientation orientation,
39  QWidget* parent = nullptr);
41 
42 protected:
43  void paintSection(QPainter* painter,
44  const QRect& rect,
45  int logicalIndex) const override;
46 
47 private:
48  QPair<int, int> sectionSpan(int visualIndex) const;
49  QString sectionDisplayText(int logicalIndex) const;
50 
51  Q_DISABLE_COPY(cvMultiColumnHeaderView)
52 };
53 
54 #endif // CV_MULTI_COLUMN_HEADER_VIEW_H
QHeaderView that supports showing multiple sections as one.
cvMultiColumnHeaderView(Qt::Orientation orientation, QWidget *parent=nullptr)
void paintSection(QPainter *painter, const QRect &rect, int logicalIndex) const override
~cvMultiColumnHeaderView() override