Pages
API Documentation
On this page

KRunner::Action Class

This class represents an action that will be shown next to a match. This class was introduced in Qt 6.0. More...

  • Header: #include <KRunner/Action>
  • Since: Qt 6.0
  • CMake: find_package(KF6 REQUIRED COMPONENTS Runner)
    target_link_libraries(mytarget PRIVATE KF6::Runner)

List of all members, including inherited members

Properties

Public Functions

Detailed Description

The goal is to make it more reliable, because QIcon::fromTheme which is often needed in a QAction constructor is not thread safe. Also, it makes the API more consistent with the org.kde.krunner1 DBus interface and forces consumers to set an icon.

Property Documentation

[read-only] iconSource : const QString

Source for the icon: Name of the icon from a theme, file path or file URL

Access functions:

  • QString iconSource() const

[read-only] text : const QString

User-visible text

Access functions:

  • QString text() const

Member Function Documentation

Action::Action()

Empty constructor creating invalid action

[explicit] Action::Action(const QString &id, const QString &iconSource, const QString &text)

Constructs a new action

id ID which identifies the action uniquely within the context of the respective runner plugin

iconSource name for the icon, that can be passed in to QIcon::fromTheme or file path/URL

[explicit] Action::operator bool() const

Check if the action is valid

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