QNdefNfcSmartPosterRecordPrivate: use std::optional


The class was using raw pointers to represent the values that
can be potentially missing from the SmartPoseter record.

Managing raw pointers can be a source of memory leaks. One such
bug was already identified and fixed in
274b9ea625f6419abac0f320ac5d78141d294d48.
But that patch overlooked another problem - setPayload() was still
leaking the memory if the incoming payload had more than one uri,
action, size, or type record.

Use std::optional to prevent any raw memory allocations. This
also means that we do not need to call cleanup() in the Private's
destructor anymore.
As a drive-by, add the missing includes to the header.

Pick-to: 6.12 6.8
Change-Id: I8fae006fb76a67ec73bac520f6fc44a4d61d2b67
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
commit6f70e2f5f4207add5fbf19703244eee52acf391d
parentd8f875a8075f06b782a1a4a410a00f02ba1d0d37
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeMon, 19 Oct 2026 15:25:26 +0000