1
/****************************************************************************
3
** Copyright (C) 1992-2005 Trolltech AS. All rights reserved.
5
** This file is part of the item views module of the Qt Toolkit.
7
** This file may be distributed under the terms of the Q Public License
8
** as defined by Trolltech AS of Norway and appearing in the file
9
** LICENSE.QPL included in the packaging of this file.
11
** This file may be distributed and/or modified under the terms of the
12
** GNU General Public License version 2 as published by the Free Software
13
** Foundation and appearing in the file LICENSE.GPL included in the
14
** packaging of this file.
16
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
17
** information about Qt Commercial License Agreements.
18
** See http://www.trolltech.com/qpl/ for QPL licensing information.
19
** See http://www.trolltech.com/gpl/ for GPL licensing information.
21
** Contact info@trolltech.com if any conditions of this licensing are
24
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
25
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27
****************************************************************************/
32
#include <QtGui/qabstractitemview.h>
34
class QListViewPrivate;
36
class Q_GUI_EXPORT QListView : public QAbstractItemView
39
Q_ENUMS(Movement Flow ResizeMode LayoutMode ViewMode)
40
Q_PROPERTY(Movement movement READ movement WRITE setMovement)
41
Q_PROPERTY(Flow flow READ flow WRITE setFlow)
42
Q_PROPERTY(bool isWrapping READ isWrapping WRITE setWrapping)
43
Q_PROPERTY(ResizeMode resizeMode READ resizeMode WRITE setResizeMode)
44
Q_PROPERTY(LayoutMode layoutMode READ layoutMode WRITE setLayoutMode)
45
Q_PROPERTY(int spacing READ spacing WRITE setSpacing)
46
Q_PROPERTY(QSize gridSize READ gridSize WRITE setGridSize)
47
Q_PROPERTY(ViewMode viewMode READ viewMode WRITE setViewMode)
48
Q_PROPERTY(int modelColumn READ modelColumn WRITE setModelColumn)
51
enum Movement { Static, Free, Snap };
52
enum Flow { LeftToRight, TopToBottom };
53
enum ResizeMode { Fixed, Adjust };
54
enum LayoutMode { SinglePass, Batched };
55
enum ViewMode { ListMode, IconMode };
57
explicit QListView(QWidget *parent = 0);
60
void setMovement(Movement movement);
61
Movement movement() const;
63
void setFlow(Flow flow);
66
void setWrapping(bool enable);
67
bool isWrapping() const;
69
void setResizeMode(ResizeMode mode);
70
ResizeMode resizeMode() const;
72
void setLayoutMode(LayoutMode mode);
73
LayoutMode layoutMode() const;
75
void setSpacing(int space);
78
void setGridSize(const QSize &size);
79
QSize gridSize() const;
81
void setViewMode(ViewMode mode);
82
ViewMode viewMode() const;
84
void clearPropertyFlags();
86
bool isRowHidden(int row) const;
87
void setRowHidden(int row, bool hide);
89
void setModelColumn(int column);
90
int modelColumn() const;
92
QRect visualRect(const QModelIndex &index) const;
93
void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible);
94
QModelIndex indexAt(const QPoint &p) const;
98
void setRootIndex(const QModelIndex &index);
101
QListView(QListViewPrivate &, QWidget *parent = 0);
103
void scrollContentsBy(int dx, int dy);
105
void resizeContents(int width, int height);
106
QSize contentsSize() const;
108
void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
109
void rowsInserted(const QModelIndex &parent, int start, int end);
110
void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end);
112
void mouseMoveEvent(QMouseEvent *e);
113
void mouseReleaseEvent(QMouseEvent *e);
115
void timerEvent(QTimerEvent *e);
116
void resizeEvent(QResizeEvent *e);
117
void dragMoveEvent(QDragMoveEvent *e);
118
void dragLeaveEvent(QDragLeaveEvent *e);
119
void dropEvent(QDropEvent *e);
120
void startDrag(Qt::DropActions supportedActions);
122
void internalDrop(QDropEvent *e);
123
void internalDrag(Qt::DropActions supportedActions);
125
QStyleOptionViewItem viewOptions() const;
126
void paintEvent(QPaintEvent *e);
128
int horizontalOffset() const;
129
int verticalOffset() const;
130
QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers);
131
QRect rectForIndex(const QModelIndex &index) const;
133
void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command);
134
QRegion visualRegionForSelection(const QItemSelection &selection) const;
135
QModelIndexList selectedIndexes() const;
137
void updateGeometries();
139
bool isIndexHidden(const QModelIndex &index) const;
142
Q_DECLARE_PRIVATE(QListView)
143
Q_DISABLE_COPY(QListView)
146
#endif // QLISTVIEW_H