KRunner::Action

Search for usage in LXR

KRunner::Action Class Referencefinal

#include <action.h>

Properties

QString iconSource
 
QString text
 

Public Member Functions

 Action ()
 
 Action (const KRunner::Action &other)
 
 Action (const QString &id, const QString &iconSource, const QString &text)
 
QString iconSource () const
 
QString id () const
 
 operator bool () const
 
Actionoperator= (const Action &other)
 
bool operator== (const KRunner::Action &other) const
 
QString text () const
 

Detailed Description

This class represents an action that will be shown next to a match.

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.

Since
6.0

Definition at line 22 of file action.h.

Property Documentation

◆ iconSource

QString KRunner::Action::iconSource
read

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

Definition at line 28 of file action.h.

◆ text

QString KRunner::Action::text
read

User-visible text.

Definition at line 26 of file action.h.

Constructor & Destructor Documentation

◆ Action() [1/3]

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

Constructs a new action.

Parameters
idID which identifies the action uniquely within the context of the respective runner plugin
iconSourcename for the icon, that can be passed in to QIcon::fromTheme or file path/URL

Definition at line 25 of file action.cpp.

◆ Action() [2/3]

Action::Action ( )

Empty constructor creating invalid action.

Definition at line 33 of file action.cpp.

◆ Action() [3/3]

Action::Action ( const KRunner::Action & other)

Copy constructor.

Definition at line 29 of file action.cpp.

Member Function Documentation

◆ iconSource()

QString Action::iconSource ( ) const

Definition at line 53 of file action.cpp.

◆ id()

QString Action::id ( ) const

Definition at line 45 of file action.cpp.

◆ operator bool()

KRunner::Action::operator bool ( ) const
inlineexplicit

Check if the action is valid.

Definition at line 51 of file action.h.

◆ operator=()

Action & Action::operator= ( const Action & other)

Definition at line 39 of file action.cpp.

◆ operator==()

bool KRunner::Action::operator== ( const KRunner::Action & other) const
inline

Definition at line 56 of file action.h.

◆ text()

QString Action::text ( ) const

Definition at line 49 of file action.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:02:26 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.