KActivities::Info
#include <info.h>

Public Types | |
enum | Availability { Nothing = 0 , BasicInfo = 1 , Everything = 2 } |
enum | State { Invalid = 0 , Unknown = 1 , Running = 2 , Starting = 3 , Stopped = 4 , Stopping = 5 } |
Properties | |
QString | description |
QString | icon |
QString | id |
bool | isCurrent |
QString | name |
Info::State | state |
![]() | |
objectName | |
Signals | |
void | added () |
void | descriptionChanged (const QString &description) |
void | iconChanged (const QString &icon) |
void | infoChanged () |
void | isCurrentChanged (bool current) |
void | nameChanged (const QString &name) |
void | removed () |
void | started () |
void | stateChanged (KActivities::Info::State state) |
void | stopped () |
Public Member Functions | |
Info (const QString &activity, QObject *parent=nullptr) | |
Availability | availability () const |
QString | description () const |
QString | icon () const |
QString | id () const |
bool | isCurrent () const |
bool | isValid () const |
QString | name () const |
State | state () const |
QString | uri () const |
![]() | |
QObject (QObject *parent) | |
QBindable< QString > | bindableObjectName () |
bool | blockSignals (bool block) |
const QObjectList & | children () const const |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) const const |
bool | disconnect (const QObject *receiver, const char *method) const const |
void | dumpObjectInfo () const const |
void | dumpObjectTree () const const |
QList< QByteArray > | dynamicPropertyNames () const const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const |
QList< T > | findChildren (const QString &name, Qt::FindChildOptions options) const const |
QList< T > | findChildren (Qt::FindChildOptions options) const const |
bool | inherits (const char *className) const const |
void | installEventFilter (QObject *filterObj) |
bool | isQuickItemType () const const |
bool | isWidgetType () const const |
bool | isWindowType () const const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const const |
void | objectNameChanged (const QString &objectName) |
QObject * | parent () const const |
QVariant | property (const char *name) const const |
Q_CLASSINFO (Name, Value) | |
Q_EMIT Q_EMIT | |
Q_ENUM (...) | |
Q_ENUM_NS (...) | |
Q_ENUMS (...) | |
Q_FLAG (...) | |
Q_FLAG_NS (...) | |
Q_FLAGS (...) | |
Q_GADGET Q_GADGET | |
Q_GADGET_EXPORT (EXPORT_MACRO) | |
Q_INTERFACES (...) | |
Q_INVOKABLE Q_INVOKABLE | |
Q_MOC_INCLUDE Q_MOC_INCLUDE | |
Q_NAMESPACE Q_NAMESPACE | |
Q_NAMESPACE_EXPORT (EXPORT_MACRO) | |
Q_OBJECT Q_OBJECT | |
Q_PROPERTY (...) | |
Q_REVISION Q_REVISION | |
Q_SET_OBJECT_NAME (Object) | |
Q_SIGNAL Q_SIGNAL | |
Q_SIGNALS Q_SIGNALS | |
Q_SLOT Q_SLOT | |
Q_SLOTS Q_SLOTS | |
T | qobject_cast (const QObject *object) |
T | qobject_cast (QObject *object) |
QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setObjectName (QAnyStringView name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | setProperty (const char *name, QVariant &&value) |
bool | signalsBlocked () const const |
int | startTimer (int interval, Qt::TimerType timerType) |
int | startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType) |
QThread * | thread () const const |
Additional Inherited Members | |
![]() | |
QMetaObject::Connection | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type) |
QMetaObject::Connection | connect (const QObject *sender, PointerToMemberFunction signal, Functor functor) |
bool | disconnect (const QMetaObject::Connection &connection) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
bool | disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
![]() | |
typedef | QObjectList |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signal) |
bool | isSignalConnected (const QMetaMethod &signal) const const |
int | receivers (const char *signal) const const |
QObject * | sender () const const |
int | senderSignalIndex () const const |
virtual void | timerEvent (QTimerEvent *event) |
Detailed Description
This class provides info about an activity.
Most methods in it require a semantic backend running to function properly.
This class is not thread-safe.
- See also
- Consumer for info about activities
The API of the class is synchronous, but the most used properties are pre-fetched and cached. This means that, in order to get the least amount of d-bus related locks, you should declare long-lived instances of this class.
Before relying on the values retrieved by the class, make sure that the state is not Info::Unknown. You can get invalid data either because the service is not functioning properly (or at all) or because the class did not have enough time to synchronize the data with it.
For example, if this is the only existing instance of the Info class, the name method will return an empty string.
For example, this is wrong (works, but blocks):
Instances of the Info class should be long-lived. For example, members of the classes that use them, and you should listen for the changes in the provided properties.
- Since
- 4.5
Member Enumeration Documentation
◆ Availability
◆ State
Property Documentation
◆ description
◆ icon
◆ id
◆ isCurrent
◆ name
◆ state
Constructor & Destructor Documentation
◆ Info()
|
explicit |
◆ ~Info()
Member Function Documentation
◆ added
|
signal |
Emitted when the activity is added.
◆ availability()
◆ description()
- Returns
- the description of the activity
◆ descriptionChanged
|
signal |
Emitted when the description is changed.
◆ icon()
- Returns
- the icon of the activity. Icon can be a freedesktop.org name or a file path. Or empty if no icon is set.
◆ iconChanged
|
signal |
Emitted when the icon was changed.
◆ id()
◆ infoChanged
|
signal |
Links the specified resource to the activity.
- Parameters
-
resourceUri resource URI
- Note
- This method is asynchronous. It will return before the resource is actually linked to the activity. Unlinks the specified resource from the activity
- Parameters
-
resourceUri resource URI
- Note
- This method is asynchronous. It will return before the resource is actually unlinked from the activity.
- Returns
- whether a resource is linked to this activity
- Note
- This QFuture is not thread-based, you can not call synchronous methods like waitForFinished, cancel, pause on it.
- Since
- 5.0 Emitted when the activity's name, icon or some custom property is changed
◆ isCurrent()
◆ isCurrentChanged
|
signal |
Emitted when the activity becomes the current one, or when it stops being the current one.
◆ isValid()
◆ name()
- Returns
- the name of the activity
◆ nameChanged
|
signal |
Emitted when the name is changed.
◆ removed
|
signal |
Emitted when the activity is removed.
◆ started
|
signal |
Emitted when the activity is started.
◆ state()
◆ stateChanged
|
signal |
Emitted when the activity changes state.
- Parameters
-
state new state of the activity
◆ stopped
|
signal |
Emitted when the activity is stopped.
◆ uri()
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 4 2025 12:01:16 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.