1/*
2 SPDX-FileCopyrightText: 2008 Peter Penz <peter.penz@gmx.at>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "defaultviewadapter_p.h"
8
9#include <QAbstractItemView>
10#include <QScrollBar>
11
12namespace KIO
13{
14DefaultViewAdapter::DefaultViewAdapter(QAbstractItemView *view, QObject *parent)
15 : KAbstractViewAdapter(parent)
16 , m_view(view)
17{
18}
19
20QAbstractItemModel *DefaultViewAdapter::model() const
21{
22 return m_view->model();
23}
24
25QSize DefaultViewAdapter::iconSize() const
26{
27 return m_view->iconSize();
28}
29
30QPalette DefaultViewAdapter::palette() const
31{
32 return m_view->palette();
33}
34
35QRect DefaultViewAdapter::visibleArea() const
36{
37 return m_view->viewport()->rect();
38}
39
40QRect DefaultViewAdapter::visualRect(const QModelIndex &index) const
41{
42 return m_view->visualRect(index);
43}
44
45void DefaultViewAdapter::connect(Signal signal, QObject *receiver, const char *slot)
46{
47 if (signal == ScrollBarValueChanged) {
48 QObject::connect(sender: m_view->horizontalScrollBar(), SIGNAL(valueChanged(int)), receiver, member: slot);
49 QObject::connect(sender: m_view->verticalScrollBar(), SIGNAL(valueChanged(int)), receiver, member: slot);
50 }
51}
52
53}
54
55#include "moc_defaultviewadapter_p.cpp"
56

source code of kio/src/filewidgets/defaultviewadapter.cpp