Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QtQuickTest and image providers [solved]



  • I'd like to utilize the QtQuickTest framework to unit-test my QML code. All of my QML code uses image providers. Using the QtQuickTest framework as shipped in Qt 5.1 does not support installing a custom QQuickImageProvider instance on the QQuickView instance inside the quick_test_main routine.

    Is there anyway I can work around this (other than having to write all the quick_test_main code myself)?

    One way to solve this would be to modify the quick_test_main routine to allow me to pass in my own QQuickView instance. This way, I can create an instance and install a QQuickImageProvider before any of the rest of the test setup stuff.

    EDIT: One can create an image provider plugin and install it in the appropriate directory for the unit-test to load images within the module under test.


Log in to reply