summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-10-11 08:35:40 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-12 00:19:36 (GMT)
commit6727781ec9a4657a6a8e0ad27687c78ee90c6989 (patch)
tree00968e7de24d2d98e274d0dc0e2a88e8f8ba00ce
parent75492a109839d85b101efd45332ac83842741c75 (diff)
downloadQt-6727781ec9a4657a6a8e0ad27687c78ee90c6989.zip
Qt-6727781ec9a4657a6a8e0ad27687c78ee90c6989.tar.gz
Qt-6727781ec9a4657a6a8e0ad27687c78ee90c6989.tar.bz2
QNX: Fix crash in QBBNativeInterface::nativeResourceForWidget()
This was triggered by using a QVideoWidget without a parent. This patch is not necessary in Qt5, as the API there is based on QWindow, it has no call to nativeParentWidget(). Change-Id: I2fe2b872da314e507bcfcb69dfea4a837700ac71 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Kevin Krammer <kevin.krammer@kdab.com> Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
-rw-r--r--src/plugins/platforms/blackberry/qbbnativeinterface.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/platforms/blackberry/qbbnativeinterface.cpp b/src/plugins/platforms/blackberry/qbbnativeinterface.cpp
index 9be12bb..1a78de0 100644
--- a/src/plugins/platforms/blackberry/qbbnativeinterface.cpp
+++ b/src/plugins/platforms/blackberry/qbbnativeinterface.cpp
@@ -56,7 +56,8 @@ QBBNativeInterface::QBBNativeInterface(QBBIntegration *integration)
void *QBBNativeInterface::nativeResourceForWidget(const QByteArray &resource, QWidget *widget)
{
if (resource == "windowGroup" && widget) {
- const QWidget * const nativeWidget = widget->nativeParentWidget();
+ const QWidget * const nativeWidget =
+ widget->parentWidget() ? widget->nativeParentWidget() : widget;
const screen_window_t window = reinterpret_cast<screen_window_t>(nativeWidget->winId());
const QBBScreen * const screen = mIntegration->screenForWindow(window);
if (screen) {