KRunner::Action Class
class KRunner::ActionThis class represents an action that will be shown next to a match. More...
Header: | #include <KRunner/Action> |
CMake: | find_package(KF6 REQUIRED COMPONENTS Runner) target_link_libraries(mytarget PRIVATE KF6::Runner) |
Since: | 6.0 |
Properties
- iconSource : const QString
- text : const QString
Public Functions
Action() | |
Action(const QString &id, const QString &iconSource, const QString &text) | |
QString | iconSource() const |
QString | text() const |
bool | operator bool() const |
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]
bool Action::operator bool() const
Check if the action is valid