From f986c0c3390ba7d033b6e6276f63dcd4818adb5c Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Thu, 29 Sep 2016 17:35:31 +0200 Subject: Fix crash on cancel QQuickImageResponse We don't need to deleteLater here, we can not be sure that the response won't continue for a bit after this, and it's not even needed since documentation says you need to emit finished in all cases and this will call deleteLater on the response anyway. Task-number: QTBUG-56056 Change-Id: I7cc90620f499beaaaaa61aac77d72d067308838c Reviewed-by: Michael Brasser --- src/quick/util/qquickimageprovider.cpp | 2 ++ src/quick/util/qquickpixmapcache.cpp | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/util/qquickimageprovider.cpp b/src/quick/util/qquickimageprovider.cpp index d11229717a..9ed38f72c6 100644 --- a/src/quick/util/qquickimageprovider.cpp +++ b/src/quick/util/qquickimageprovider.cpp @@ -181,6 +181,8 @@ QString QQuickImageResponse::errorString() const This method is used to communicate that the response is no longer required by the engine. It may be reimplemented to cancel a request in the provider side, however, it is not mandatory. + + A cancelled QQuickImageResponse still needs to emit finished(). */ void QQuickImageResponse::cancel() { diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp index 230c31807c..50b6de25fb 100644 --- a/src/quick/util/qquickpixmapcache.cpp +++ b/src/quick/util/qquickpixmapcache.cpp @@ -584,7 +584,6 @@ void QQuickPixmapReader::processJobs() if (asyncResponse) { asyncResponses.remove(asyncResponse); asyncResponse->cancel(); - asyncResponse->deleteLater(); } } PIXMAP_PROFILE(pixmapStateChanged(job->url)); -- cgit v1.2.3 From 643d75e3ff2f8cbe60eeff2084fb6ec3fcb096a0 Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Wed, 21 Sep 2016 16:13:00 +0200 Subject: QQuickRectangle: fix typo in apidoc Change-Id: Ib026302143df82196fdfd70b9ea9923098adbc7c Reviewed-by: Robin Burchell --- src/quick/items/qquickrectangle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp index eb17187ad5..ab22fceee1 100644 --- a/src/quick/items/qquickrectangle.cpp +++ b/src/quick/items/qquickrectangle.cpp @@ -360,7 +360,7 @@ QQuickPen *QQuickRectangle::border() The gradient to use to fill the rectangle. This property allows for the construction of simple vertical gradients. - Other gradients may by formed by adding rotation to the rectangle. + Other gradients may be formed by adding rotation to the rectangle. \div {class="float-left"} \inlineimage declarative-rect_gradient.png -- cgit v1.2.3 From 55b3d76671090da348d63a89417ea73dab5d315d Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Fri, 23 Sep 2016 13:47:40 +0200 Subject: QQuickPositioners: fix sentence structure in apidoc Change-Id: I14eb860386dfad57ab8cf492cb782970497756b9 Reviewed-by: Robin Burchell --- src/quick/items/qquickpositioners.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/qquickpositioners.cpp b/src/quick/items/qquickpositioners.cpp index de2596b679..8f690c03d4 100644 --- a/src/quick/items/qquickpositioners.cpp +++ b/src/quick/items/qquickpositioners.cpp @@ -866,7 +866,7 @@ void QQuickPositionerAttached::setIsLastItem(bool isLastItem) the item that is being added. See the \l ViewTransition documentation for more details and examples on using these transitions. - \note This transition is not applied to the items that already part of the positioner + \note This transition is not applied to the items that are already part of the positioner at the time of its creation. In this case, the \l populate transition is applied instead. \sa populate, ViewTransition, {Qt Quick Examples - Positioners} @@ -1033,7 +1033,7 @@ void QQuickColumn::reportConflictingAnchors() the item that is being added. See the \l ViewTransition documentation for more details and examples on using these transitions. - \note This transition is not applied to the items that already part of the positioner + \note This transition is not applied to the items that are already part of the positioner at the time of its creation. In this case, the \l populate transition is applied instead. \sa populate, ViewTransition, {Qt Quick Examples - Positioners} @@ -1301,7 +1301,7 @@ void QQuickRow::reportConflictingAnchors() the item that is being added. See the \l ViewTransition documentation for more details and examples on using these transitions. - \note This transition is not applied to the items that already part of the positioner + \note This transition is not applied to the items that are already part of the positioner at the time of its creation. In this case, the \l populate transition is applied instead. \sa populate, ViewTransition, {Qt Quick Examples - Positioners} @@ -1876,7 +1876,7 @@ void QQuickGrid::reportConflictingAnchors() the item that is being added. See the \l ViewTransition documentation for more details and examples on using these transitions. - \note This transition is not applied to the items that already part of the positioner + \note This transition is not applied to the items that are already part of the positioner at the time of its creation. In this case, the \l populate transition is applied instead. \sa populate, ViewTransition, {Qt Quick Examples - Positioners} -- cgit v1.2.3 From 9182797dec1897cda4e2e0368a16ddbd5c18b031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 20 Mar 2015 13:46:43 +0100 Subject: Canvas: Implement high-DPI render mode Scale the canvas image and texture buffer by the target devicePixelRatio. Task-number: QTBUG-37095 Change-Id: Ic432b278caa5c85cf3487d3108967cf3fcd2fa48 Reviewed-by: Shawn Rutledge --- src/quick/items/context2d/qquickcontext2dtexture.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/quick') diff --git a/src/quick/items/context2d/qquickcontext2dtexture.cpp b/src/quick/items/context2d/qquickcontext2dtexture.cpp index 5ac971dc7d..78c526b299 100644 --- a/src/quick/items/context2d/qquickcontext2dtexture.cpp +++ b/src/quick/items/context2d/qquickcontext2dtexture.cpp @@ -538,6 +538,9 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting() { QQuickContext2DTexture::beginPainting(); + const qreal devicePixelRatio = (m_item && m_item->window()) ? + m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio(); + if (m_canvasWindow.size().isEmpty()) { delete m_fbo; delete m_multisampledFbo; @@ -552,7 +555,7 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting() delete m_paint_device; m_paint_device = 0; - m_fboSize = npotAdjustedSize(m_canvasWindow.size()); + m_fboSize = npotAdjustedSize(m_canvasWindow.size() * devicePixelRatio); m_canvasWindowChanged = false; if (doMultisampling()) { @@ -590,6 +593,7 @@ QPaintDevice* QQuickContext2DFBOTexture::beginPainting() QOpenGLPaintDevice *gl_device = new QOpenGLPaintDevice(m_fbo->size()); gl_device->setPaintFlipped(true); gl_device->setSize(m_fbo->size()); + gl_device->setDevicePixelRatio(devicePixelRatio); m_paint_device = gl_device; } @@ -694,8 +698,12 @@ QPaintDevice* QQuickContext2DImageTexture::beginPainting() if (m_canvasWindow.size().isEmpty()) return 0; + const qreal devicePixelRatio = (m_item && m_item->window()) ? + m_item->window()->effectiveDevicePixelRatio() : qApp->devicePixelRatio(); + if (m_canvasWindowChanged) { - m_image = QImage(m_canvasWindow.size(), QImage::Format_ARGB32_Premultiplied); + m_image = QImage(m_canvasWindow.size() * devicePixelRatio, QImage::Format_ARGB32_Premultiplied); + m_image.setDevicePixelRatio(devicePixelRatio); m_image.fill(0x00000000); m_canvasWindowChanged = false; } -- cgit v1.2.3