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

KIO

  • 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
30class QAbstractItemModel;
31class QAbstractItemView;
32class QHelpEvent;
33class QModelIndex;
34class QPainter;
35
36
67class 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
94
102 Q_PROPERTY(QPointF shadowOffset READ shadowOffset WRITE setShadowOffset)
103
104
112 Q_PROPERTY(qreal shadowBlur READ shadowBlur WRITE setShadowBlur)
113
114
119 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
120
121
128 Q_PROPERTY(bool showToolTipWhenElided READ showToolTipWhenElided WRITE setShowToolTipWhenElided)
129
130
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;
KFileItemDelegate
KFileItemDelegate is intended to be used to provide a KDE file system view, when using one of the sta...
Definition: kfileitemdelegate.h:68
KFileItemDelegate::InformationList
QList< Information > InformationList
Definition: kfileitemdelegate.h:179
KFileItemDelegate::Information
Information
This enum defines the additional information that can be displayed below item labels in icon views.
Definition: kfileitemdelegate.h:162
KFileItemDelegate::OctalPermissions
@ OctalPermissions
The permissions as an octal value, e.g. 0644.
Definition: kfileitemdelegate.h:166
KFileItemDelegate::OwnerAndGroup
@ OwnerAndGroup
The user and group that owns the file, e.g. root:root.
Definition: kfileitemdelegate.h:168
KFileItemDelegate::LocalPathOrUrl
@ LocalPathOrUrl
The local path to the file or the URL in case it is not a local file.
Definition: kfileitemdelegate.h:175
KFileItemDelegate::AccessTime
@ AccessTime
The date and time the file/folder was last accessed.
Definition: kfileitemdelegate.h:171
KFileItemDelegate::FriendlyMimeType
@ FriendlyMimeType
The descriptive name for the mime type, e.g. HTML Document.
Definition: kfileitemdelegate.h:173
KFileItemDelegate::CreationTime
@ CreationTime
The date and time the file/folder was created.
Definition: kfileitemdelegate.h:169
KFileItemDelegate::ModificationTime
@ ModificationTime
The date and time the file/folder was last modified.
Definition: kfileitemdelegate.h:170
KFileItemDelegate::Permissions
@ Permissions
A UNIX permissions string, e.g. -rwxr-xr-x.
Definition: kfileitemdelegate.h:165
KFileItemDelegate::Size
@ Size
The file size for files, and the number of items for folders.
Definition: kfileitemdelegate.h:164
KFileItemDelegate::MimeType
@ MimeType
The mime type for the item, e.g. text/html.
Definition: kfileitemdelegate.h:172
KFileItemDelegate::LinkDest
@ LinkDest
The destination of a symbolic link.
Definition: kfileitemdelegate.h:174
KFileItemDelegate::NoInformation
@ NoInformation
No additional information will be shown for items.
Definition: kfileitemdelegate.h:163
KFileItemDelegate::Owner
@ Owner
The user name of the file owner, e.g. root.
Definition: kfileitemdelegate.h:167
QAbstractItemDelegate
QAbstractItemModel
QList< Information >
QObject
QWidget
global.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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