File indexing completed on 2025-01-18 10:09:32
0001
0002
0003
0004 #ifndef QCOLUMNVIEW_H
0005 #define QCOLUMNVIEW_H
0006
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qabstractitemview.h>
0009
0010 QT_REQUIRE_CONFIG(columnview);
0011
0012 QT_BEGIN_NAMESPACE
0013
0014 class QColumnViewPrivate;
0015
0016 class Q_WIDGETS_EXPORT QColumnView : public QAbstractItemView {
0017
0018 Q_OBJECT
0019 Q_PROPERTY(bool resizeGripsVisible READ resizeGripsVisible WRITE setResizeGripsVisible)
0020
0021 Q_SIGNALS:
0022 void updatePreviewWidget(const QModelIndex &index);
0023
0024 public:
0025 explicit QColumnView(QWidget *parent = nullptr);
0026 ~QColumnView();
0027
0028
0029 QModelIndex indexAt(const QPoint &point) const override;
0030 void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
0031 QSize sizeHint() const override;
0032 QRect visualRect(const QModelIndex &index) const override;
0033 void setModel(QAbstractItemModel *model) override;
0034 void setSelectionModel(QItemSelectionModel * selectionModel) override;
0035 void setRootIndex(const QModelIndex &index) override;
0036 void selectAll() override;
0037
0038
0039 void setResizeGripsVisible(bool visible);
0040 bool resizeGripsVisible() const;
0041
0042 QWidget *previewWidget() const;
0043 void setPreviewWidget(QWidget *widget);
0044
0045 void setColumnWidths(const QList<int> &list);
0046 QList<int> columnWidths() const;
0047
0048 protected:
0049 QColumnView(QColumnViewPrivate &dd, QWidget *parent = nullptr);
0050
0051
0052 bool isIndexHidden(const QModelIndex &index) const override;
0053 QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
0054 void resizeEvent(QResizeEvent *event) override;
0055 void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command) override;
0056 QRegion visualRegionForSelection(const QItemSelection &selection) const override;
0057 int horizontalOffset() const override;
0058 int verticalOffset() const override;
0059 void rowsInserted(const QModelIndex &parent, int start, int end) override;
0060 void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override;
0061
0062
0063 void scrollContentsBy(int dx, int dy) override;
0064 virtual QAbstractItemView* createColumn(const QModelIndex &rootIndex);
0065 void initializeColumn(QAbstractItemView *column) const;
0066
0067 private:
0068 Q_DECLARE_PRIVATE(QColumnView)
0069 Q_DISABLE_COPY(QColumnView)
0070 };
0071
0072 QT_END_NAMESPACE
0073
0074 #endif
0075