summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>2012-10-11 10:35:40 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-12 02:19:36 +0200
commit6727781ec9a4657a6a8e0ad27687c78ee90c6989 (patch)
tree00968e7de24d2d98e274d0dc0e2a88e8f8ba00ce /src
parent75492a109839d85b101efd45332ac83842741c75 (diff)
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>
Diffstat (limited to 'src')
-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 9be12bb493..1a78de0df2 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) {