KSystemInhibitor Class
Inhibit system actions such as logout, suspend, etc. More...
| Header: | #include <KSystemInhibitor> |
| CMake: | find_package(KF6 REQUIRED COMPONENTS GuiAddons)target_link_libraries(mytarget PRIVATE KF6::GuiAddons) |
| Since: | 6.23 |
| Inherits: | QObject |
Public Types
Public Functions
| KSystemInhibitor(const QString &reason, KSystemInhibitor::Types types, QWindow *window, QObject *parent = nullptr) | |
| virtual | ~KSystemInhibitor() override |
Detailed Description
Member Type Documentation
enum class KSystemInhibitor::Type
flags KSystemInhibitor::Types
Inhibition types.
| Constant | Value | Description |
|---|---|---|
KSystemInhibitor::Type::Logout | 1 | Inhibit logout/shutdown |
KSystemInhibitor::Type::UserSwitch | 2 | Inhibit user switching |
KSystemInhibitor::Type::Suspend | 4 | Inhibit suspend/hibernate |
KSystemInhibitor::Type::Idle | 8 | Inhibit idle actions (e.g. screen locking) |
The Types type is a typedef for QFlags<Type>. It stores an OR combination of Type values.
Member Function Documentation
KSystemInhibitor::KSystemInhibitor(const QString &reason, KSystemInhibitor::Types types, QWindow *window, QObject *parent = nullptr)
Claim inhibition.
reason is the user-visible reason for the inhibition.
types is a combination of inhibition types.
window is the window for which to apply the inhibition. May be null in which case possible user queries will not be associated with any window.
parent is the parent QObject.
[override virtual noexcept] KSystemInhibitor::~KSystemInhibitor()
Release inhibition