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

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • itemviews
kextendableitemdelegate.h
Go to the documentation of this file.
1 /* This file is part of the KDE libraries
2  Copyright (C) 2006,2007 Andreas Hartmetz (ahartmetz@gmail.com)
3  Copyright (C) 2008 Urs Wolfer (uwolfer @ kde.org)
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License as published by the Free Software Foundation; either
8  version 2 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 
22 #ifndef KEXTENDABLEITEMDELEGATE_H
23 #define KEXTENDABLEITEMDELEGATE_H
24 
25 #include <QtGui/QStyledItemDelegate>
26 
27 #include <kdeui_export.h>
28 
49 class QAbstractItemView;
50 
51 class KDEUI_EXPORT KExtendableItemDelegate : public QStyledItemDelegate {
52  Q_OBJECT
53 
54 public:
55  enum auxDataRoles {ShowExtensionIndicatorRole = Qt::UserRole + 200};
56 
62  KExtendableItemDelegate(QAbstractItemView *parent);
63  virtual ~KExtendableItemDelegate();
64 
68  virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
69 
73  virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
74 
81  void extendItem(QWidget *extender, const QModelIndex &index);
82 
87  void contractItem(const QModelIndex &index);
88 
92  void contractAll();
93 
97  bool isExtended(const QModelIndex &index) const;
98 
103  virtual void updateExtenderGeometry(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const;
104 
105 Q_SIGNALS:
109  void extenderCreated(QWidget *extender, const QModelIndex &index);
110 
114  void extenderDestroyed(QWidget *extender, const QModelIndex &index);
115 
116 protected:
123  QRect extenderRect(QWidget *extender, const QStyleOptionViewItem &option, const QModelIndex &index) const;
124 
128  void setExtendPixmap(const QPixmap &pixmap);
129 
133  void setContractPixmap(const QPixmap &pixmap);
134 
138  QPixmap extendPixmap();
139 
143  QPixmap contractPixmap();
144 
145 
146 private:
147  class Private;
148  Private *const d;
149 
150  Q_PRIVATE_SLOT(d, void _k_extenderDestructionHandler(QObject *destroyed))
151  Q_PRIVATE_SLOT(d, void _k_verticalScroll())
152 };
153 #endif // KEXTENDABLEITEMDELEGATE_H
QModelIndex
QWidget
QAbstractItemView
KExtendableItemDelegate
Definition: kextendableitemdelegate.h:51
QRect
QStyleOptionViewItem
QObject
QStyledItemDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
QPainter
QStyledItemDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
KExtendableItemDelegate::auxDataRoles
auxDataRoles
Definition: kextendableitemdelegate.h:55
QPixmap
QSize
kdeui_export.h
QStyledItemDelegate
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal