summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwidget_s60.cpp
diff options
context:
space:
mode:
authorGareth Stockwell <gareth.stockwell@sosco.com>2009-09-24 16:59:10 (GMT)
committerGareth Stockwell <gareth.stockwell@sosco.com>2009-09-28 10:01:13 (GMT)
commite0fb34194f9ce85f67f158011b4e706835a5667c (patch)
tree2e46b927f95a05a017f2b4ba359a6ea27bd1da6c /src/gui/kernel/qwidget_s60.cpp
parent420672ce2d86f9be2b11a6bceba71f41aadfcedf (diff)
downloadQt-e0fb34194f9ce85f67f158011b4e706835a5667c.zip
Qt-e0fb34194f9ce85f67f158011b4e706835a5667c.tar.gz
Qt-e0fb34194f9ce85f67f158011b4e706835a5667c.tar.bz2
Implemented QWidget::mapFromGlobal, QWidget::mapToGlobal, for case where child widget owns a native window
Diffstat (limited to 'src/gui/kernel/qwidget_s60.cpp')
-rw-r--r--src/gui/kernel/qwidget_s60.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 8667325..912ba1f 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -1216,9 +1216,10 @@ QPoint QWidget::mapToGlobal(const QPoint &pos) const
return pos + tp;
}
- // This is the native window case. Consider using CCoeControl::PositionRelativeToScreen()
- // if we decide to go with CCoeControl
- return QPoint();
+ // Native window case
+ const TPoint widgetScreenOffset = internalWinId()->PositionRelativeToScreen();
+ const QPoint globalPos = QPoint(widgetScreenOffset.iX, widgetScreenOffset.iY) + pos;
+ return globalPos;
}
QPoint QWidget::mapFromGlobal(const QPoint &pos) const
@@ -1232,8 +1233,10 @@ QPoint QWidget::mapFromGlobal(const QPoint &pos) const
return pos - tp;
}
- // ### TODO native window
- return QPoint();
+ // Native window case
+ const TPoint widgetScreenOffset = internalWinId()->PositionRelativeToScreen();
+ const QPoint widgetPos = pos - QPoint(widgetScreenOffset.iX, widgetScreenOffset.iY);
+ return widgetPos;
}
void QWidget::setWindowState(Qt::WindowStates newstate)