summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel')
-rw-r--r--src/gui/kernel/qapplication_x11.cpp2
-rw-r--r--src/gui/kernel/qclipboard_win.cpp2
-rw-r--r--src/gui/kernel/qclipboard_x11.cpp4
-rw-r--r--src/gui/kernel/qkeymapper_mac.cpp2
-rw-r--r--src/gui/kernel/qsoftkeymanager_s60.cpp2
-rw-r--r--src/gui/kernel/qstandardgestures.cpp19
-rw-r--r--src/gui/kernel/qwidget.cpp40
-rw-r--r--src/gui/kernel/qwidget_p.h1
-rw-r--r--src/gui/kernel/qwidget_s60.cpp5
9 files changed, 54 insertions, 23 deletions
diff --git a/src/gui/kernel/qapplication_x11.cpp b/src/gui/kernel/qapplication_x11.cpp
index d8fb74c..a4cc5a3 100644
--- a/src/gui/kernel/qapplication_x11.cpp
+++ b/src/gui/kernel/qapplication_x11.cpp
@@ -3742,7 +3742,7 @@ int QApplication::x11ProcessEvent(XEvent* event)
// toplevel reparented...
QWidget *newparent = QWidget::find(event->xreparent.parent);
if (! newparent || (newparent->windowType() == Qt::Desktop)) {
- // we dont' know about the new parent (or we've been
+ // we don't know about the new parent (or we've been
// reparented to root), perhaps a window manager
// has been (re)started? reset the focus model to unknown
X11->focus_model = QX11Data::FM_Unknown;
diff --git a/src/gui/kernel/qclipboard_win.cpp b/src/gui/kernel/qclipboard_win.cpp
index 63ca9e5..c2e29fd 100644
--- a/src/gui/kernel/qclipboard_win.cpp
+++ b/src/gui/kernel/qclipboard_win.cpp
@@ -141,7 +141,7 @@ public:
clipBoardViewer = new QWidget();
clipBoardViewer->createWinId();
clipBoardViewer->setObjectName(QLatin1String("internal clipboard owner"));
- // We dont need this internal widget to appear in QApplication::topLevelWidgets()
+ // We don't need this internal widget to appear in QApplication::topLevelWidgets()
if (QWidgetPrivate::allWidgets)
QWidgetPrivate::allWidgets->remove(clipBoardViewer);
}
diff --git a/src/gui/kernel/qclipboard_x11.cpp b/src/gui/kernel/qclipboard_x11.cpp
index 55548ef..62c861d 100644
--- a/src/gui/kernel/qclipboard_x11.cpp
+++ b/src/gui/kernel/qclipboard_x11.cpp
@@ -132,7 +132,7 @@ void setupOwner()
requestor = new QWidget(0);
requestor->createWinId();
requestor->setObjectName(QLatin1String("internal clipboard requestor"));
- // We dont need this internal widgets to appear in QApplication::topLevelWidgets()
+ // We don't need this internal widgets to appear in QApplication::topLevelWidgets()
if (QWidgetPrivate::allWidgets) {
QWidgetPrivate::allWidgets->remove(owner);
QWidgetPrivate::allWidgets->remove(requestor);
@@ -769,7 +769,7 @@ QByteArray QX11Data::clipboardReadIncrementalProperty(Window win, Atom property,
delete requestor;
requestor = new QWidget(0);
requestor->setObjectName(QLatin1String("internal clipboard requestor"));
- // We dont need this internal widget to appear in QApplication::topLevelWidgets()
+ // We don't need this internal widget to appear in QApplication::topLevelWidgets()
if (QWidgetPrivate::allWidgets)
QWidgetPrivate::allWidgets->remove(requestor);
diff --git a/src/gui/kernel/qkeymapper_mac.cpp b/src/gui/kernel/qkeymapper_mac.cpp
index 3dc6afc..300e5ca 100644
--- a/src/gui/kernel/qkeymapper_mac.cpp
+++ b/src/gui/kernel/qkeymapper_mac.cpp
@@ -749,7 +749,7 @@ bool QKeyMapperPrivate::translateKeyEvent(QWidget *widget, EventHandlerCallRef e
}
return false;
}
- // Once we process the key down , we dont need to send the saved event again from
+ // Once we process the key down , we don't need to send the saved event again from
// kEventTextInputUnicodeForKeyEvent, so clear it.
if (currentContext && ekind == kEventRawKeyDown) {
QMacInputContext *context = qobject_cast<QMacInputContext*>(currentContext);
diff --git a/src/gui/kernel/qsoftkeymanager_s60.cpp b/src/gui/kernel/qsoftkeymanager_s60.cpp
index fee1580..c81d75f 100644
--- a/src/gui/kernel/qsoftkeymanager_s60.cpp
+++ b/src/gui/kernel/qsoftkeymanager_s60.cpp
@@ -265,7 +265,7 @@ bool QSoftKeyManagerPrivateS60::setSoftkeyImage(CEikButtonGroupContainer *cba,
CFbsBitmap* nMask = softkeyAlpha.toSymbianCFbsBitmap();
CEikImage* myimage = new (ELeave) CEikImage;
- myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transfered
+ myimage->SetPicture( nBitmap, nMask ); // nBitmap and nMask ownership transferred
EikSoftkeyImage::SetImage(cba, *myimage, left); // Takes myimage ownership
cbaHasImage[position] = true;
diff --git a/src/gui/kernel/qstandardgestures.cpp b/src/gui/kernel/qstandardgestures.cpp
index 893ba2b..1821c3d 100644
--- a/src/gui/kernel/qstandardgestures.cpp
+++ b/src/gui/kernel/qstandardgestures.cpp
@@ -198,25 +198,22 @@ QGestureRecognizer::Result QPinchGestureRecognizer::recognize(QGesture *state,
d->startPosition[0] = p1.screenPos();
d->startPosition[1] = p2.screenPos();
}
- QLineF line(p1.screenPos(), p2.screenPos());
- QLineF lastLine(p1.lastScreenPos(), p2.lastScreenPos());
- QLineF tmp(line);
- tmp.setLength(line.length() / 2.);
- QPointF centerPoint = tmp.p2();
d->lastCenterPoint = d->centerPoint;
- d->centerPoint = centerPoint;
- d->changeFlags |= QPinchGesture::CenterPointChanged;
+ d->centerPoint = (p1.screenPos() + p2.screenPos()) / 2.0;
- const qreal scaleFactor = line.length() / lastLine.length();
+ d->changeFlags |= QPinchGesture::CenterPointChanged;
if (d->isNewSequence) {
- d->lastScaleFactor = scaleFactor;
+ d->scaleFactor = 1.0;
+ d->lastScaleFactor = 1.0;
} else {
d->lastScaleFactor = d->scaleFactor;
+ QLineF line(p1.screenPos(), p2.screenPos());
+ QLineF lastLine(p1.lastScreenPos(), p2.lastScreenPos());
+ d->scaleFactor = line.length() / lastLine.length();
}
- d->scaleFactor = scaleFactor;
- d->totalScaleFactor = d->totalScaleFactor * scaleFactor;
+ d->totalScaleFactor = d->totalScaleFactor * d->scaleFactor;
d->changeFlags |= QPinchGesture::ScaleFactorChanged;
qreal angle = QLineF(p1.screenPos(), p2.screenPos()).angle();
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp
index 9b44f15..e22ec55 100644
--- a/src/gui/kernel/qwidget.cpp
+++ b/src/gui/kernel/qwidget.cpp
@@ -236,6 +236,17 @@ void QWidgetBackingStoreTracker::unregisterWidget(QWidget *w)
}
}
+/*!
+ \internal
+ Recursively remove widget and all of its descendents.
+ */
+void QWidgetBackingStoreTracker::unregisterWidgetSubtree(QWidget *widget)
+{
+ unregisterWidget(widget);
+ foreach (QObject *child, widget->children())
+ if (QWidget *childWidget = qobject_cast<QWidget *>(child))
+ unregisterWidgetSubtree(childWidget);
+}
QWidgetPrivate::QWidgetPrivate(int version)
: QObjectPrivate(version)
@@ -326,15 +337,27 @@ QWidgetPrivate::~QWidgetPrivate()
#endif //QT_NO_GRAPHICSEFFECT
}
+class QDummyWindowSurface : public QWindowSurface
+{
+public:
+ QDummyWindowSurface(QWidget *window) : QWindowSurface(window) {}
+ QPaintDevice *paintDevice() { return window(); }
+ void flush(QWidget *, const QRegion &, const QPoint &) {}
+};
+
QWindowSurface *QWidgetPrivate::createDefaultWindowSurface()
{
Q_Q(QWidget);
QWindowSurface *surface;
- if (QApplicationPrivate::graphicsSystem())
- surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q);
- else
- surface = createDefaultWindowSurface_sys();
+ if (q->property("_q_DummyWindowSurface").toBool()) {
+ surface = new QDummyWindowSurface(q);
+ } else {
+ if (QApplicationPrivate::graphicsSystem())
+ surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q);
+ else
+ surface = createDefaultWindowSurface_sys();
+ }
return surface;
}
@@ -10031,7 +10054,16 @@ void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
if (newParent && isAncestorOf(focusWidget()))
focusWidget()->clearFocus();
+ QTLWExtra *oldTopExtra = window()->d_func()->maybeTopData();
+ QWidgetBackingStoreTracker *oldBsTracker = oldTopExtra ? &oldTopExtra->backingStore : 0;
+
d->setParent_sys(parent, f);
+
+ QTLWExtra *topExtra = window()->d_func()->maybeTopData();
+ QWidgetBackingStoreTracker *bsTracker = topExtra ? &topExtra->backingStore : 0;
+ if (oldBsTracker && oldBsTracker != bsTracker)
+ oldBsTracker->unregisterWidgetSubtree(this);
+
if (desktopWidget)
parent = 0;
diff --git a/src/gui/kernel/qwidget_p.h b/src/gui/kernel/qwidget_p.h
index 6c89659..ca1e3fc 100644
--- a/src/gui/kernel/qwidget_p.h
+++ b/src/gui/kernel/qwidget_p.h
@@ -122,6 +122,7 @@ public:
void registerWidget(QWidget *w);
void unregisterWidget(QWidget *w);
+ void unregisterWidgetSubtree(QWidget *w);
inline QWidgetBackingStore* data()
{
diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp
index 5df5e19..cf4bdf1 100644
--- a/src/gui/kernel/qwidget_s60.cpp
+++ b/src/gui/kernel/qwidget_s60.cpp
@@ -577,7 +577,7 @@ void QWidgetPrivate::hide_sys()
QSymbianControl *id = static_cast<QSymbianControl *>(q->internalWinId());
if (id) {
- //Incorrect optimisation - for popup windows, Qt's focus is moved before
+ //Incorrect optimization - for popup windows, Qt's focus is moved before
//hide_sys is called, resulting in the popup window keeping its elevated
//position in the CONE control stack.
//This can result in keyboard focus being in an invisible widget in some
@@ -709,7 +709,8 @@ void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
// old_winid may not have received a 'not visible' visibility
// changed event before being destroyed; make sure that it is
// removed from the backing store's list of visible windows.
- S60->controlVisibilityChanged(old_winid, false);
+ if (old_winid)
+ S60->controlVisibilityChanged(old_winid, false);
setWinId(0);