Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qcolumnview.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QCOLUMNVIEW_H
5#define QCOLUMNVIEW_H
6
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qabstractitemview.h>
9
11
13
15
16class Q_WIDGETS_EXPORT QColumnView : public QAbstractItemView {
17
19 Q_PROPERTY(bool resizeGripsVisible READ resizeGripsVisible WRITE setResizeGripsVisible)
20
23
24public:
25 explicit QColumnView(QWidget *parent = nullptr);
27
28 // QAbstractItemView overloads
29 QModelIndex indexAt(const QPoint &point) const override;
30 void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override;
31 QSize sizeHint() const override;
32 QRect visualRect(const QModelIndex &index) const override;
34 void setSelectionModel(QItemSelectionModel * selectionModel) override;
35 void setRootIndex(const QModelIndex &index) override;
36 void selectAll() override;
37
38 // QColumnView functions
39 void setResizeGripsVisible(bool visible);
40 bool resizeGripsVisible() const;
41
44
45 void setColumnWidths(const QList<int> &list);
46 QList<int> columnWidths() const;
47
48protected:
49 QColumnView(QColumnViewPrivate &dd, QWidget *parent = nullptr);
50
51 // QAbstractItemView overloads
52 bool isIndexHidden(const QModelIndex &index) const override;
53 QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
55 void setSelection(const QRect & rect, QItemSelectionModel::SelectionFlags command) override;
57 int horizontalOffset() const override;
58 int verticalOffset() const override;
59 void rowsInserted(const QModelIndex &parent, int start, int end) override;
60 void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
61
62 // QColumnView functions
63 void scrollContentsBy(int dx, int dy) override;
64 virtual QAbstractItemView* createColumn(const QModelIndex &rootIndex);
66
67private:
68 Q_DECLARE_PRIVATE(QColumnView)
69 Q_DISABLE_COPY(QColumnView)
70};
71
73
74#endif // QCOLUMNVIEW_H
75
The QAbstractItemView class provides the basic functionality for item view classes.
CursorAction
This enum describes the different ways to navigate between items,.
ScrollHint
\value EnsureVisible Scroll to ensure that the item is visible.
int verticalOffset() const override
Returns the vertical offset of the view.
void setPreviewWidget(QWidget *widget)
void scrollContentsBy(int dx, int dy) override
QModelIndex indexAt(const QPoint &point) const override
Returns the model index of the item at the viewport coordinates point.
virtual QAbstractItemView * createColumn(const QModelIndex &rootIndex)
QColumnView(QWidget *parent=nullptr)
void selectAll() override
Selects all items in the view.
void setRootIndex(const QModelIndex &index) override
Sets the root item to the item at the given index.
QRegion visualRegionForSelection(const QItemSelection &selection) const override
Returns the region from the viewport of the items in the given selection.
QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override
Returns a QModelIndex object pointing to the next object in the view, based on the given cursorAction...
void setSelectionModel(QItemSelectionModel *selectionModel) override
Sets the current selection model to the given selectionModel.
QRect visualRect(const QModelIndex &index) const override
Returns the rectangle on the viewport occupied by the item at index.
void updatePreviewWidget(const QModelIndex &index)
void currentChanged(const QModelIndex &current, const QModelIndex &previous) override
This slot is called when a new item becomes the current item.
void setResizeGripsVisible(bool visible)
void rowsInserted(const QModelIndex &parent, int start, int end) override
This slot is called when rows are inserted.
void scrollTo(const QModelIndex &index, ScrollHint hint=EnsureVisible) override
Scrolls the view if necessary to ensure that the item at index is visible.
void resizeEvent(QResizeEvent *event) override
bool isIndexHidden(const QModelIndex &index) const override
Returns true if the item referred to by the given index is hidden in the view, otherwise returns fals...
QColumnView(QColumnViewPrivate &dd, QWidget *parent=nullptr)
void setColumnWidths(const QList< int > &list)
void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override
Applies the selection flags to the items in or touched by the rectangle, rect.
int horizontalOffset() const override
Returns the horizontal offset of the view.
QSize sizeHint() const override
void initializeColumn(QAbstractItemView *column) const
bool resizeGripsVisible() const
void setModel(QAbstractItemModel *model) override
Sets the model for the view to present.
QWidget * previewWidget() const
QList< int > columnWidths() const
\inmodule QtCore
\inmodule QtCore
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore\reentrant
Definition qrect.h:30
The QRegion class specifies a clip region for a painter.
Definition qregion.h:27
The QResizeEvent class contains event parameters for resize events.
Definition qevent.h:548
\inmodule QtCore
Definition qsize.h:25
The QWidget class is the base class of all user interface objects.
Definition qwidget.h:99
EGLImageKHR int int EGLuint64KHR * modifiers
QOpenGLWidget * widget
[1]
rect
[4]
Combined button and popup list for selecting options.
GLuint index
[2]
GLuint GLuint end
GLuint start
GLenum GLenum GLsizei void GLsizei void * column
struct _cl_event * event
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define QT_REQUIRE_CONFIG(feature)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
QSqlQueryModel * model
[16]
QList< int > list
[14]
QItemSelection * selection
[0]