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

KIO

  • sources
  • kde-4.14
  • kdelibs
  • kio
  • kio
kfileitemdelegate.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE project
3 
4  Copyright © 2006-2007, 2008 Fredrik Höglund <fredrik@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KFILEITEMDELEGATE_H
23 #define KFILEITEMDELEGATE_H
24 
25 #include <QtGui/QAbstractItemDelegate>
26 #include <QtGui/QTextOption>
27 #include <kio/global.h>
28 
29 
30 class QAbstractItemModel;
31 class QAbstractItemView;
32 class QHelpEvent;
33 class QModelIndex;
34 class QPainter;
35 
36 
67 class KIO_EXPORT KFileItemDelegate : public QAbstractItemDelegate
68 {
69  Q_OBJECT
70 
79  Q_PROPERTY(InformationList information READ showInformation WRITE setShowInformation)
80 
81 
92  Q_PROPERTY(QColor shadowColor READ shadowColor WRITE setShadowColor)
93 
102  Q_PROPERTY(QPointF shadowOffset READ shadowOffset WRITE setShadowOffset)
103 
112  Q_PROPERTY(qreal shadowBlur READ shadowBlur WRITE setShadowBlur)
113 
119  Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
120 
128  Q_PROPERTY(bool showToolTipWhenElided READ showToolTipWhenElided WRITE setShowToolTipWhenElided)
129 
135  Q_PROPERTY(bool jobTransfersVisible READ jobTransfersVisible WRITE setJobTransfersVisible)
136 
137  Q_ENUMS(Information)
138 
139 
140  public:
162  enum Information {
163  NoInformation,
164  Size,
165  Permissions,
166  OctalPermissions,
167  Owner,
168  OwnerAndGroup,
169  CreationTime,
170  ModificationTime,
171  AccessTime,
172  MimeType,
173  FriendlyMimeType,
174  LinkDest,
175  LocalPathOrUrl,
176  Comment
177  };
178 
179  typedef QList<Information> InformationList;
180 
181 
187  explicit KFileItemDelegate(QObject *parent = 0);
188 
189 
193  virtual ~KFileItemDelegate();
194 
195 
208  virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
209 
210 
232  virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
233 
234 
238  virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
239 
240 
244  virtual bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem & option, const QModelIndex &index);
245 
246 
250  virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
251 
252 
256  virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
257 
258 
262  virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,const QModelIndex &index) const;
263 
264 
281  void setShowInformation(const InformationList &list);
282 
283 
292  void setShowInformation(Information information);
293 
294 
298  InformationList showInformation() const;
299 
300 
309  void setShadowColor(const QColor &color);
310 
311 
317  QColor shadowColor() const;
318 
319 
325  void setShadowOffset(const QPointF &offset);
326 
327 
333  QPointF shadowOffset() const;
334 
335 
341  void setShadowBlur(qreal radius);
342 
343 
349  qreal shadowBlur() const;
350 
357  void setMaximumSize(const QSize &size);
358 
365  QSize maximumSize() const;
366 
377  void setShowToolTipWhenElided(bool showToolTip);
378 
389  bool showToolTipWhenElided() const;
390 
396  QRect iconRect(const QStyleOptionViewItem &option, const QModelIndex &index) const;
397 
404  void setWrapMode(QTextOption::WrapMode wrapMode);
405 
412  QTextOption::WrapMode wrapMode() const;
413 
430  void setJobTransfersVisible(bool jobTransfersVisible);
431 
437  bool jobTransfersVisible() const;
438 
442  virtual bool eventFilter(QObject *object, QEvent *event);
443 
444  public Q_SLOTS:
448  bool helpEvent(QHelpEvent * event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index);
449 
454  QRegion shape(const QStyleOptionViewItem &option, const QModelIndex &index);
455 
456  private:
457  class Private;
458  Private * const d;
459  Q_DISABLE_COPY(KFileItemDelegate)
460 };
461 
462 #endif // KFILEITEMDELEGATE_H
463 
464 // kate: space-indent on; indent-width 4; replace-tabs on;
QModelIndex
QEvent
QWidget
KFileItemDelegate::LinkDest
The destination of a symbolic link.
Definition: kfileitemdelegate.h:174
QAbstractItemView
KFileItemDelegate::LocalPathOrUrl
The local path to the file or the URL in case it is not a local file.
Definition: kfileitemdelegate.h:175
KFileItemDelegate::AccessTime
The date and time the file/folder was last accessed.
Definition: kfileitemdelegate.h:171
KFileItemDelegate::OctalPermissions
The permissions as an octal value, e.g. 0644.
Definition: kfileitemdelegate.h:166
KFileItemDelegate::Owner
The user name of the file owner, e.g. root.
Definition: kfileitemdelegate.h:167
QAbstractItemDelegate::createEditor
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
KFileItemDelegate::InformationList
QList< Information > InformationList
Definition: kfileitemdelegate.h:179
global.h
KFileItemDelegate::OwnerAndGroup
The user and group that owns the file, e.g. root:root.
Definition: kfileitemdelegate.h:168
KFileItemDelegate::Information
Information
This enum defines the additional information that can be displayed below item labels in icon views...
Definition: kfileitemdelegate.h:162
QPointF
QRect
QAbstractItemDelegate::updateEditorGeometry
virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const
QStyleOptionViewItem
QObject
QPainter
KFileItemDelegate::NoInformation
No additional information will be shown for items.
Definition: kfileitemdelegate.h:163
QObject::eventFilter
virtual bool eventFilter(QObject *watched, QEvent *event)
QList
QColor
QAbstractItemDelegate::editorEvent
virtual bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index)
QAbstractItemDelegate::setEditorData
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const
QAbstractItemDelegate::paint
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const =0
KFileItemDelegate::FriendlyMimeType
The descriptive name for the mime type, e.g. HTML Document.
Definition: kfileitemdelegate.h:173
QSize
QAbstractItemDelegate::helpEvent
bool helpEvent(QHelpEvent *event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index)
KFileItemDelegate::CreationTime
The date and time the file/folder was created.
Definition: kfileitemdelegate.h:169
KFileItemDelegate::MimeType
The mime type for the item, e.g. text/html.
Definition: kfileitemdelegate.h:172
KFileItemDelegate::ModificationTime
The date and time the file/folder was last modified.
Definition: kfileitemdelegate.h:170
KFileItemDelegate
KFileItemDelegate is intended to be used to provide a KDE file system view, when using one of the sta...
Definition: kfileitemdelegate.h:67
QAbstractItemDelegate::sizeHint
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const =0
QAbstractItemModel
KFileItemDelegate::Size
The file size for files, and the number of items for folders.
Definition: kfileitemdelegate.h:164
KFileItemDelegate::Permissions
A UNIX permissions string, e.g. -rwxr-xr-x.
Definition: kfileitemdelegate.h:165
QAbstractItemDelegate::setModelData
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
QHelpEvent
QRegion
KRecentDirs::list
QStringList list(const QString &fileClass)
Returns a list of directories associated with this file-class.
Definition: krecentdirs.cpp:60
QAbstractItemDelegate
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:24:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KIO

Skip menu "KIO"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • 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