Priority: Not Evaluated
Affects Version/s: 5.10.0
Fix Version/s: None
Component/s: Testing: QuickTest
The result from grabImage has a very restricted interface where you can only access it from QML and only save, compare to other grabImage results and fetch pixel values.
For our tests we would like to be able to
- compare to an arbitrary QImage (e.g. loaded from files)
- do fuzzy comparisons on the C++ side to speed up the process
Getting read access to the internal QImage of QuickTestImageObject would fully suffice. To that end there needs to be a getter and the class must be part of the public interface.
As a workaround we currently crack open (via UB!) the class ourselves:
1. We redeclared this class for our tests and simply made the image public.
2. To allow passing the QuickTestImageObject result from QML to C++ we use a QObject* interface and do an unconditional `static_cast<QuickTestImageObject*>` to avoid problems with `dynamic_cast` having different typeids for our and Qt's version of QuickTestImageObject.