[scripting] Provide conversion functions for AbstractClient
ClosedPublic

Authored by zzag on Oct 25 2019, 2:02 PM.

Details

Summary

If no conversion functions are provided for a QObject-subclass, then
QScriptEngine will use QScriptEngine::newQObject() method without any
special options to convert an instance of that QObject-subclass to a
QScriptValue. However, it's very important that every client object is
wrapped with PreferExistingWrapperObject option. We need that option
because a script may set a property on a client object and that property
must remain until it's deleted by the script.

BUG: 413044
FIXED-IN: 5.17.2

Test Plan

New test.

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
zzag created this revision.Oct 25 2019, 2:02 PM
Restricted Application added a project: KWin. · View Herald TranscriptOct 25 2019, 2:02 PM
Restricted Application added a subscriber: kwin. · View Herald Transcript
zzag requested review of this revision.Oct 25 2019, 2:02 PM
zzag updated this revision to Diff 68749.Oct 25 2019, 2:27 PM

QStringLiteral("/contents/") -> QLatin1String("/contents/")

davidedmundson accepted this revision.Oct 25 2019, 2:37 PM
davidedmundson added a subscriber: davidedmundson.

Well identified. Good to know Qt didn't regress.

autotests/integration/scripting/minimizeall_test.cpp
39

change

This revision is now accepted and ready to land.Oct 25 2019, 2:37 PM
zzag marked an inline comment as done.Oct 25 2019, 2:40 PM
This revision was automatically updated to reflect the committed changes.