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 |
Public Types
Public Functions
| KSystemInhibitor(const QString &reason, KSystemInhibitor::Types types, QWindow *window, QObject *parent = nullptr) | |
| KSystemInhibitor(const KSystemInhibitor &) | |
| KSystemInhibitor(KSystemInhibitor &&) | |
| virtual | ~KSystemInhibitor() override |
| KSystemInhibitor & | operator=(KSystemInhibitor &&) |
| KSystemInhibitor & | operator=(const KSystemInhibitor &) |
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.
[delete] KSystemInhibitor::KSystemInhibitor(const KSystemInhibitor &)
Copy-constructs an instance of KSystemInhibitor. This function is deleted.
[delete] KSystemInhibitor::KSystemInhibitor(KSystemInhibitor &&)
Move-constructs an instance of KSystemInhibitor. This function is deleted.
[override virtual noexcept] KSystemInhibitor::~KSystemInhibitor()
Release inhibition
[delete] KSystemInhibitor &KSystemInhibitor::operator=(KSystemInhibitor &&)
Move-assigns other to this KSystemInhibitor instance. This function is deleted.
[delete] KSystemInhibitor &KSystemInhibitor::operator=(const KSystemInhibitor &)
Copy-assigns other to this KSystemInhibitor instance. This function is deleted.