Pages
API Documentation
On this page

KSystemInhibitor Class

Inhibit system actions such as logout, suspend, etc. This class was introduced in Qt 6.23. More...

  • Header: #include <KSystemInhibitor>
  • Since: Qt 6.23
  • CMake: find_package(KF6 REQUIRED COMPONENTS GuiAddons)
    target_link_libraries(mytarget PRIVATE KF6::GuiAddons)
  • Inherits: QObject

List of all members, including inherited members

Public Types

Public Functions

Detailed Description

Member Type Documentation

enum 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

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.