Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.2
-
Windows 7, Qt 4.7.4, MSVS 2010, Qt 3D from https://qt.gitorious.org/qt-labs/qt3d
-
407fbda1f83f9b18572427306fbb430702dc20ff c7e1828b7352c4d86f98b5a032fa840988251c19
Description
I am texturing an Item3D in QML with the textureImage property with a QImage which is set from C++ via the rootContext of the QDeclarativeComponent. The QImage texture is a rendering of a QGraphicsScene which is being updated. We want to update the Item3D texturing after each QGraphicsScene update - meaning a new QImage is rendered for each QGraphicsScene::changed ( const QList<QRectF> & region ) signal. The resulting QImage is updated in QML from C++ after each update.
This scenario leaks memory exponentially. After a minute or so, the test application is using 1.5GB of memory.
If the QImage is not updated as a texture (but the painting happening in any case), the memory consuption for the QML below is at steady ~20kB.
The QML that is being textured is as follows.
import Qt 4.7 import Qt3D 1.0 import Qt3D.Shapes 1.0 Viewport { width: 490; height: 720 property Image textureImage Cube { scale: 2.0; id: theCube transform: Rotation3D { angle: 30; axis: Qt.vector3d(1, 1, 1) } effect: Effect { id: textureEffect textureImage: textureBitmapImage decal: true } } }
The QImage texture is updated to QML like so:
void QmlApplicationViewer::onTextureUpdated(QImage updatedTexture) {
QVariant variantImage = updatedTexture;
m_d->m_rootContext->setContextProperty("textureBitmapImage", variantImage);
}
Qt 3D is compiled from Git repository https://qt.gitorious.org/qt-labs/qt3d
I can provide complete source code privately on request.
Attachments
Issue Links
- is replaced by
-
QTBUG-24043 Resource handling needs refactoring
-
- Closed
-