2 Copyright 2007 Robert Knight <robertknight@gmail.com>
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
24 #include <QAbstractItemView>
29 class ItemStateProvider
;
30 class UrlItemView
: public QAbstractItemView
35 UrlItemView(QWidget
*parent
= 0);
36 virtual ~UrlItemView();
38 void setItemStateProvider(ItemStateProvider
*provider
);
39 ItemStateProvider
*itemStateProvider() const;
41 // reimplemented from QAbstractItemView
42 virtual QModelIndex
indexAt(const QPoint
& point
) const;
43 virtual void scrollTo(const QModelIndex
& index
, ScrollHint hint
= EnsureVisible
);
44 virtual QRect
visualRect(const QModelIndex
& index
) const;
45 virtual void setModel(QAbstractItemModel
*model
);
47 // reimplemented from QAbstractItemView
48 virtual int horizontalOffset() const;
49 virtual bool isIndexHidden(const QModelIndex
& index
) const;
50 virtual QModelIndex
moveCursor(CursorAction action
, Qt::KeyboardModifiers modifiers
);
51 virtual void setSelection(const QRect
& rect
, QItemSelectionModel::SelectionFlags flags
);
52 virtual int verticalOffset() const;
53 virtual QRegion
visualRegionForSelection(const QItemSelection
& selection
) const;
54 virtual void startDrag(Qt::DropActions supportedActions
);
55 virtual void dragEnterEvent(QDragEnterEvent
*event
);
56 virtual void dragLeaveEvent(QDragLeaveEvent
*event
);
57 virtual void dragMoveEvent(QDragMoveEvent
*event
);
59 // reimplemented from QWidget
60 virtual void paintEvent(QPaintEvent
*event
);
61 virtual void resizeEvent(QResizeEvent
*event
);
62 virtual void mouseMoveEvent(QMouseEvent
*event
);
63 virtual void mousePressEvent(QMouseEvent
*event
);
64 virtual void mouseReleaseEvent(QMouseEvent
*event
);
65 virtual void dropEvent(QDropEvent
*event
);
66 virtual void leaveEvent(QEvent
*event
);
70 // lays out all items in the view and sets the current index to the first
81 #endif // URLITEMVIEW_H