KIO

defaultviewadapter.cpp
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(m_view->horizontalScrollBar(), SIGNAL(valueChanged(int)), receiver, slot);
49 QObject::connect(m_view->verticalScrollBar(), SIGNAL(valueChanged(int)), receiver, slot);
50 }
51}
52
53}
54
55#include "moc_defaultviewadapter_p.cpp"
Interface used by KFilePreviewGenerator to generate previews for files.
A namespace for KIO globals.
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:58:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.