KIO
defaultviewadapter.cpp
Go to the documentation of this file.
00001 /******************************************************************************* 00002 * Copyright (C) 2008 by Peter Penz <peter.penz@gmx.at> * 00003 * * 00004 * This library is free software; you can redistribute it and/or * 00005 * modify it under the terms of the GNU Library General Public * 00006 * License as published by the Free Software Foundation; either * 00007 * version 2 of the License, or (at your option) any later version. * 00008 * * 00009 * This library is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00012 * Library General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU Library General Public License * 00015 * along with this library; see the file COPYING.LIB. If not, write to * 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00017 * Boston, MA 02110-1301, USA. * 00018 *******************************************************************************/ 00019 00020 #include "defaultviewadapter_p.h" 00021 #include "kmimetyperesolver.h" 00022 00023 #include <QAbstractItemView> 00024 #include <QScrollBar> 00025 00026 namespace KIO 00027 { 00028 00029 DefaultViewAdapter::DefaultViewAdapter(QAbstractItemView* view, QObject* parent) : 00030 KAbstractViewAdapter(parent), 00031 m_view(view) 00032 { 00033 } 00034 00035 QAbstractItemModel *DefaultViewAdapter::model() const 00036 { 00037 return m_view->model(); 00038 } 00039 00040 QSize DefaultViewAdapter::iconSize() const 00041 { 00042 return m_view->iconSize(); 00043 } 00044 00045 QPalette DefaultViewAdapter::palette() const 00046 { 00047 return m_view->palette(); 00048 } 00049 00050 QRect DefaultViewAdapter::visibleArea() const 00051 { 00052 return m_view->viewport()->rect(); 00053 } 00054 00055 QRect DefaultViewAdapter::visualRect(const QModelIndex& index) const 00056 { 00057 return m_view->visualRect(index); 00058 } 00059 00060 void DefaultViewAdapter::connect(Signal signal, QObject* receiver, const char* slot) 00061 { 00062 if (signal == ScrollBarValueChanged) { 00063 QObject::connect(m_view->horizontalScrollBar(), SIGNAL(valueChanged(int)), receiver, slot); 00064 QObject::connect(m_view->verticalScrollBar(), SIGNAL(valueChanged(int)), receiver, slot); 00065 } 00066 } 00067 00068 } 00069
KDE 4.6 API Reference