Fix use-before-detach in implicitly-shared brush setters


get() was called before detach(), leaving the pointer pointing at the
old shared data after detach() created a new copy. Modifying through
that stale pointer would silently mutate the original object instead
of the intended copy. The fix is to always retrieve the d-pointer
after detach.

The _D() helper macros were obfuscating what was really happening,
so expand them to direct Private::get() calls.

Add testCopyIsolation to tst_qcbrush to verify that modifying a copy
does not affect the original for all implicitly-shared brush types.

AI disclosure: The mechanical search/replace and the autotest code
is done by Claude Sonnet 4.6

Pick-to: 6.11
Change-Id: I6ad18ee2d321724a59f7cd3b79dbabde1a5bc8ec
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
commit21b8861ef8a91a38eb628d3819910d45f4ce5dbe
parent49241d73a62dda4c870a98a447ef8de8f1e3a4c7
authorPaul Olav Tvete <paul.tvete@qt.io>
committerPaul Olav Tvete <paul.tvete@qt.io>
commit timeTue, 12 May 2026 09:40:12 +0000