KFileFilterCombo

KDE 4.7 PyKDE API Reference

- KDE's Python API

# KFileFilterCombo Class Reference

`from PyKDE4.kio import *`

Inherits: KComboBox → QComboBox → QWidget → QObject

## Detailed Description

## Signals
| filterChanged ()
## Methods
| __init__ (self, QWidget parent=0)
QString | currentFilter (self)
QString | defaultFilter (self)
bool | eventFilter (self, QObject a0, QEvent a1)
QStringList | filters (self)
bool | isMimeFilter (self)
| setCurrentFilter (self, QString filter)
| setDefaultFilter (self, QString filter)
| setFilter (self, QString filter)
| setMimeFilter (self, QStringList types, QString defaultType)
bool | showsAllTypes (self)

## Signal Documentation

filterChanged | ( |  | ) |

This signal is emitted whenever the filter has been changed.

Signal syntax:
  `QObject.connect(source, SIGNAL("filterChanged()"), target_slot)`

## Method Documentation

__init__ | ( | self, |
|  | QWidget | parent=0
| ) |  |  |

Creates a new filter combo box.

Parameters:

  | parent | The parent widget.

QString currentFilter | ( |  | self ) |

Returns:
  the current filter, either something like "*.cpp *.h" or the current mimetype, like "text/html", or a list of those, like " "text/html text/plain image/png", all separated with one space.

QString defaultFilter | ( |  | self ) |

Returns:
  the default filter, used when an empty filter is set.

See also:
  setDefaultFilter

bool eventFilter | ( | self, |
|  | QObject | a0,
|  | QEvent | a1
| ) |  |  |

QStringList filters | ( |  | self ) |

Returns:
  all filters (this can be a list of patterns or a list of mimetypes)

bool isMimeFilter | ( |  | self ) |

Returns true if the filter has been set using setMimeFilter().

Since:
  4.6.1

setCurrentFilter | ( | self, |
|  | QString | filter
| ) |  |  |

Sets the current filter. Filter must match one of the filter items passed before to this widget.

setDefaultFilter | ( | self, |
|  | QString | filter
| ) |  |  |

This method allows you to set a default-filter, that is used when an empty filter is set. Make sure you call this before calling setFilter().

By default, this is set to i18n("*|All Files")

See also:
  defaultFilter

setFilter | ( | self, |
|  | QString | filter
| ) |  |  |

Sets the filter string.

setMimeFilter | ( | self, |
|  | QStringList | types,
|  | QString | defaultType
| ) |  |  |

Sets a list of mimetypes. If defaultType is set, it will be set as the current item. Otherwise, a first item showing all the mimetypes will be created.

bool showsAllTypes | ( |  | self ) |

Returns:
  true if the filter's first item is the list of all mimetypes