class KFileItemDelegate |
|
|
KFileItemDelegate is intended to be used to provide a KDE file system view, when using one of the standard item views in Qt with KDirModel. While primarily intended to be used with KDirModel, it uses Qt.DecorationRole and Qt.DisplayRole for the icons and text labels, just like QItemDelegate, and can thus be used with any standard model. When used with KDirModel however, KFileItemDelegate can change the way the display and/or decoration roles are drawn, based on properties of the file items. For example, if the file item is a symbolic link, it will use an italic font to draw the file name. KFileItemDelegate also supports showing additional information about the file items below the icon labels. Which information should be shown, if any, is controlled by the information property, which can be set by calling setAdditionalInformation(), and read by calling additionalInformation(). The default value for this property is NoInformation. To use KFileItemDelegate, instantiate an object from the delegate, and call setItemDelegate() in one of the standard item views in Qt:
QListView *listview = new QListView(this); KFileItemDelegate *delegate = new KFileItemDelegate(this); listview->setItemDelegate(delegate); |
|
Constructs a new KFileItemDelegate.
parent - The parent object for the delegate. |
|
Internal |
|
Returns the additional information that should be shown below item labels in icon views. |
|
Reimplemented from QAbstractItemDelegate. |
|
Reimplemented from QAbstractItemDelegate. |
|
Reimplemented from QAbstractItemDelegate. |
|
Paints the item indicated by index, using painter. The item will be drawn in the rectangle specified by option.rect. The correct size for that rectangle can be obtained by calling sizeHint(). This function will use the following data values if the model provides them for the item, in place of the values in option:
This function is reimplemented from QAbstractItemDelegate.
painter - The painter with which to draw the item. option - The style options that should be used when painting the item. index - The index to the item that should be painted. |
|
Sets the additional information that should be shown below below item labels in icon views.
information - The information that should be shown |
|
Reimplemented from QAbstractItemDelegate. |
|
Reimplemented from QAbstractItemDelegate. |
|
Returns the nominal size for the item referred to by index, given the provided options. If the model provides a valid Qt.FontRole and/or Qt.AlignmentRole for the item, those will be used instead of the ones specified in the style options. This function is reimplemented from QAbstractItemDelegate.
option - The style options that should be used when painting the item. index - The index to the item for which to return the size hint. |
|
Reimplemented from QAbstractItemDelegate. |
NoInformation | - | No additional information will be shown for items . | |
Size | - | The file size for files , and the number of items for folders . | |
Permissions | - | A UNIX permissions string , e . g . - rwxr - xr - x . | |
OctalPermissions | - | The permissions as an octal value , e . g . 0644. | |
Owner | - | The user name of the file owner , e . g . root | |
OwnerAndGroup | - | The user and group that owns the file , e . g . root : root | |
CreationTime | - | The date and time the file / folder was created . | |
ModificationTime | - | The date and time the file / folder was last modified . | |
AccessTime | - | The date and time the file / folder was last accessed . | |
MimeType | - | The mime type for the item , e . g . text / html . | |
FriendlyMimeType | - | The descriptive name for the mime type , e . g . HTML Document . |