Pages
API Documentation
On this page

KCursorSaver Class

Class to temporarily set a mouse cursor and restore the previous one on destruction. More...

  • Header: #include <KCursorSaver>
  • CMake: find_package(KF6 REQUIRED COMPONENTS GuiAddons)
    target_link_libraries(mytarget PRIVATE KF6::GuiAddons)

List of all members, including inherited members

Public Functions

Detailed Description

Create a KCursorSaver object when you want to set the cursor. As soon as it gets out of scope, it will restore the original cursor.

KCursorSaver saver(Qt::WaitCursor);
... long-running operation here ...

Member Function Documentation

[explicit] KCursorSaver::KCursorSaver(Qt::CursorShape shape)

Creates a KCursorSaver, setting the mouse cursor to shape.

[noexcept] KCursorSaver::~KCursorSaver()

restore the cursor

void KCursorSaver::restoreCursor()

call this to explicitly restore the cursor

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