• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDEUI

kextendableitemdelegate.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2006,2007 Andreas Hartmetz (ahartmetz@gmail.com)
00003     Copyright (C) 2008 Urs Wolfer (uwolfer @ kde.org)
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public License
00016     along with this library; see the file COPYING.LIB.  If not, write to
00017     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018     Boston, MA 02110-1301, USA.
00019 */
00020 
00021 
00022 #ifndef KEXTENDABLEITEMDELEGATE_H
00023 #define KEXTENDABLEITEMDELEGATE_H
00024 
00025 #include <QtGui/QStyledItemDelegate>
00026 
00027 #include <kdeui_export.h>
00028 
00049 class QAbstractItemView;
00050 
00051 class KDEUI_EXPORT KExtendableItemDelegate : public QStyledItemDelegate {
00052     Q_OBJECT
00053 
00054 public:
00055     enum auxDataRoles {ShowExtensionIndicatorRole = Qt::UserRole + 200};
00056 
00062     KExtendableItemDelegate(QAbstractItemView *parent);
00063     virtual ~KExtendableItemDelegate();
00064 
00068     virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00069 
00073     virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00074 
00080     void extendItem(QWidget *extender, const QModelIndex &index);
00081 
00086     void contractItem(const QModelIndex &index);
00087 
00091     void contractAll();
00092 
00096     bool isExtended(const QModelIndex &index) const;
00097 
00102     virtual void updateExtenderGeometry(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00103 
00104 Q_SIGNALS:
00108     void extenderCreated(QWidget *extender, const QModelIndex &index);
00109 
00113     void extenderDestroyed(QWidget *extender, const QModelIndex &index);
00114 
00115 protected:
00122     QRect extenderRect(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00123 
00127     void setExtendPixmap(const QPixmap &pixmap);
00128 
00132     void setContractPixmap(const QPixmap &pixmap);
00133 
00137     QPixmap extendPixmap();
00138 
00142     QPixmap contractPixmap();
00143 
00144 
00145 private:
00146     class Private;
00147     Private *const d;
00148 
00149     Q_PRIVATE_SLOT(d, void _k_extenderDestructionHandler(QObject *destroyed))
00150     Q_PRIVATE_SLOT(d, void _k_verticalScroll())
00151 };
00152 #endif // KEXTENDABLEITEMDELEGATE_H

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal