KWin::QuickSceneEffect Class

Provides a convenient way to write fullscreen QtQuick-based effects. More...

Header: #include <effect/quickeffect.h>
CMake: find_package(KWin REQUIRED)
target_link_libraries(mytarget PRIVATE KWin::kwin)
Inherits: KWin::Effect

Properties

Public Functions

QuickSceneEffect(QObject *parent = nullptr)
void activateView(KWin::QuickSceneView *view)
KWin::QuickSceneView *activeView() const
QQmlComponent *delegate() const
KWin::QuickSceneView *getView(Qt::Edge edge)
bool isRunning() const
void loadFromModule(const QString &uri, const QString &typeName)
void setDelegate(QQmlComponent *delegate)
void setRunning(bool running)
void setSource(const QUrl &url)
QUrl source() const
KWin::QuickSceneView *viewAt(const QPoint &pos) const
KWin::QuickSceneView *viewForScreen(KWin::LogicalOutput *screen) const

Signals

void activeViewChanged(KWin::QuickSceneView *view)
void delegateChanged()

Protected Functions

virtual QVariantMap initialProperties(KWin::LogicalOutput *screen)

Detailed Description

Property Documentation

delegate : QQmlComponent*

The delegate provides a template defining the contents of each instantiated screen view

Access functions:

QQmlComponent *delegate() const
void setDelegate(QQmlComponent *delegate)

Notifier signal:

void delegateChanged()

Member Function Documentation

[explicit] QuickSceneEffect::QuickSceneEffect(QObject *parent = nullptr)

Constructs a QtQuick scene effect with the given parent.

[invokable] void QuickSceneEffect::activateView(KWin::QuickSceneView *view)

Sets the given view as active.

It will get a focusin event and all the other views will be set as inactive

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

KWin::QuickSceneView *QuickSceneEffect::activeView() const

Returns the active view. The active view is usually a view that the user interacted with last time.

[invokable] KWin::QuickSceneView *QuickSceneEffect::getView(Qt::Edge edge)

Get a view at the given direction from the active view

Returns null if no other views exist in the given direction

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[virtual protected] QVariantMap QuickSceneEffect::initialProperties(KWin::LogicalOutput *screen)

Reimplement this function to provide your initial properties for the scene view on the specified screen.

See also QQmlComponent::createWithInitialProperties().

bool QuickSceneEffect::isRunning() const

Returns true if the effect is running; otherwise returns false.

void QuickSceneEffect::loadFromModule(const QString &uri, const QString &typeName)

Use the QML component identified by uri and typename.

Note that the QML component will be loaded the next time the effect is started.

Cannot be called while the effect is running.

In order to provide your custom initial properties, you need to override the initialProperties() function.

void QuickSceneEffect::setRunning(bool running)

Starts or stops the effect depending on running.

See also isRunning().

void QuickSceneEffect::setSource(const QUrl &url)

Sets the source url to url.

Note that the QML component will be loaded the next time the effect is started.

While the effect is running, the source url cannot be changed.

In order to provide your custom initial properties, you need to override the initialProperties() function.

See also source().

QUrl QuickSceneEffect::source() const

Returns the source URL.

See also setSource().

[invokable] KWin::QuickSceneView *QuickSceneEffect::viewAt(const QPoint &pos) const

Returns the view at the specified pos in the global screen coordinates.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

[invokable] KWin::QuickSceneView *QuickSceneEffect::viewForScreen(KWin::LogicalOutput *screen) const

Returns the scene view on the specified screen

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.