equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
45 |
45 |
46 QT_BEGIN_NAMESPACE |
46 QT_BEGIN_NAMESPACE |
47 |
47 |
48 const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const |
48 const QRect QDesktopWidget::screenGeometry(const QWidget *widget) const |
49 { |
49 { |
|
50 if (!widget) { |
|
51 qWarning("QDesktopWidget::screenGeometry(): Attempt " |
|
52 "to get the screen geometry of a null widget"); |
|
53 return QRect(); |
|
54 } |
50 QRect rect = QWidgetPrivate::screenGeometry(widget); |
55 QRect rect = QWidgetPrivate::screenGeometry(widget); |
51 if (rect.isNull()) |
56 if (rect.isNull()) |
52 return screenGeometry(screenNumber(widget)); |
57 return screenGeometry(screenNumber(widget)); |
53 else return rect; |
58 else return rect; |
54 } |
59 } |
55 |
60 |
56 const QRect QDesktopWidget::availableGeometry(const QWidget *widget) const |
61 const QRect QDesktopWidget::availableGeometry(const QWidget *widget) const |
57 { |
62 { |
|
63 if (!widget) { |
|
64 qWarning("QDesktopWidget::availableGeometry(): Attempt " |
|
65 "to get the available geometry of a null widget"); |
|
66 return QRect(); |
|
67 } |
58 QRect rect = QWidgetPrivate::screenGeometry(widget); |
68 QRect rect = QWidgetPrivate::screenGeometry(widget); |
59 if (rect.isNull()) |
69 if (rect.isNull()) |
60 return availableGeometry(screenNumber(widget)); |
70 return availableGeometry(screenNumber(widget)); |
61 else |
71 else |
62 return rect; |
72 return rect; |