KIO
kfileitemdelegate.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KFILEITEMDELEGATE_H
00023 #define KFILEITEMDELEGATE_H
00024
00025 #include <QtGui/QAbstractItemDelegate>
00026 #include <kio/global.h>
00027
00028
00029 class QAbstractItemModel;
00030 class QAbstractItemView;
00031 class QHelpEvent;
00032 class QModelIndex;
00033 class QPainter;
00034
00035
00066 class KIO_EXPORT KFileItemDelegate : public QAbstractItemDelegate
00067 {
00068 Q_OBJECT
00069
00078 Q_PROPERTY(InformationList information READ showInformation WRITE setShowInformation)
00079
00080
00091 Q_PROPERTY(QColor shadowColor READ shadowColor WRITE setShadowColor)
00092
00101 Q_PROPERTY(QPointF shadowOffset READ shadowOffset WRITE setShadowOffset)
00102
00111 Q_PROPERTY(qreal shadowBlur READ shadowBlur WRITE setShadowBlur)
00112
00118 Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
00119
00120 Q_ENUMS(Information)
00121
00122
00123 public:
00145 enum Information {
00146 NoInformation,
00147 Size,
00148 Permissions,
00149 OctalPermissions,
00150 Owner,
00151 OwnerAndGroup,
00152 CreationTime,
00153 ModificationTime,
00154 AccessTime,
00155 MimeType,
00156 FriendlyMimeType
00157 };
00158
00159 typedef QList<Information> InformationList;
00160
00161
00167 explicit KFileItemDelegate(QObject *parent = 0);
00168
00169
00173 virtual ~KFileItemDelegate();
00174
00175
00188 virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00189
00190
00212 virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00213
00214
00218 virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00219
00220
00224 virtual bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem & option, const QModelIndex &index);
00225
00226
00230 virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
00231
00232
00236 virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
00237
00238
00242 virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,const QModelIndex &index) const;
00243
00244
00261 void setShowInformation(const InformationList &list);
00262
00263
00272 void setShowInformation(Information information);
00273
00274
00278 InformationList showInformation() const;
00279
00280
00289 void setShadowColor(const QColor &color);
00290
00291
00297 QColor shadowColor() const;
00298
00299
00305 void setShadowOffset(const QPointF &offset);
00306
00307
00313 QPointF shadowOffset() const;
00314
00315
00321 void setShadowBlur(qreal radius);
00322
00323
00329 qreal shadowBlur() const;
00330
00337 void setMaximumSize(const QSize &size);
00338
00345 QSize maximumSize() const;
00346
00350 virtual bool eventFilter(QObject *object, QEvent *event);
00351
00352
00353 public Q_SLOTS:
00357 bool helpEvent(QHelpEvent * event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index);
00358
00359
00360 private:
00361 class Private;
00362 Private * const d;
00363 Q_DISABLE_COPY(KFileItemDelegate)
00364 };
00365
00366 #endif // KFILEITEMDELEGATE_H
00367
00368