Pages
API Documentation
On this page

KFileFilterCombo Class

File filter combo box. More...

  • Header: #include <KFileFilterCombo>
  • CMake: find_package(KF6 REQUIRED COMPONENTS KIO)
    target_link_libraries(mytarget PRIVATE KF6::KIOFileWidgets)
  • Inherits: KComboBox

List of all members, including inherited members

Public Functions

Signals

Detailed Description

Member Function Documentation

[explicit] KFileFilterCombo::KFileFilterCombo(QWidget *parent = nullptr)

Creates a new filter combo box.

parent The parent widget.

[since 6.0] KFileFilter KFileFilterCombo::currentFilter() const

The currently selected/active filter.

This function was introduced in Qt 6.0.

See also setCurrentFilter()

[since 6.0] KFileFilter KFileFilterCombo::defaultFilter() const

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

This function was introduced in Qt 6.0.

See also setDefaultFilter

[signal] void KFileFilterCombo::filterChanged()

This signal is emitted whenever the filter has been changed.

[since 6.0] QList<KFileFilter> KFileFilterCombo::filters() const

The current filters.

This is not necessarily the same as the list set by setFileFilters() since entries for "All files" and "All supported files" are added automatically as needed.

This function was introduced in Qt 6.0.

See also setFilters()

[since 6.0] void KFileFilterCombo::setCurrentFilter(const KFileFilter &filter)

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

This function was introduced in Qt 6.0.

See also currentFilter()

[since 6.0] void KFileFilterCombo::setDefaultFilter(const KFileFilter &filter)

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

By default, this is set to match all files.

This function was introduced in Qt 6.0.

See also defaultFilter

[since 6.0] void KFileFilterCombo::setFilters(const QList<KFileFilter> &filters, const KFileFilter &defaultFilter = KFileFilter())

Sets the filters to be used.

filters each item in the list corresponds to one item in the combobox. Entries for "All files" and "All supported files" are added automatically as needed.

defaultFilter if not empty this will be the by default active filter

This function was introduced in Qt 6.0.

See also filters()

bool KFileFilterCombo::showsAllTypes() const

Returns true if the filter's first item is the list of all MIME types

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.