Pages
API Documentation
On this page

KRecentFilesMenu Class

A menu that offers a set of recent files. More...

  • Header: #include <KRecentFilesMenu>
  • CMake: find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)
    target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons)
  • Inherits: QMenu

List of all members, including inherited members

Public Functions

Public Slots

Signals

Detailed Description

Member Function Documentation

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

[explicit] KRecentFilesMenu::KRecentFilesMenu(const QString &title, QWidget *parent = nullptr)

void KRecentFilesMenu::addUrl(const QUrl &url, const QString &name = QString())

Add URL to recent files list. This will enable this action.

url The URL of the file

name The user visible pretty name that appears before the URL

[slot] void KRecentFilesMenu::clearRecentFiles()

Clear recent files list.

See also recentFiles(), recentFilesChanged()

QString KRecentFilesMenu::group() const

The group the URLs are saved to/read from. Unless a group is specified by setGroup "RecentFiles" is used.

See also setGroup()

int KRecentFilesMenu::maximumItems() const

The maximum number of files this menu can hold.

When the maximum url count is reached and a new URL is added the oldest will be replaced.

By default maximum 10 URLs are shown.

See also setMaximumItems()

QList<QUrl> KRecentFilesMenu::recentFiles() const

List of URLs of recent files.

See also clearRecentFiles(), recentFilesChanged()

[signal] void KRecentFilesMenu::recentFilesChanged()

Emitted when the recent files list has been changed.

See also recentFiles(), clearRecentFiles()

void KRecentFilesMenu::removeUrl(const QUrl &url)

Remove a URL from the recent files list.

url The URL of the file

void KRecentFilesMenu::setGroup(const QString &group)

Specify a group for storing the URLs. This allows e.g. storing multiple types of recent files.

By default the group "RecentFiles" is used.

group the name of the group.

See also group()

void KRecentFilesMenu::setMaximumItems(size_t maximumItems)

Set the maximum URL count.

See also maximumItems()

[signal] void KRecentFilesMenu::urlTriggered(const QUrl &url)

Emitted when the user clicks on a file action.

Usually this should result in the specified URL being opened.

url The url associated with the triggered action.

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