Check if Qt::Gui exists before adding tests


The mediatype and PetApiTest tests depend on Qt::Gui which is only
added as an optional component.
Add the necessary checks to the corresponding CMakeLists.txt.

Change-Id: I868ab60c6c2704f22e2d26624e93116c4945b7c0
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
commitbb5837f073b8a5b93dbdbe885c3b09626eef76db
parent9aaaa49de998b0087ce2aaa205998c05c3a39639
authorIvan Solovev <ivan.solovev@qt.io>
committerIvan Solovev <ivan.solovev@qt.io>
commit timeTue, 18 Nov 2025 10:56:17 +0100