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

Plasma

delegate.h

Go to the documentation of this file.
00001 /*
00002     Copyright 2007 Robert Knight <robertknight@gmail.com>
00003     Copyright 2008 Marco Martin <notmart@gmail.com>
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 #ifndef PLASMA_DELEGATE_H
00022 #define PLASMA_DELEGATE_H
00023 
00024 // Qt
00025 #include <QtGui/QAbstractItemDelegate>
00026 
00027 // Plasma
00028 #include <plasma/plasma_export.h>
00029 
00030 namespace Plasma
00031 {
00032 
00033 class DelegatePrivate;
00034 
00048 class PLASMA_EXPORT Delegate : public QAbstractItemDelegate
00049 {
00050     Q_OBJECT
00051 public:
00052 
00053     enum SpecificRoles {
00054         SubTitleRole = Qt::UserRole + 1,
00055         SubTitleMandatoryRole = Qt::UserRole + 2,
00056         ColumnTypeRole = Qt::UserRole + 3
00057     };
00058 
00059     enum ColumnType {
00060         MainColumn = 1,
00061         SecondaryActionColumn = 2
00062     };
00063 
00064     Delegate(QObject *parent = 0);
00065     ~Delegate();
00066 
00074     void setRoleMapping(SpecificRoles role, int actual);
00075 
00076     int roleMapping(SpecificRoles role) const;
00077 
00078     //Reimplemented
00079     virtual void paint(QPainter *painter, const QStyleOptionViewItem &option,
00080                        const QModelIndex &index) const;
00081 
00085     bool showToolTip() const;
00086 
00087 protected:
00097     QRect rectAfterTitle(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00098 
00107     QRect rectAfterSubTitle(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00108 
00117     QRect emptyRect(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00118 
00119     virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00120 
00121 private:
00122     DelegatePrivate *const d;
00123 };
00124 
00125 }
00126 
00127 #endif // PLASMA_DELEGATE_H

Plasma

Skip menu "Plasma"
  • Main Page
  • 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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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