diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-18 09:32:56 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-01-18 09:32:56 (GMT) |
commit | 437a67eb055c688ea4b778f5cfc9132fe02063c6 (patch) | |
tree | 331ec37ebc1b5c2e4080f3038abb1c72e2ac3cef /src/gui | |
parent | dcd7c79357c5ff5096ec4fa13ad16ef8a0497a5f (diff) | |
parent | 7e76201808549c0837d1a5154ed8737fb0296c00 (diff) | |
download | Qt-437a67eb055c688ea4b778f5cfc9132fe02063c6.zip Qt-437a67eb055c688ea4b778f5cfc9132fe02063c6.tar.gz Qt-437a67eb055c688ea4b778f5cfc9132fe02063c6.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2:
Fixes: When calling QDesktopWidget::screenGeometry() with a null
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qdesktopwidget.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gui/kernel/qdesktopwidget.cpp b/src/gui/kernel/qdesktopwidget.cpp index c8a4373..24b4e57 100644 --- a/src/gui/kernel/qdesktopwidget.cpp +++ b/src/gui/kernel/qdesktopwidget.cpp @@ -47,6 +47,11 @@ QT_BEGIN_NAMESPACE const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const { + if (!widget) { + qWarning("QDesktopWidget::screenGeometry(): Attempt " + "to get the screen geometry of a null widget"); + return QRect(); + } QRect rect = QWidgetPrivate::screenGeometry(widget); if (rect.isNull()) return screenGeometry(screenNumber(widget)); @@ -55,6 +60,11 @@ const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const const QRect QDesktopWidget::availableGeometry(const QWidget *widget) const { + if (!widget) { + qWarning("QDesktopWidget::availableGeometry(): Attempt " + "to get the available geometry of a null widget"); + return QRect(); + } QRect rect = QWidgetPrivate::screenGeometry(widget); if (rect.isNull()) return availableGeometry(screenNumber(widget)); |