summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2011-01-17 22:27:36 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2011-01-17 22:27:36 (GMT)
commit46ba213883cf46871ef539ef4d2304064b671175 (patch)
treec6f251fdc3bc54e3c7cbacdeeba87a83c7d1dc39 /src
parentfd826d4a885fdbef00727b900a44b185343eb824 (diff)
parent54b3ddc0707f08378f75168df5b35653997fe3cf (diff)
downloadQt-46ba213883cf46871ef539ef4d2304064b671175.zip
Qt-46ba213883cf46871ef539ef4d2304064b671175.tar.gz
Qt-46ba213883cf46871ef539ef4d2304064b671175.tar.bz2
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: Fix double click event on Mac OS X. Autotest for QVariant value types Fix memory leak Clarify Component.createObject(null) behavior.
Diffstat (limited to 'src')
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp4
-rw-r--r--src/declarative/qml/qdeclarativevme.cpp5
-rw-r--r--src/gui/kernel/qt_cocoa_helpers_mac.mm4
3 files changed, 12 insertions, 1 deletions
diff --git a/src/declarative/qml/qdeclarativecomponent.cpp b/src/declarative/qml/qdeclarativecomponent.cpp
index e2cbdcf..f716f85 100644
--- a/src/declarative/qml/qdeclarativecomponent.cpp
+++ b/src/declarative/qml/qdeclarativecomponent.cpp
@@ -627,6 +627,10 @@ QDeclarativeComponent::QDeclarativeComponent(QDeclarativeComponentPrivate &dd, Q
must provide a valid \a parent value or set the returned object's \l{Item::parent}{parent}
property, or else the object will not be visible.
+ If a \a parent is not provided to createObject(), a reference to the returned object must be held so that
+ it is not destroyed by the garbage collector. This is regardless of Item.parent being set afterwards,
+ since setting the Item parent does not change object ownership; only the graphical parent is changed.
+
Dynamically created instances can be deleted with the \c destroy() method.
See \l {Dynamic Object Management in QML} for more information.
*/
diff --git a/src/declarative/qml/qdeclarativevme.cpp b/src/declarative/qml/qdeclarativevme.cpp
index 6d49625..fb07bef 100644
--- a/src/declarative/qml/qdeclarativevme.cpp
+++ b/src/declarative/qml/qdeclarativevme.cpp
@@ -938,8 +938,13 @@ QObject *QDeclarativeVME::run(QDeclarativeVMEStack<QObject *> &stack,
if (bindValues.count)
ep->bindValues << bindValues;
+ else if (bindValues.values)
+ bindValues.clear();
+
if (parserStatus.count)
ep->parserStatus << parserStatus;
+ else if (parserStatus.values)
+ parserStatus.clear();
Q_ASSERT(stack.count() == 1);
return stack.top();
diff --git a/src/gui/kernel/qt_cocoa_helpers_mac.mm b/src/gui/kernel/qt_cocoa_helpers_mac.mm
index 3a0cafd..b2d9ca6 100644
--- a/src/gui/kernel/qt_cocoa_helpers_mac.mm
+++ b/src/gui/kernel/qt_cocoa_helpers_mac.mm
@@ -1053,6 +1053,7 @@ bool qt_mac_handleMouseEvent(void * /* NSView * */view, void * /* NSEvent * */ev
Qt::KeyboardModifiers keyMods = qt_cocoaModifiers2QtModifiers([theEvent modifierFlags]);
NSInteger clickCount = [theEvent clickCount];
Qt::MouseButtons buttons = 0;
+ static Qt::MouseButton previousButton = Qt::NoButton;
{
UInt32 mac_buttons;
if (GetEventParameter(carbonEvent, kEventParamMouseChord, typeUInt32, 0,
@@ -1071,7 +1072,7 @@ bool qt_mac_handleMouseEvent(void * /* NSView * */view, void * /* NSEvent * */ev
#ifndef QT_NAMESPACE
Q_ASSERT(clickCount > 0);
#endif
- if (clickCount % 2 == 0 && buttons == button)
+ if (clickCount % 2 == 0 && (previousButton == Qt::NoButton || previousButton == button))
eventType = QEvent::MouseButtonDblClick;
if (button == Qt::LeftButton && (keyMods & Qt::MetaModifier)) {
button = Qt::RightButton;
@@ -1105,6 +1106,7 @@ bool qt_mac_handleMouseEvent(void * /* NSView * */view, void * /* NSEvent * */ev
QContextMenuEvent qcme(QContextMenuEvent::Mouse, qlocalPoint, qglobalPoint, keyMods);
qt_sendSpontaneousEvent(widgetToGetMouse, &qcme);
}
+ previousButton = button;
return true;
#endif
}