for a QtQuick application I try to implement an asynchronous image provider.
As suggested in the documentation of QQuickImageResponse I use QRunnable as
base class and disabled automatic deletion in the constructor.
I have a private QThreadPool member in my QQuickAsyncImageProvider.
My requestImageResponse function creates a new ImageResponse, calling
the ThreadPool´s start function for the ImageResponse and returns the
The run method of the ImageResponse renders a pdf page with poppler, sets
the QQuickTextureFactory and emits finished.
To display the pdf pages I use a ListModel with all pages displayed as
Images in a PathView. To display different pdf´s i use a StackView.
If I push a pdf view on the StackView I can see the construction, run,
finished, textureFactory and destruction calls of the ImageResponse.
In the ImageResponse I added qDebug() prints for all public functions.
The pages get displayed correctly in my pdf view.
If I pop the pdf view from the StackView before all pages have been rendered
the application crashes.
I can see a call to cancel and destructor of the pages that have not signaled
finished. To eliminate side effects, I replaced the pdf rendering in run with
a sleep of 1 second.
Here is the output of a 7 page pdf view (the second column is the requested
id (fileName:pageNumber), stored in a private member of ImageRequest):
QML debugging is enabled. Only use this in a safe environment.
run finished: "test.pdf:4"
run finished: "test.pdf:5"
run finished: "test.pdf:3"
run finished: "test.pdf:6"
run finished: "test.pdf:2"
run finished: "test.pdf:1"
bash: line 1: 14884 Segmentation fault DISPLAY=':0.0'
The only thing I can spot is the destruction of ImageRequests that have been
started but not finished
(the last 4 lines before the segmentation fault).
Do I miss something or is this a bug?
HEKATRON Technik GmbH
Bruehlmatten 3a - 9
Reg.-Ger. Freiburg HRB 300243
Michael Roth, Armin Berchtold
Telefon +49 7634 500-0
Telefax +49 7634 500-316
Interest mailing list