QWaylandQuickItem: don't pass const Connections to QObject::disconnect()
The const overloads of that function is going to be deprecated, since
it actually modifies its argument.
The QWaylandQuickItemPrivate::get() function is not overloaded for
const/non-const. As a consequence, the lambda that gets connected into
texProviderConnection will get a pointer to a const Private back and
thus passes a const Connection to disconnected().
Observing that the dance with get() isn't necessary, because the
lambda's itemPrev is exactly the same pointer as the `d` outside the
lambda, which is already a pointer to non-const, just capture that.
As a drive-by, remove the unneeded lambda argument list, add the
QObject:: scope to disconnect() to not have people wondering why it
works without capturing *this (because it's a static function), and
don't re-evaluate compositor() twice (it's several levels of
out-of-line functions).
Since the whole thing is now much simpler, too, reformat the connect()
call to idiomatic form (sender, signal, ctx, lambda-introducer\nbody).
Amends 8f9fa232ac72a5f0caf58e120f3825820423c4de (picked to 6.4).
Task-number: QTBUG-144929
Pick-to: 6.11 6.10 6.8 6.5
Change-Id: I21172faad60ac7c41f530c7d87148330007c1a9f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>