diff --git a/src/scripting/workspace_wrapper.cpp b/src/scripting/workspace_wrapper.cpp index e54977a6ed..9544fa3981 100644 --- a/src/scripting/workspace_wrapper.cpp +++ b/src/scripting/workspace_wrapper.cpp @@ -397,13 +397,21 @@ QQmlListProperty DeclarativeScriptWorkspaceWrapper::client return QQmlListProperty(this, nullptr, &DeclarativeScriptWorkspaceWrapper::countClientList, &DeclarativeScriptWorkspaceWrapper::atClientList); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) int DeclarativeScriptWorkspaceWrapper::countClientList(QQmlListProperty *clients) +#else +qsizetype DeclarativeScriptWorkspaceWrapper::countClientList(QQmlListProperty *clients) +#endif { Q_UNUSED(clients) return workspace()->allClientList().size(); } +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) KWin::AbstractClient *DeclarativeScriptWorkspaceWrapper::atClientList(QQmlListProperty *clients, int index) +#else +KWin::AbstractClient *DeclarativeScriptWorkspaceWrapper::atClientList(QQmlListProperty *clients, qsizetype index) +#endif { Q_UNUSED(clients) return workspace()->allClientList().at(index); diff --git a/src/scripting/workspace_wrapper.h b/src/scripting/workspace_wrapper.h index f85eeffb4f..6b8521cbc6 100644 --- a/src/scripting/workspace_wrapper.h +++ b/src/scripting/workspace_wrapper.h @@ -429,8 +429,13 @@ class DeclarativeScriptWorkspaceWrapper : public WorkspaceWrapper Q_PROPERTY(QQmlListProperty clients READ clients) public: QQmlListProperty clients(); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) static int countClientList(QQmlListProperty *clients); static KWin::AbstractClient *atClientList(QQmlListProperty *clients, int index); +#else + static qsizetype countClientList(QQmlListProperty *clients); + static KWin::AbstractClient *atClientList(QQmlListProperty *clients, qsizetype index); +#endif explicit DeclarativeScriptWorkspaceWrapper(QObject* parent = nullptr); };