aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/imports/qtquick2/plugins.qmltypes277
-rw-r--r--src/imports/window/plugins.qmltypes36
-rw-r--r--src/qml/compiler/qv4compileddata_p.h11
-rw-r--r--src/qml/compiler/qv4compiler.cpp6
-rw-r--r--src/qml/compiler/qv4ssa.cpp32
-rw-r--r--src/qml/doc/src/cppintegration/exposecppattributes.qdoc5
-rw-r--r--src/qml/doc/src/javascript/expressions.qdoc32
-rw-r--r--src/qml/doc/src/javascript/topic.qdoc13
-rw-r--r--src/qml/doc/src/qmllanguageref/documents/scope.qdoc8
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc52
-rw-r--r--src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc91
-rw-r--r--src/qml/jsapi/qjsengine.cpp13
-rw-r--r--src/qml/jsapi/qjsvalueiterator.cpp9
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp4
-rw-r--r--src/qml/jsruntime/qv4numberobject.cpp2
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp11
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp18
-rw-r--r--src/quick/accessible/qaccessiblequickitem.cpp22
-rw-r--r--src/quick/accessible/qaccessiblequickitem_p.h5
-rw-r--r--src/quick/doc/src/concepts/convenience/topic.qdoc13
-rw-r--r--src/quick/items/context2d/qquickcontext2d.cpp6
-rw-r--r--src/quick/items/qquickimage.cpp2
-rw-r--r--src/quick/items/qquickimage_p.h2
-rw-r--r--src/quick/items/qquickitem.cpp8
-rw-r--r--src/quick/items/qquickitemsmodule.cpp2
-rw-r--r--src/quick/items/qquicktextcontrol.cpp7
-rw-r--r--src/quick/items/qquickwindow.cpp10
-rw-r--r--src/quick/items/qquickwindowmodule.cpp1
-rw-r--r--src/quick/util/qquickanimatorcontroller.cpp42
-rw-r--r--src/quick/util/qquickanimatorcontroller_p.h4
-rw-r--r--src/quick/util/qquickanimatorjob.cpp26
-rw-r--r--src/quick/util/qquickanimatorjob_p.h4
-rw-r--r--src/quickwidgets/qquickwidget.cpp22
-rw-r--r--src/quickwidgets/qquickwidget.h3
34 files changed, 599 insertions, 200 deletions
diff --git a/src/imports/qtquick2/plugins.qmltypes b/src/imports/qtquick2/plugins.qmltypes
index cadef10370..dd41871e45 100644
--- a/src/imports/qtquick2/plugins.qmltypes
+++ b/src/imports/qtquick2/plugins.qmltypes
@@ -176,6 +176,7 @@ Module {
name: "QInputMethod"
prototype: "QObject"
exports: ["QtQuick/InputMethod 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "Action"
@@ -225,6 +226,7 @@ Module {
Component {
name: "QKeySequence"
exports: ["QtQuick/StandardKey 2.2"]
+ isCreatable: false
exportMetaObjectRevisions: [2]
Enum {
name: "StandardKey"
@@ -514,6 +516,7 @@ Module {
name: "QQmlEasingValueType"
prototype: "QQmlValueType"
exports: ["QtQuick/Easing 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "Type"
@@ -677,6 +680,7 @@ Module {
Component {
name: "QQmlLocale"
exports: ["QtQml/Locale 2.2", "QtQuick/Locale 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0, 0]
Enum {
name: "MeasurementSystem"
@@ -750,6 +754,7 @@ Module {
name: "QQuickAbstractAnimation"
prototype: "QObject"
exports: ["QtQuick/Animation 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "Loops"
@@ -790,10 +795,81 @@ Module {
name: "QQuickAccessibleAttached"
prototype: "QObject"
exports: ["QtQuick/Accessible 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "role"; type: "QAccessible::Role" }
Property { name: "name"; type: "string" }
Property { name: "description"; type: "string" }
+ Property { name: "checkable"; type: "bool" }
+ Property { name: "checked"; type: "bool" }
+ Property { name: "editable"; type: "bool" }
+ Property { name: "focusable"; type: "bool" }
+ Property { name: "focused"; type: "bool" }
+ Property { name: "multiLine"; type: "bool" }
+ Property { name: "readOnly"; type: "bool" }
+ Property { name: "selected"; type: "bool" }
+ Property { name: "selectable"; type: "bool" }
+ Property { name: "pressed"; type: "bool" }
+ Property { name: "checkStateMixed"; type: "bool" }
+ Property { name: "defaultButton"; type: "bool" }
+ Property { name: "passwordEdit"; type: "bool" }
+ Property { name: "selectableText"; type: "bool" }
+ Signal {
+ name: "checkableChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "checkedChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "editableChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "focusableChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "focusedChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "multiLineChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "readOnlyChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "selectedChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "selectableChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "pressedChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "checkStateMixedChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "defaultButtonChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "passwordEditChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "selectableTextChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
Method { name: "valueChanged" }
Method { name: "cursorPositionChanged" }
}
@@ -1051,6 +1127,7 @@ Module {
name: "QQuickAnimator"
prototype: "QQuickAbstractAnimation"
exports: ["QtQuick/Animator 2.2"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "target"; type: "QQuickItem"; isPointer: true }
Property { name: "easing"; type: "QEasingCurve" }
@@ -1082,6 +1159,7 @@ Module {
name: "QQuickApplication"
prototype: "QQmlApplication"
exports: ["QtQuick/Application 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "active"; type: "bool"; isReadonly: true }
Property { name: "layoutDirection"; type: "Qt::LayoutDirection"; isReadonly: true }
@@ -1097,6 +1175,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
exports: ["QtQuick/Positioner 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
attachedType: "QQuickPositionerAttached"
Property { name: "spacing"; type: "double" }
@@ -1221,6 +1300,11 @@ Module {
Method { name: "toDataURL"; type: "string" }
}
Component {
+ name: "QQuickCloseEvent"
+ prototype: "QObject"
+ Property { name: "accepted"; type: "bool" }
+ }
+ Component {
name: "QQuickColorAnimation"
prototype: "QQuickPropertyAnimation"
exports: ["QtQuick/ColorAnimation 2.0"]
@@ -1255,6 +1339,7 @@ Module {
name: "QQuickDrag"
prototype: "QObject"
exports: ["QtQuick/Drag 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
attachedType: "QQuickDragAttached"
Enum {
@@ -1345,6 +1430,39 @@ Module {
Signal { name: "positionChanged" }
}
Component {
+ name: "QQuickDropEvent"
+ prototype: "QObject"
+ Property { name: "x"; type: "double"; isReadonly: true }
+ Property { name: "y"; type: "double"; isReadonly: true }
+ Property { name: "source"; type: "QObject"; isReadonly: true; isPointer: true }
+ Property { name: "keys"; type: "QStringList"; isReadonly: true }
+ Property { name: "supportedActions"; type: "Qt::DropActions"; isReadonly: true }
+ Property { name: "proposedAction"; type: "Qt::DropActions"; isReadonly: true }
+ Property { name: "action"; type: "Qt::DropAction" }
+ Property { name: "accepted"; type: "bool" }
+ Property { name: "hasColor"; type: "bool"; isReadonly: true }
+ Property { name: "hasHtml"; type: "bool"; isReadonly: true }
+ Property { name: "hasText"; type: "bool"; isReadonly: true }
+ Property { name: "hasUrls"; type: "bool"; isReadonly: true }
+ Property { name: "colorData"; type: "QVariant"; isReadonly: true }
+ Property { name: "html"; type: "string"; isReadonly: true }
+ Property { name: "text"; type: "string"; isReadonly: true }
+ Property { name: "urls"; type: "QList<QUrl>"; isReadonly: true }
+ Property { name: "formats"; type: "QStringList"; isReadonly: true }
+ Method {
+ name: "getDataAsString"
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ Method {
+ name: "acceptProposedAction"
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ Method {
+ name: "accept"
+ Parameter { type: "QQmlV4Function"; isPointer: true }
+ }
+ }
+ Component {
name: "QQuickFlickable"
defaultProperty: "flickableData"
prototype: "QQuickItem"
@@ -1517,6 +1635,7 @@ Module {
name: "QQuickFontValueType"
prototype: "QQmlValueType"
exports: ["QtQuick/Font 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "FontWeight"
@@ -1552,6 +1671,13 @@ Module {
Property { name: "wordSpacing"; type: "double" }
}
Component {
+ name: "QQuickGrabGestureEvent"
+ prototype: "QObject"
+ Property { name: "touchPoints"; type: "QObject"; isList: true; isReadonly: true }
+ Property { name: "dragThreshold"; type: "double"; isReadonly: true }
+ Method { name: "grab" }
+ }
+ Component {
name: "QQuickGradient"
defaultProperty: "stops"
prototype: "QObject"
@@ -1667,17 +1793,13 @@ Module {
Method { name: "moveCurrentIndexLeft" }
Method { name: "moveCurrentIndexRight" }
}
- Component {
- name: "QQuickGridViewAttached"
- prototype: "QQuickItemViewAttached"
- Property { name: "view"; type: "QQuickGridView"; isReadonly: true; isPointer: true }
- }
+ Component { name: "QQuickGridViewAttached"; prototype: "QQuickItemViewAttached" }
Component {
name: "QQuickImage"
defaultProperty: "data"
prototype: "QQuickImageBase"
- exports: ["QtQuick/Image 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: ["QtQuick/Image 2.0", "QtQuick/Image 2.3"]
+ exportMetaObjectRevisions: [0, 1]
Enum {
name: "HAlignment"
values: {
@@ -1711,6 +1833,7 @@ Module {
Property { name: "paintedHeight"; type: "double"; isReadonly: true }
Property { name: "horizontalAlignment"; type: "HAlignment" }
Property { name: "verticalAlignment"; type: "VAlignment" }
+ Property { name: "mipmap"; revision: 1; type: "bool" }
Signal { name: "paintedGeometryChanged" }
Signal {
name: "horizontalAlignmentChanged"
@@ -1720,6 +1843,11 @@ Module {
name: "verticalAlignmentChanged"
Parameter { name: "alignment"; type: "VAlignment" }
}
+ Signal {
+ name: "mipmapChanged"
+ revision: 1
+ Parameter { type: "bool" }
+ }
}
Component {
name: "QQuickImageBase"
@@ -1967,8 +2095,9 @@ Module {
name: "QQuickItemView"
defaultProperty: "flickableData"
prototype: "QQuickFlickable"
- exports: ["QtQuick/ItemView 2.1"]
- exportMetaObjectRevisions: [1]
+ exports: ["QtQuick/ItemView 2.1", "QtQuick/ItemView 2.3"]
+ isCreatable: false
+ exportMetaObjectRevisions: [1, 2]
Enum {
name: "LayoutDirection"
values: {
@@ -2011,6 +2140,8 @@ Module {
Property { name: "currentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
Property { name: "keyNavigationWraps"; type: "bool" }
Property { name: "cacheBuffer"; type: "int" }
+ Property { name: "displayMarginBeginning"; revision: 2; type: "int" }
+ Property { name: "displayMarginEnd"; revision: 2; type: "int" }
Property { name: "layoutDirection"; type: "Qt::LayoutDirection" }
Property { name: "effectiveLayoutDirection"; type: "Qt::LayoutDirection"; isReadonly: true }
Property { name: "verticalLayoutDirection"; type: "VerticalLayoutDirection" }
@@ -2065,6 +2196,7 @@ Module {
Component {
name: "QQuickItemViewAttached"
prototype: "QObject"
+ Property { name: "view"; type: "QQuickItemView"; isReadonly: true; isPointer: true }
Property { name: "isCurrentItem"; type: "bool"; isReadonly: true }
Property { name: "delayRemove"; type: "bool" }
Property { name: "section"; type: "string"; isReadonly: true }
@@ -2076,9 +2208,27 @@ Module {
Signal { name: "prevSectionChanged" }
}
Component {
+ name: "QQuickKeyEvent"
+ prototype: "QObject"
+ Property { name: "key"; type: "int"; isReadonly: true }
+ Property { name: "text"; type: "string"; isReadonly: true }
+ Property { name: "modifiers"; type: "int"; isReadonly: true }
+ Property { name: "isAutoRepeat"; type: "bool"; isReadonly: true }
+ Property { name: "count"; type: "int"; isReadonly: true }
+ Property { name: "nativeScanCode"; type: "uint"; isReadonly: true }
+ Property { name: "accepted"; type: "bool" }
+ Method {
+ name: "matches"
+ revision: 2
+ type: "bool"
+ Parameter { name: "key"; type: "QKeySequence::StandardKey" }
+ }
+ }
+ Component {
name: "QQuickKeyNavigationAttached"
prototype: "QObject"
exports: ["QtQuick/KeyNavigation 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "Priority"
@@ -2099,6 +2249,7 @@ Module {
name: "QQuickKeysAttached"
prototype: "QObject"
exports: ["QtQuick/Keys 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "Priority"
@@ -2275,6 +2426,7 @@ Module {
name: "QQuickLayoutMirroringAttached"
prototype: "QObject"
exports: ["QtQuick/LayoutMirroring 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "enabled"; type: "bool" }
Property { name: "childrenInherit"; type: "bool" }
@@ -2312,11 +2464,7 @@ Module {
Method { name: "incrementCurrentIndex" }
Method { name: "decrementCurrentIndex" }
}
- Component {
- name: "QQuickListViewAttached"
- prototype: "QQuickItemViewAttached"
- Property { name: "view"; type: "QQuickListView"; isReadonly: true; isPointer: true }
- }
+ Component { name: "QQuickListViewAttached"; prototype: "QQuickItemViewAttached" }
Component {
name: "QQuickLoader"
defaultProperty: "data"
@@ -2346,6 +2494,13 @@ Module {
}
}
Component {
+ name: "QQuickMatrix4x4"
+ prototype: "QQuickTransform"
+ exports: ["QtQuick/Matrix4x4 2.3"]
+ exportMetaObjectRevisions: [0]
+ Property { name: "matrix"; type: "QMatrix4x4" }
+ }
+ Component {
name: "QQuickMouseArea"
defaultProperty: "data"
prototype: "QQuickItem"
@@ -2425,6 +2580,7 @@ Module {
Property { name: "touchPoints"; type: "QQuickTouchPoint"; isList: true; isReadonly: true }
Property { name: "minimumTouchPoints"; type: "int" }
Property { name: "maximumTouchPoints"; type: "int" }
+ Property { name: "mouseEnabled"; type: "bool" }
Signal {
name: "pressed"
Parameter { name: "touchPoints"; type: "QList<QObject*>" }
@@ -2483,6 +2639,7 @@ Module {
defaultProperty: "data"
prototype: "QQuickItem"
exports: ["QtQuick/PaintedItem 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Enum {
name: "RenderTarget"
@@ -2844,6 +3001,24 @@ Module {
}
}
Component {
+ name: "QQuickPinchEvent"
+ prototype: "QObject"
+ Property { name: "center"; type: "QPointF"; isReadonly: true }
+ Property { name: "startCenter"; type: "QPointF"; isReadonly: true }
+ Property { name: "previousCenter"; type: "QPointF"; isReadonly: true }
+ Property { name: "scale"; type: "double"; isReadonly: true }
+ Property { name: "previousScale"; type: "double"; isReadonly: true }
+ Property { name: "angle"; type: "double"; isReadonly: true }
+ Property { name: "previousAngle"; type: "double"; isReadonly: true }
+ Property { name: "rotation"; type: "double"; isReadonly: true }
+ Property { name: "point1"; type: "QPointF"; isReadonly: true }
+ Property { name: "startPoint1"; type: "QPointF"; isReadonly: true }
+ Property { name: "point2"; type: "QPointF"; isReadonly: true }
+ Property { name: "startPoint2"; type: "QPointF"; isReadonly: true }
+ Property { name: "pointCount"; type: "int"; isReadonly: true }
+ Property { name: "accepted"; type: "bool" }
+ }
+ Component {
name: "QQuickPositionerAttached"
prototype: "QObject"
Property { name: "index"; type: "int"; isReadonly: true }
@@ -3081,6 +3256,7 @@ Module {
name: "QQuickShaderEffectMesh"
prototype: "QObject"
exports: ["QtQuick/ShaderEffectMesh 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Signal { name: "geometryChanged" }
}
@@ -3430,8 +3606,8 @@ Module {
name: "QQuickText"
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
- exports: ["QtQuick/Text 2.0", "QtQuick/Text 2.2"]
- exportMetaObjectRevisions: [0, 2]
+ exports: ["QtQuick/Text 2.0", "QtQuick/Text 2.2", "QtQuick/Text 2.3"]
+ exportMetaObjectRevisions: [0, 2, 3]
Enum {
name: "HAlignment"
values: {
@@ -3587,6 +3763,13 @@ Module {
Parameter { name: "line"; type: "QQuickTextLine"; isPointer: true }
}
Method { name: "doLayout" }
+ Method {
+ name: "linkAt"
+ revision: 3
+ type: "string"
+ Parameter { name: "x"; type: "double" }
+ Parameter { name: "y"; type: "double" }
+ }
}
Component { name: "QQuickTextDocument"; prototype: "QObject" }
Component {
@@ -3596,9 +3779,10 @@ Module {
exports: [
"QtQuick/TextEdit 2.0",
"QtQuick/TextEdit 2.1",
- "QtQuick/TextEdit 2.2"
+ "QtQuick/TextEdit 2.2",
+ "QtQuick/TextEdit 2.3"
]
- exportMetaObjectRevisions: [0, 1, 2]
+ exportMetaObjectRevisions: [0, 1, 2, 3]
Enum {
name: "HAlignment"
values: {
@@ -3830,13 +4014,20 @@ Module {
Parameter { name: "start"; type: "int" }
Parameter { name: "end"; type: "int" }
}
+ Method {
+ name: "linkAt"
+ revision: 3
+ type: "string"
+ Parameter { name: "x"; type: "double" }
+ Parameter { name: "y"; type: "double" }
+ }
}
Component {
name: "QQuickTextInput"
defaultProperty: "data"
prototype: "QQuickImplicitSizeItem"
- exports: ["QtQuick/TextInput 2.0"]
- exportMetaObjectRevisions: [0]
+ exports: ["QtQuick/TextInput 2.0", "QtQuick/TextInput 2.2"]
+ exportMetaObjectRevisions: [0, 2]
Enum {
name: "EchoMode"
values: {
@@ -3932,6 +4123,7 @@ Module {
Property { name: "contentHeight"; type: "double"; isReadonly: true }
Property { name: "renderType"; type: "RenderType" }
Signal { name: "accepted" }
+ Signal { name: "editingFinished"; revision: 2 }
Signal {
name: "fontChanged"
Parameter { name: "font"; type: "QFont" }
@@ -4036,6 +4228,15 @@ Module {
}
}
Component {
+ name: "QQuickTextLine"
+ prototype: "QObject"
+ Property { name: "number"; type: "int"; isReadonly: true }
+ Property { name: "width"; type: "double" }
+ Property { name: "height"; type: "double" }
+ Property { name: "x"; type: "double" }
+ Property { name: "y"; type: "double" }
+ }
+ Component {
name: "QQuickTouchPoint"
prototype: "QObject"
exports: ["QtQuick/TouchPoint 2.0"]
@@ -4125,6 +4326,7 @@ Module {
name: "QQuickViewTransitionAttached"
prototype: "QObject"
exports: ["QtQuick/ViewTransition 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
Property { name: "index"; type: "int"; isReadonly: true }
Property { name: "item"; type: "QQuickItem"; isReadonly: true; isPointer: true }
@@ -4133,6 +4335,17 @@ Module {
Property { name: "targetItems"; type: "QObject"; isList: true; isReadonly: true }
}
Component {
+ name: "QQuickWheelEvent"
+ prototype: "QObject"
+ Property { name: "x"; type: "double"; isReadonly: true }
+ Property { name: "y"; type: "double"; isReadonly: true }
+ Property { name: "angleDelta"; type: "QPoint"; isReadonly: true }
+ Property { name: "pixelDelta"; type: "QPoint"; isReadonly: true }
+ Property { name: "buttons"; type: "int"; isReadonly: true }
+ Property { name: "modifiers"; type: "int"; isReadonly: true }
+ Property { name: "accepted"; type: "bool" }
+ }
+ Component {
name: "QQuickWorkerScript"
prototype: "QObject"
exports: ["QtQuick/WorkerScript 2.0"]
@@ -4585,7 +4798,10 @@ Module {
"AA_SynthesizeTouchForUnhandledMouseEvents": 11,
"AA_SynthesizeMouseForUnhandledTouchEvents": 12,
"AA_UseHighDpiPixmaps": 13,
- "AA_AttributeCount": 14
+ "AA_ForceRasterWidgets": 14,
+ "AA_UseDesktopOpenGL": 15,
+ "AA_UseOpenGLES": 16,
+ "AA_AttributeCount": 17
}
}
Enum {
@@ -5027,6 +5243,9 @@ Module {
"Key_Blue": 16777495,
"Key_ChannelUp": 16777496,
"Key_ChannelDown": 16777497,
+ "Key_Guide": 16777498,
+ "Key_Info": 16777499,
+ "Key_Settings": 16777500,
"Key_MediaLast": 16842751,
"Key_Select": 16842752,
"Key_Yes": 16842753,
@@ -5037,6 +5256,7 @@ Module {
"Key_Sleep": 16908292,
"Key_Play": 16908293,
"Key_Zoom": 16908294,
+ "Key_Exit": 16908298,
"Key_Context1": 17825792,
"Key_Context2": 17825793,
"Key_Context3": 17825794,
@@ -5288,6 +5508,15 @@ Module {
}
}
Enum {
+ name: "Edges"
+ values: {
+ "TopEdge": 1,
+ "LeftEdge": 2,
+ "RightEdge": 4,
+ "BottomEdge": 8
+ }
+ }
+ Enum {
name: "ConnectionType"
values: {
"AutoConnection": 0,
@@ -5376,6 +5605,9 @@ Module {
"ImAnchorPosition": 128,
"ImHints": 256,
"ImPreferredLanguage": 512,
+ "ImAbsolutePosition": 1024,
+ "ImTextBeforeCursor": 2048,
+ "ImTextAfterCursor": 4096,
"ImPlatformData": -2147483648,
"ImQueryInput": 186,
"ImQueryAll": -1
@@ -5395,6 +5627,9 @@ Module {
"ImAnchorPosition": 128,
"ImHints": 256,
"ImPreferredLanguage": 512,
+ "ImAbsolutePosition": 1024,
+ "ImTextBeforeCursor": 2048,
+ "ImTextAfterCursor": 4096,
"ImPlatformData": -2147483648,
"ImQueryInput": 186,
"ImQueryAll": -1
diff --git a/src/imports/window/plugins.qmltypes b/src/imports/window/plugins.qmltypes
index 1e3577acda..f69359b125 100644
--- a/src/imports/window/plugins.qmltypes
+++ b/src/imports/window/plugins.qmltypes
@@ -24,6 +24,7 @@ Module {
name: "QQuickScreen"
prototype: "QObject"
exports: ["QtQuick.Window/Screen 2.0"]
+ isCreatable: false
exportMetaObjectRevisions: [0]
attachedType: "QQuickScreenAttached"
}
@@ -56,6 +57,12 @@ Module {
prototype: "QWindow"
exports: ["QtQuick.Window/Window 2.0"]
exportMetaObjectRevisions: [0]
+ Enum {
+ name: "SceneGraphError"
+ values: {
+ "ContextNotAvailable": 1
+ }
+ }
Property { name: "data"; type: "QObject"; isList: true; isReadonly: true }
Property { name: "color"; type: "QColor" }
Property { name: "contentItem"; type: "QQuickItem"; isReadonly: true; isPointer: true }
@@ -67,11 +74,19 @@ Module {
isPointer: true
}
Signal { name: "frameSwapped" }
+ Signal {
+ name: "openglContextCreated"
+ revision: 2
+ Parameter { name: "context"; type: "QOpenGLContext"; isPointer: true }
+ }
Signal { name: "sceneGraphInitialized" }
Signal { name: "sceneGraphInvalidated" }
Signal { name: "beforeSynchronizing" }
+ Signal { name: "afterSynchronizing"; revision: 2 }
Signal { name: "beforeRendering" }
Signal { name: "afterRendering" }
+ Signal { name: "afterAnimating"; revision: 2 }
+ Signal { name: "sceneGraphAboutToStop"; revision: 2 }
Signal {
name: "closing"
revision: 1
@@ -82,6 +97,12 @@ Module {
Parameter { type: "QColor" }
}
Signal { name: "activeFocusItemChanged"; revision: 1 }
+ Signal {
+ name: "sceneGraphError"
+ revision: 2
+ Parameter { name: "error"; type: "QQuickWindow::SceneGraphError" }
+ Parameter { name: "message"; type: "string" }
+ }
Method { name: "update" }
Method { name: "releaseResources" }
}
@@ -91,6 +112,16 @@ Module {
prototype: "QQuickWindow"
exports: ["QtQuick.Window/Window 2.1"]
exportMetaObjectRevisions: [0]
+ Property { name: "visible"; type: "bool" }
+ Property { name: "visibility"; type: "Visibility" }
+ Signal {
+ name: "visibleChanged"
+ Parameter { name: "arg"; type: "bool" }
+ }
+ Signal {
+ name: "visibilityChanged"
+ Parameter { name: "visibility"; type: "QWindow::Visibility" }
+ }
}
Component {
name: "QWindow"
@@ -135,6 +166,11 @@ Module {
Parameter { name: "windowState"; type: "Qt::WindowState" }
}
Signal {
+ name: "windowTitleChanged"
+ revision: 2
+ Parameter { name: "title"; type: "string" }
+ }
+ Signal {
name: "xChanged"
Parameter { name: "arg"; type: "int" }
}
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 1fba6c0d3c..6ee23690a6 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -151,7 +151,7 @@ struct JSClass
struct String
{
quint32 flags; // isArrayIndex
- QArrayData str;
+ qint32 size;
// uint16 strdata[]
static int calculateSize(const QString &str) {
@@ -195,13 +195,12 @@ struct Unit
const uint *offsetTable = reinterpret_cast<const uint*>((reinterpret_cast<const char *>(this)) + offsetToStringTable);
const uint offset = offsetTable[idx];
const String *str = reinterpret_cast<const String*>(reinterpret_cast<const char *>(this) + offset);
- if (str->str.size == 0)
+ if (str->size == 0)
return QString();
- QStringDataPtr holder = { const_cast<QStringData *>(static_cast<const QStringData*>(&str->str)) };
- QString qstr(holder);
+ const QChar *characters = reinterpret_cast<const QChar *>(str + 1);
if (flags & StaticData)
- return qstr;
- return QString(qstr.constData(), qstr.length());
+ return QString::fromRawData(characters, str->size);
+ return QString(characters, str->size);
}
const uint *functionOffsetTable() const { return reinterpret_cast<const uint*>((reinterpret_cast<const char *>(this)) + offsetToFunctionTable); }
diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp
index 65ef5c4b5e..144ef8a79e 100644
--- a/src/qml/compiler/qv4compiler.cpp
+++ b/src/qml/compiler/qv4compiler.cpp
@@ -82,11 +82,7 @@ void QV4::Compiler::StringTableGenerator::serialize(uint *stringTable, char *dat
QV4::CompiledData::String *s = (QV4::CompiledData::String*)(stringData);
s->flags = 0; // ###
- s->str.ref.atomic.store(-1);
- s->str.size = qstr.length();
- s->str.alloc = 0;
- s->str.capacityReserved = false;
- s->str.offset = sizeof(QArrayData);
+ s->size = qstr.length();
memcpy(s + 1, qstr.constData(), (qstr.length() + 1)*sizeof(ushort));
stringData += QV4::CompiledData::String::calculateSize(qstr);
diff --git a/src/qml/compiler/qv4ssa.cpp b/src/qml/compiler/qv4ssa.cpp
index e5c66a8929..48c68533ba 100644
--- a/src/qml/compiler/qv4ssa.cpp
+++ b/src/qml/compiler/qv4ssa.cpp
@@ -154,18 +154,13 @@ public:
else
flagIt = set.blockFlags->size();
} else {
- if (set.blockNumbers) {
+ if (set.blockNumbers)
numberIt = set.blockNumbers->begin();
- } else {
- flagIt = 0;
- size_t eIt = set.blockFlags->size();
- while (flagIt != eIt) {
- if (set.blockFlags->operator[](flagIt))
- break;
- else
- ++flagIt;
- }
- }
+ else
+ flagIt = std::distance(set.blockFlags->begin(),
+ std::find(set.blockFlags->begin(),
+ set.blockFlags->end(),
+ true));
}
}
@@ -195,16 +190,13 @@ public:
const_iterator &operator++()
{
- if (set.blockNumbers) {
+ if (set.blockNumbers)
++numberIt;
- } else {
- size_t eIt = set.blockFlags->size();
- while (flagIt != eIt) {
- ++flagIt;
- if (flagIt == eIt || set.blockFlags->operator[](flagIt))
- break;
- }
- }
+ else
+ flagIt = std::distance(set.blockFlags->begin(),
+ std::find(set.blockFlags->begin() + flagIt + 1,
+ set.blockFlags->end(),
+ true));
return *this;
}
diff --git a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
index 86715e93f1..f02c3da6af 100644
--- a/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
+++ b/src/qml/doc/src/cppintegration/exposecppattributes.qdoc
@@ -148,8 +148,9 @@ Text {
For maximum interoperability with QML, \b {any property that is writable should
have an associated NOTIFY signal} that is emitted whenever the property value
has changed. This allows the property to be used with \l{Property
-Binding}{property binding}, which is an essential feature of QML that enables
-specific values to be updated whenever an associated property changes.
+Binding}{property binding}, which is an essential feature of QML that enforces
+relationships between properties by automatically updating a property whenever
+any of its dependencies change in value.
In the above example, the associated NOTIFY signal for the \c author property is
\c authorChanged, as specified in the Q_PROPERTY() macro call. This means that
diff --git a/src/qml/doc/src/javascript/expressions.qdoc b/src/qml/doc/src/javascript/expressions.qdoc
index c33daf7acc..79c11b3ac5 100644
--- a/src/qml/doc/src/javascript/expressions.qdoc
+++ b/src/qml/doc/src/javascript/expressions.qdoc
@@ -57,30 +57,28 @@ QML \l{QML Object Types}{object types} defined in \l{QML Documents}
{QML documents} can make use of JavaScript expressions which implement program
logic. There are four ways that JavaScript can be used in a QML document:
-\list
- \li \l{Property Attributes}{properties} can be
- assigned \l{Property Binding}{bindings} which are defined with
- JavaScript expressions, and which are automatically evaluated by the
- \l{QQmlEngine}{QML engine} when any properties accessed in the binding
- change, in order to ensure always-up-to-date property values. Binding
- expressions can also perform function evaluation as an explicit side
- effect
- \li \l{Signal Attributes}{signal handlers} can be defined
+\list 1
+ \li Relationships between \l{Property Attributes}{properties} are described
+ using JavaScript expressions in \l{Property Binding}{property bindings}.
+ When any of a property's \e dependencies change, the property is
+ automatically updated too, according to the specified relationship.
+ \li \l{Signal Attributes}{Signal handlers} can be defined
which are automatically evaluated when the object emits the associated
- signal
- \li \l{Method Attributes}{custom methods} can be defined
- in QML files as JavaScript functions
+ signal.
+ \li \l{Method Attributes}{Custom methods} can be defined
+ in QML files as JavaScript functions.
\li JavaScript files providing functions and variables can be
\l{Importing JavaScript Resources in QML}{imported} in a QML
- document
+ document.
\endlist
\section2 Property Bindings
-During startup, the QML engine will set up and initialize the property
-bindings. The JavaScript conditional operator is a valid property binding.
+In the following example, the \l Rectangle's \c color depends on the
+\l MouseArea's \c pressed property. This relationship is described using a
+conditional expression:
\qml
import QtQuick 2.0
@@ -100,7 +98,9 @@ Rectangle {
In fact, any JavaScript expression (no matter how complex) may be used in a
property binding definition, as long as the result of the expression is a
-value whose type can be assigned to the property.
+value whose type can be assigned to the property. This includes side effects.
+However, complex bindings and side effects are discouraged because they can
+reduce the performance, readability, and maintainability of the code.
There are two ways to define a property binding: the first (and most common)
is, as previously shown, in a \l{QML Object Attributes#Value Assignment on Initialization}
diff --git a/src/qml/doc/src/javascript/topic.qdoc b/src/qml/doc/src/javascript/topic.qdoc
index 40602b5017..f341816201 100644
--- a/src/qml/doc/src/javascript/topic.qdoc
+++ b/src/qml/doc/src/javascript/topic.qdoc
@@ -38,14 +38,11 @@ JavaScript to quickly develop both user-interfaces and application logic.
\section1 JavaScript Expressions
-QML has a deep JavaScript integration, and allows
-\l{Signal Attributes}{signal handlers}
-and \l{Method Attributes}{methods}
-to be defined in JavaScript. One of the other fundamental concepts of QML is
-the ability to bind property values to the result of complex expressions which
-can include properties from other objects. These
-\l{Property Binding}{property bindings}
-are JavaScript expressions.
+QML has a deep JavaScript integration, and allows \l{Signal Attributes}
+{signal handlers} and \l{Method Attributes}{methods} to be defined in JavaScript.
+Another core feature of QML is the ability to specify and enforce relationships
+between object properties using \l{Property Binding}{property bindings}, which
+are also defined using JavaScript.
See the documentation page titled
\l{qtqml-javascript-expressions.html}{JavaScript Expressions in QML Documents}
diff --git a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc
index 845ca30b4f..af59afe1fb 100644
--- a/src/qml/doc/src/qmllanguageref/documents/scope.qdoc
+++ b/src/qml/doc/src/qmllanguageref/documents/scope.qdoc
@@ -105,11 +105,9 @@ ListView {
\section1 Binding Scope Object
-Property bindings are the most common use of JavaScript in QML. Property
-bindings associate the result of a JavaScript expression with a property of an
-object. The object to which the bound property belongs is known as the binding's
-scope object. In this QML simple declaration the \l Item object is the
-binding's scope object.
+An object which has a \l{Property Binding}{property binding} is known has the
+binding's \e{scope object}. In the following example, the \l Item object is
+the binding's scope object.
\code
Item {
diff --git a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
index 46a225ee30..3e48ec2308 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/objectattributes.qdoc
@@ -189,16 +189,16 @@ which was then imported by the client), then a property of type
\c ColorfulButton would also be valid.
-\section3 Values of Property Attributes
+\section3 Assigning Values to Property Attributes
-The value of a property of an object instance may specified in an
-object declaration in two separate ways:
+The value of a property of an object instance may specified in two separate ways:
\list
\li a value assignment on initialization
\li an imperative value assignment
\endlist
-The value in either case may be either a binding expression or a static value.
+In either case, the value may be either a \e static value or a \e {binding expression}
+value.
\section4 Value Assignment on Initialization
@@ -251,10 +251,11 @@ Rectangle {
}
\endqml
-\section4 Valid Property Values
+\section3 Static Values and Binding Expression Values
As previously noted, there are two kinds of values which may be assigned to a
-property: static values, and binding expression values.
+property: \e static values, and \e {binding expression} values. The latter are
+also known as \l{Property Binding}{property bindings}.
\table
\header
@@ -263,20 +264,21 @@ property: static values, and binding expression values.
\row
\li Static Value
- \li A value whose type matches (or can be converted to) that of
- the property may be assigned to the property.
+ \li A constant value which does not depend on other properties.
\row
\li Binding Expression
- \li A JavaScript expression which may be evaluated, whose result is a
- value whose type matches (or can be converted to) that of the
- property may be assigned to the property. The expression will be
- automatically re-evaluated (and the new result assigned to the
- property) by the QML engine should the value of any properties accessed
- during evaluation change.
+ \li A JavaScript expression which describes a property's relationship with
+ other properties. The variables in this expression are called the
+ property's \e dependencies.
+
+ The QML engine enforces the relationship between a property and its
+ dependencies. When any of the dependencies change in value, the QML
+ engine automatically re-evaluates the binding expression and assigns
+ the new result to the property.
\endtable
-An example of these two types of values being assigned to properties follows:
+Here is an example that shows both kinds of values being assigned to properties:
\qml
import QtQuick 2.0
@@ -294,19 +296,11 @@ Rectangle {
}
\endqml
-In many cases, a string value may be converted automatically to a
-different type of value, as QML provides string converters for many property
-types (thus you can assign the string \c "red" to a color property).
-
-It is important to note that in order to assign a binding expression to a
-property in an imperative value assignment, the right-hand-side of
-the assignment (the binding expression) must be a function returned by the
-\l{Qt::binding()}{Qt.binding()} function, which returns a value of the
-appropriate type. A binding expression value may be assigned to a property
-via an initialization value assignment without using that function (and, in
-fact, attempting to do so will result in an error). See the documentation
-about \l{qtqml-syntax-propertybinding.html}{property binding} for more
-information on the topic.
+\note To assign a binding expression imperatively, the binding expression
+must be contained in a function that is passed into \l{Qt::binding()}{Qt.binding()},
+and then the value returned by Qt.binding() must be assigned to the property.
+In contrast, Qt.binding() must not be used when assigning a binding expression
+upon initialization. See \l{Property Binding} for more information.
\section3 Type Safety
@@ -324,7 +318,7 @@ property int volume: "four" // generates an error; the property's object will n
Likewise if a property is assigned a value of the wrong type during run time,
the new value will not be assigned, and an error will be generated.
-As noted in a previous section, some property types do not have a natural
+Some property types do not have a natural
value representation, and for those property types the QML engine
automatically performs string-to-typed-value conversion. So, for example,
even though properties of the \c color type store colors and not strings,
diff --git a/src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc b/src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc
index 653fe2391e..4f4d6ed9d8 100644
--- a/src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc
+++ b/src/qml/doc/src/qmllanguageref/syntax/propertybinding.qdoc
@@ -30,32 +30,44 @@
\title Property Binding
\brief binding object properties
-To make the fullest use of QML and its built-in support for implementing dynamic object behavioral changes, most QML objects will use \e {property binding}. This is a core feature of QML that allows objects to automatically update their properties in response to changing attributes in other objects or the occurrence of some external event.
+An object's property can be assigned a static value which stays constant until it
+is explicitly assigned a new value. However, to make the fullest use of QML and its
+built-in support for dynamic object behaviors, most QML objects use \e {property bindings}.
-When an object's property is assigned a value, it can either be assigned a static value, or \e bound to a JavaScript expression. In the first case, the property's value will not change unless a new value is assigned to the property. In the latter case, a \e {property binding} is created and the property's value is automatically updated by the QML engine whenever the value of the evaluated expression changes.
+Property bindings are a core feature of QML that lets developers specify relationships
+between different object properties. When a property's \e dependencies change in
+value, the property is automatically updated according to the specified relationship.
+Behind the scenes, the QML engine monitors the property's dependencies (that is,
+the variables in the binding expression). When a change is detected, the QML engine
+re-evaluates the binding expression and applies the new result to the property.
\section1 Overview
-To create a property binding, a property is assigned an expression that evaluates to the desired value. At its simplest, an expression may simply be a reference to another object's property. Take the following example, where the blue \l Rectangle's \c height is bound to the height of its parent:
+To create a property binding, a property is assigned a JavaScript expression that
+evaluates to the desired value. At its simplest, a binding may be a reference to
+another property. Take the following example, where the blue \l Rectangle's height
+is bound to the height of its parent:
\qml
Rectangle {
width: 200; height: 200
Rectangle {
- width: 100; height: parent.height
+ width: 100
+ height: parent.height
color: "blue"
}
}
\endqml
-Whenever the \c height of the parent item changes, the \c height of the blue rectangle will update to be of the same value.
+Whenever the height of the parent rectangle changes, the height of the blue
+rectangle automatically updates to be of the same value.
-Furthermore, a binding can contain any valid JavaScript expression or
-statement, as QML uses a standards compliant JavaScript engine. Below are
-valid bindings that could be substituted for the \c height binding from the
-above example:
+A binding can contain any valid JavaScript expression or statement, as QML uses
+a standards compliant JavaScript engine. Bindings can access object properties,
+call methods and use built-in JavaScript objects such as \c Date and \c Math.
+Below are other possible bindings for the previous example:
\code
height: parent.height / 2
@@ -74,16 +86,16 @@ height: {
height: someMethodThatReturnsHeight()
\endcode
-Whenever the value of \c parent.height changes, the QML engine will re-evaluate the above expression and assign the blue rectangle's \c width property with the appropriate updated value.
-
-Bindings can access object properties, call methods and use built-in JavaScript objects such as \c Date and \c Math. Here is an example with various valid bindings:
+Below is a more complex example involving more objects and types:
\qml
Column {
+ id: column
width: 200
height: 200
Rectangle {
+ id: topRect
width: Math.max(bottomRect.width, parent.width/2)
height: (parent.height / 3) + 10
color: "yellow"
@@ -103,15 +115,33 @@ Column {
}
\endqml
-While syntactically bindings can be of arbitrary complexity, if a binding starts to become overly complex - such as involving multiple lines, or imperative loops - it may be better to refactor the component entirely, or at least factor the binding out into a separate function.
+In the previous example,
+\list
+\li \c topRect.width depends on \c bottomRect.width and \c column.width
+\li \c topRect.height depends on \c column.height
+\li \c bottomRect.color depends on \c myTextInput.text.length
+\endlist
+
+Syntactically, bindings are allowed to be of arbitrary complexity. However, if
+a binding is overly complex - such as involving multiple lines, or imperative
+loops - it could indicate that the binding is being used for more than describing
+property relationships. Complex bindings can reduce code performance, readability,
+and maintainability. It may be a good idea to redesign components that have
+complex bindings, or at least factor the binding out into a separate function.
\keyword qml-javascript-assignment
\section1 Creating Property Bindings from JavaScript
-Once a property has been bound to an expression, the property is set to be automatically updated as necessary. However, be aware that if the property is later assigned a static value from a JavaScript statement, this will remove the binding.
+A property with a binding is automatically updated as necessary. However, if the
+property is later assigned a static value from a JavaScript statement, the binding
+will be removed.
-For example, the \c height of the \l Rectangle below is initially bound to be twice its \c width. However, when the space key is pressed, the \c height value is changed to be three times its \c width. At this point, the \c height is assigned the currently evaluated result of \c width*3 and \e {the height will no longer be automatically updated whenever the width changes}. The assignment of the static value removes the binding.
+For example, the \l Rectangle below initially ensures that its \c height is always
+twice its \c width. However, when the space key is pressed, the current value
+of \c {width*3} will be assigned to \c height as a \e static value. After that,
+\e {the \c height will remain fixed at this value, even if the \c width changes}.
+The assignment of the static value removes the binding.
\qml
import QtQuick 2.0
@@ -127,7 +157,10 @@ Rectangle {
}
\endqml
-If the intention is to remove the binding, then this is not a problem. However if the intention is to create a new binding of \c width*3 then the property must be assigned a Qt.binding() value instead. This is done by passing a function to Qt.binding() that returns the desired result:
+If the intention is to give the rectangle a fixed height and stop automatic
+updates, then this is not a problem. However, if the intention is to establish
+a new relationship between \c width and \c height, then the new binding
+expression must be wrapped in the Qt.binding() function instead:
\qml
import QtQuick 2.0
@@ -143,22 +176,21 @@ Rectangle {
}
\endqml
-Now when the space key is pressed, a new binding of \c width*3 is assigned, instead of simply removing the initial binding.
+Now, after the space key is pressed, the rectangle's height will continue
+auto-updating to always be three times its width.
\section2 Using \c this with Property Binding
-When creating a property binding from JavaScript, QML allows the use of the \c
-this keyword to refer to the object to which the property binding will be
-assigned. This allows one to explicitly refer to a property within an object
-when there may be ambiguity about the exact property that should be used for the
-binding.
+When creating a property binding from JavaScript, the \c this keyword can be used
+to refer to the object which receives the binding. This is helpful for resolving
+ambiguities with property names.
For example, the \c Component.onCompleted handler below is defined within the
-scope of the \l Item, and references to \c width within this scope would refer
-to the \l Item's width, rather than that of the \l Rectangle. To bind the \l
-Rectangle's \c height to its own \c width, the function passed to Qt.binding()
-needs to explicitly refer to \c this.width rather than just \c width.
+scope of the \l Item. In this scope, \c width refers to the \l Item's width, not
+the \l Rectangle's width. To bind the \l Rectangle's \c height to its own \c width,
+the binding expression must explicitly refer to \c this.width (or alternatively,
+\c{rect.width}):
\qml
Item {
@@ -178,12 +210,7 @@ Item {
}
\endqml
-In this case, the function could also have referred to \c rect.width rather than
-\c this.width.
-
-Note that the value of \c this is not defined outside of its use in property binding.
+\note The value of \c this is not defined outside of property bindings.
See \l {JavaScript Environment Restrictions} for details.
-
-
*/
diff --git a/src/qml/jsapi/qjsengine.cpp b/src/qml/jsapi/qjsengine.cpp
index d05ada481a..9cb727dd63 100644
--- a/src/qml/jsapi/qjsengine.cpp
+++ b/src/qml/jsapi/qjsengine.cpp
@@ -235,7 +235,7 @@ void QJSEngine::collectGarbage()
Evaluates \a program, using \a lineNumber as the base line number,
and returns the result of the evaluation.
- The script code will be evaluated in the current context.
+ The script code will be evaluated in the context of the global object.
The evaluation of \a program can cause an exception in the
engine; in this case the return value will be the exception
@@ -261,8 +261,11 @@ void QJSEngine::collectGarbage()
*/
QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, int lineNumber)
{
- QV4::Scope scope(d->m_v4Engine);
- QV4::ExecutionContext *ctx = d->m_v4Engine->currentContext();
+ QV4::ExecutionEngine *v4 = d->m_v4Engine;
+ QV4::Scope scope(v4);
+ QV4::ExecutionContext *ctx = v4->currentContext();
+ if (ctx != v4->rootContext)
+ ctx = v4->pushGlobalContext();
QV4::ScopedValue result(scope);
QV4::Script script(ctx, program, fileName, lineNumber);
@@ -273,7 +276,9 @@ QJSValue QJSEngine::evaluate(const QString& program, const QString& fileName, in
result = script.run();
if (scope.engine->hasException)
result = ctx->catchException();
- return new QJSValuePrivate(d->m_v4Engine, result);
+ if (ctx != v4->rootContext)
+ v4->popContext();
+ return new QJSValuePrivate(v4, result);
}
/*!
diff --git a/src/qml/jsapi/qjsvalueiterator.cpp b/src/qml/jsapi/qjsvalueiterator.cpp
index 9e02310815..6dcfafaa27 100644
--- a/src/qml/jsapi/qjsvalueiterator.cpp
+++ b/src/qml/jsapi/qjsvalueiterator.cpp
@@ -135,13 +135,10 @@ bool QJSValueIterator::hasNext() const
/*!
Advances the iterator by one position.
- Returns true if there is at least one item ahead of the iterator
- (i.e. the iterator is \e not at the back of the property sequence);
+ Returns true if there was at least one item ahead of the iterator
+ (i.e. the iterator was \e not already at the back of the property sequence);
otherwise returns false.
- Calling this function on an iterator located at the back of the
- container leads to undefined results.
-
\sa hasNext(), name()
*/
bool QJSValueIterator::next()
@@ -159,7 +156,7 @@ bool QJSValueIterator::next()
QV4::Scope scope(v4);
QV4::Scoped<QV4::ForEachIteratorObject> it(scope, d_ptr->iterator.value());
it->it.next(d_ptr->nextName, &d_ptr->nextIndex, &d_ptr->nextProperty, &d_ptr->nextAttributes);
- return !!d_ptr->nextName || d_ptr->nextIndex != UINT_MAX;
+ return !!d_ptr->currentName || d_ptr->currentIndex != UINT_MAX;
}
/*!
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 8e943fa6ef..39a123c4d2 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -326,8 +326,8 @@ ReturnedValue FunctionPrototype::method_call(CallContext *ctx)
ScopedCallData callData(scope, ctx->callData->argc ? ctx->callData->argc - 1 : 0);
if (ctx->callData->argc) {
- std::copy(ctx->callData->args + 1,
- ctx->callData->args + ctx->callData->argc, callData->args);
+ for (int i = 1; i < ctx->callData->argc; ++i)
+ callData->args[i - 1] = ctx->callData->args[i];
}
callData->thisObject = ctx->argument(0);
return o->call(callData);
diff --git a/src/qml/jsruntime/qv4numberobject.cpp b/src/qml/jsruntime/qv4numberobject.cpp
index 1076094a1e..c97e86f2cd 100644
--- a/src/qml/jsruntime/qv4numberobject.cpp
+++ b/src/qml/jsruntime/qv4numberobject.cpp
@@ -227,7 +227,7 @@ ReturnedValue NumberPrototype::method_toExponential(CallContext *ctx)
int fdigits = -1;
if (ctx->callData->argc && !ctx->callData->args[0].isUndefined()) {
- int fdigits = ctx->callData->args[0].toInt32();
+ fdigits = ctx->callData->args[0].toInt32();
if (fdigits < 0 || fdigits > 20) {
ScopedString error(scope, ctx->engine->newString(QStringLiteral("Number.prototype.toExponential: fractionDigits out of range")));
return ctx->throwRangeError(error);
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index 7c38ae4f01..f1e51703a8 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -508,21 +508,24 @@ ReturnedValue StringPrototype::method_replace(CallContext *ctx)
Scoped<RegExpObject> regExp(scope, searchValue);
if (regExp) {
uint offset = 0;
+
+ // We extract the pointer here to work around a compiler bug on Android.
+ Scoped<RegExp> re(scope, regExp->value);
while (true) {
int oldSize = nMatchOffsets;
- if (allocatedMatchOffsets < nMatchOffsets + regExp->value->captureCount() * 2) {
- allocatedMatchOffsets = qMax(allocatedMatchOffsets * 2, nMatchOffsets + regExp->value->captureCount() * 2);
+ if (allocatedMatchOffsets < nMatchOffsets + re->captureCount() * 2) {
+ allocatedMatchOffsets = qMax(allocatedMatchOffsets * 2, nMatchOffsets + re->captureCount() * 2);
uint *newOffsets = (uint *)malloc(allocatedMatchOffsets*sizeof(uint));
memcpy(newOffsets, matchOffsets, nMatchOffsets*sizeof(uint));
if (matchOffsets != _matchOffsets)
free(matchOffsets);
matchOffsets = newOffsets;
}
- if (regExp->value->match(string, offset, matchOffsets + oldSize) == JSC::Yarr::offsetNoMatch) {
+ if (re->match(string, offset, matchOffsets + oldSize) == JSC::Yarr::offsetNoMatch) {
nMatchOffsets = oldSize;
break;
}
- nMatchOffsets += regExp->value->captureCount() * 2;
+ nMatchOffsets += re->captureCount() * 2;
if (!regExp->global)
break;
offset = qMax(offset + 1, matchOffsets[oldSize + 1]);
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index 0bb77d8077..d0d6839bdc 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -1207,18 +1207,16 @@ DEFINE_OBJECT_VTABLE(QQmlBindingFunction);
/*!
\qmlmethod Qt::binding(function)
- Returns a JS object representing a binding expression which may be
- assigned to any property in imperative code to cause a binding
- assignment.
+ Returns a JavaScript object representing a \l{Property Binding}{property binding}.
- There are two main use-cases for the function: firstly, in imperative
- JavaScript code to cause a binding assignment:
+ There are two main use-cases for the function: firstly, to apply a
+ property binding imperatively from JavaScript code:
\snippet qml/qtBinding.1.qml 0
- and secondly, when defining initial property values of dynamically
- constructed objects (via Component.createObject() or
- Loader.setSource()) as being bound to the result of an expression.
+ and secondly, to apply a property binding when initializing property values
+ of dynamically constructed objects (via \l{Component::createObject()}
+ {Component.createObject()} or \l{Loader::setSource()}{Loader.setSource()}).
For example, assuming the existence of a DynamicText component:
\snippet qml/DynamicText.qml 0
@@ -1244,8 +1242,8 @@ DEFINE_OBJECT_VTABLE(QQmlBindingFunction);
\snippet qml/qtBinding.4.qml 0
- \note In \l {Qt Quick 1}, all function assignment was treated as
- binding assignment, so the Qt.binding() function is new in
+ \note In \l {Qt Quick 1}, all function assignments were treated as
+ binding assignments. The Qt.binding() function is new to
\l {Qt Quick}{Qt Quick 2}.
\since 5.0
diff --git a/src/quick/accessible/qaccessiblequickitem.cpp b/src/quick/accessible/qaccessiblequickitem.cpp
index bc2b4de86a..c8b2d9ec3e 100644
--- a/src/quick/accessible/qaccessiblequickitem.cpp
+++ b/src/quick/accessible/qaccessiblequickitem.cpp
@@ -193,6 +193,28 @@ bool QAccessibleQuickItem::isAccessible() const
return item()->d_func()->isAccessible;
}
+QStringList QAccessibleQuickItem::actionNames() const
+{
+ QStringList actions = QQmlAccessible::actionNames();
+ if (state().focusable)
+ actions.append(QAccessibleActionInterface::setFocusAction());
+ return actions;
+}
+
+void QAccessibleQuickItem::doAction(const QString &actionName)
+{
+ if (actionName == QAccessibleActionInterface::setFocusAction()) {
+ item()->forceActiveFocus();
+ } else {
+ QQmlAccessible::doAction(actionName);
+ }
+}
+
+QStringList QAccessibleQuickItem::keyBindingsForAction(const QString &actionName) const
+{
+ return QQmlAccessible::keyBindingsForAction(actionName);
+}
+
QString QAccessibleQuickItem::text(QAccessible::Text textType) const
{
// handles generic behavior not specific to an item
diff --git a/src/quick/accessible/qaccessiblequickitem_p.h b/src/quick/accessible/qaccessiblequickitem_p.h
index 354e0bf9f7..d1facf2199 100644
--- a/src/quick/accessible/qaccessiblequickitem_p.h
+++ b/src/quick/accessible/qaccessiblequickitem_p.h
@@ -74,6 +74,11 @@ public:
bool isAccessible() const;
+ // Action Interface
+ QStringList actionNames() const;
+ void doAction(const QString &actionName);
+ QStringList keyBindingsForAction(const QString &actionName) const;
+
// Value Interface
QVariant currentValue() const;
void setCurrentValue(const QVariant &value);
diff --git a/src/quick/doc/src/concepts/convenience/topic.qdoc b/src/quick/doc/src/concepts/convenience/topic.qdoc
index 1a6feeaa61..b87cfd84c1 100644
--- a/src/quick/doc/src/concepts/convenience/topic.qdoc
+++ b/src/quick/doc/src/concepts/convenience/topic.qdoc
@@ -54,14 +54,11 @@ application performance.
\section1 Dynamic Bindings
-Assigning binding expressions to properties is a fundamental concept of QML,
-and Qt Quick extends upon the idea with the \l Binding type. While bindings
-are typically specified as property initialization assignments, the \l Binding
-type allows the target of a binding to be defined explicitly and separately
-from the definition of the binding expression itself.
-By declaring a \l Binding instance, the client can dynamically bind properties
-from arbitrary objects at run-time, and can modify the binding target when
-required (or when it becomes available).
+\l{Property Binding}{Property bindings} are a fundamental feature of QML.
+Typically, a property is initialized with its binding. However, the \l Binding
+type and \l {Qt::binding()}{Qt.binding()} function allows the client to
+dynamically bind properties from any object at run-time, and modify the binding
+target when required (or when it becomes available).
\section1 Dynamic Signal Connections
diff --git a/src/quick/items/context2d/qquickcontext2d.cpp b/src/quick/items/context2d/qquickcontext2d.cpp
index 2a6eae71f7..29e83e8247 100644
--- a/src/quick/items/context2d/qquickcontext2d.cpp
+++ b/src/quick/items/context2d/qquickcontext2d.cpp
@@ -1774,10 +1774,12 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_createPattern(QV4::CallCon
pattern->patternRepeatY = true;
} else if (repetition == QStringLiteral("repeat-x")) {
pattern->patternRepeatX = true;
+ pattern->patternRepeatY = false;
} else if (repetition == QStringLiteral("repeat-y")) {
+ pattern->patternRepeatX = false;
pattern->patternRepeatY = true;
} else if (repetition == QStringLiteral("no-repeat")) {
- pattern->patternRepeatY = false;
+ pattern->patternRepeatX = false;
pattern->patternRepeatY = false;
} else {
//TODO: exception: SYNTAX_ERR
@@ -3316,7 +3318,7 @@ QV4::ReturnedValue QQuickJSContext2DPrototype::method_getImageData(QV4::CallCont
qreal y = ctx->callData->args[1].toNumber();
qreal w = ctx->callData->args[2].toNumber();
qreal h = ctx->callData->args[3].toNumber();
- if (!qIsFinite(x) || !qIsFinite(y) || !qIsFinite(w) || !qIsFinite(w))
+ if (!qIsFinite(x) || !qIsFinite(y) || !qIsFinite(w) || !qIsFinite(h))
V4THROW_DOM(DOMEXCEPTION_NOT_SUPPORTED_ERR, "getImageData(): Invalid arguments");
if (w <= 0 || h <= 0)
diff --git a/src/quick/items/qquickimage.cpp b/src/quick/items/qquickimage.cpp
index 08dbfa3c23..d7527742dc 100644
--- a/src/quick/items/qquickimage.cpp
+++ b/src/quick/items/qquickimage.cpp
@@ -108,7 +108,7 @@ QQuickImagePrivate::QQuickImagePrivate()
\inherits Item
\brief Displays an image
- The Image type display an image.
+ The Image type displays an image.
The source of the image is specified as a URL using the \l source property.
Images can be supplied in any of the standard image formats supported by Qt,
diff --git a/src/quick/items/qquickimage_p.h b/src/quick/items/qquickimage_p.h
index 902e613b04..56b064f525 100644
--- a/src/quick/items/qquickimage_p.h
+++ b/src/quick/items/qquickimage_p.h
@@ -100,7 +100,7 @@ Q_SIGNALS:
void paintedGeometryChanged();
void horizontalAlignmentChanged(HAlignment alignment);
void verticalAlignmentChanged(VAlignment alignment);
- void mipmapChanged(bool);
+ Q_REVISION(1) void mipmapChanged(bool);
protected:
QQuickImage(QQuickImagePrivate &dd, QQuickItem *parent);
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 03a78895cf..da8ca9fd5d 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -5705,10 +5705,12 @@ void QQuickItem::setAntialiasing(bool aa)
{
Q_D(QQuickItem);
- bool changed = (aa != antialiasing());
- d->antialiasingValid = true;
+ if (!d->antialiasingValid) {
+ d->antialiasingValid = true;
+ d->antialiasing = d->implicitAntialiasing;
+ }
- if (!changed)
+ if (aa == d->antialiasing)
return;
d->antialiasing = aa;
diff --git a/src/quick/items/qquickitemsmodule.cpp b/src/quick/items/qquickitemsmodule.cpp
index 0a60ab77f8..2f20dd763b 100644
--- a/src/quick/items/qquickitemsmodule.cpp
+++ b/src/quick/items/qquickitemsmodule.cpp
@@ -178,7 +178,7 @@ static void qt_quickitems_defineModule(const char *uri, int major, int minor)
qmlRegisterType<QQuickTranslate>(uri,major,minor,"Translate");
qmlRegisterType<QQuickRotation>(uri,major,minor,"Rotation");
qmlRegisterType<QQuickScale>(uri,major,minor,"Scale");
- qmlRegisterType<QQuickMatrix4x4>(uri,2,4,"Matrix4x4");
+ qmlRegisterType<QQuickMatrix4x4>(uri,2,3,"Matrix4x4");
qmlRegisterType<QQuickText>(uri,major,minor,"Text");
qmlRegisterType<QQuickTextEdit>(uri,major,minor,"TextEdit");
qmlRegisterType<QQuickTextEdit,1>(uri,2,1,"TextEdit");
diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp
index 53d736fb36..3087835212 100644
--- a/src/quick/items/qquicktextcontrol.cpp
+++ b/src/quick/items/qquicktextcontrol.cpp
@@ -423,7 +423,6 @@ void QQuickTextControlPrivate::selectionChanged(bool forceEmitSelectionChanged /
#endif
emit q->selectionChanged();
}
- q->updateCursorRectangle(true);
}
void QQuickTextControlPrivate::_q_updateCurrentCharFormatAndSelection()
@@ -1152,8 +1151,10 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
#endif
if (interactionFlags & Qt::TextEditable) {
- if (cursor.position() != oldCursorPos)
+ if (cursor.position() != oldCursorPos) {
emit q->cursorPositionChanged();
+ q->updateCursorRectangle(true);
+ }
_q_updateCurrentCharFormatAndSelection();
#ifndef QT_NO_IM
if (qGuiApp)
@@ -1161,6 +1162,7 @@ void QQuickTextControlPrivate::mouseMoveEvent(QMouseEvent *e, const QPointF &mou
#endif
} else if (cursor.position() != oldCursorPos) {
emit q->cursorPositionChanged();
+ q->updateCursorRectangle(true);
}
selectionChanged(true);
repaintOldAndNewSelection(oldSelection);
@@ -1255,6 +1257,7 @@ void QQuickTextControlPrivate::mouseDoubleClickEvent(QMouseEvent *e, const QPoin
setClipboardSelection();
#endif
emit q->cursorPositionChanged();
+ q->updateCursorRectangle(true);
}
} else if (!sendMouseEventToInputContext(e, pos)) {
e->ignore();
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index 16b48efd86..a95c13f161 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -687,6 +687,13 @@ void QQuickWindowPrivate::translateTouchEvent(QTouchEvent *touchEvent)
touchEvent->setTouchPoints(touchPoints);
}
+
+static inline bool windowHasFocus(QQuickWindow *win)
+{
+ const QWindow *focusWindow = QGuiApplication::focusWindow();
+ return win == focusWindow || QQuickRenderControl::renderWindowFor(win) == focusWindow;
+}
+
/*!
Set the focus inside \a scope to be \a item.
If the scope contains the active focus item, it will be changed to \a item.
@@ -762,7 +769,7 @@ void QQuickWindowPrivate::setFocusInScope(QQuickItem *scope, QQuickItem *item, Q
}
if (!(options & DontChangeFocusProperty)) {
- if (item != contentItem || QGuiApplication::focusWindow() == q) {
+ if (item != contentItem || windowHasFocus(q)) {
itemPrivate->focus = true;
changed << item;
}
@@ -2522,6 +2529,7 @@ void QQuickWindowPrivate::cleanupNodesOnShutdown()
QSet<QQuickItem *>::const_iterator it = parentlessItems.begin();
for (; it != parentlessItems.end(); ++it)
cleanupNodesOnShutdown(*it);
+ animationController->windowNodesDestroyed();
q->cleanupSceneGraph();
}
diff --git a/src/quick/items/qquickwindowmodule.cpp b/src/quick/items/qquickwindowmodule.cpp
index d06fff8c3e..91388ea30f 100644
--- a/src/quick/items/qquickwindowmodule.cpp
+++ b/src/quick/items/qquickwindowmodule.cpp
@@ -175,6 +175,7 @@ void QQuickWindowModule::defineModule()
qmlRegisterType<QQuickWindow>(uri, 2, 0, "Window");
qmlRegisterRevision<QWindow,1>(uri, 2, 1);
+ qmlRegisterRevision<QWindow,2>(uri, 2, 2);
qmlRegisterRevision<QQuickWindow,1>(uri, 2, 1);//Type moved to a subclass, but also has new members
qmlRegisterRevision<QQuickWindow,2>(uri, 2, 2);
qmlRegisterType<QQuickWindowQmlImpl>(uri, 2, 1, "Window");
diff --git a/src/quick/util/qquickanimatorcontroller.cpp b/src/quick/util/qquickanimatorcontroller.cpp
index 7991dd8110..697c25b211 100644
--- a/src/quick/util/qquickanimatorcontroller.cpp
+++ b/src/quick/util/qquickanimatorcontroller.cpp
@@ -54,6 +54,7 @@ QT_BEGIN_NAMESPACE
QQuickAnimatorController::QQuickAnimatorController()
: m_window(0)
+ , m_nodesAreInvalid(false)
{
}
@@ -80,6 +81,26 @@ QQuickAnimatorController::~QQuickAnimatorController()
}
}
+static void qquickanimator_invalidate_node(QAbstractAnimationJob *job)
+{
+ if (job->isRenderThreadJob()) {
+ static_cast<QQuickAnimatorJob *>(job)->nodeWasDestroyed();
+ } else if (job->isGroup()) {
+ QAnimationGroupJob *g = static_cast<QAnimationGroupJob *>(job);
+ for (QAbstractAnimationJob *a = g->firstChild(); a; a = a->nextSibling())
+ qquickanimator_invalidate_node(a);
+ }
+}
+
+void QQuickAnimatorController::windowNodesDestroyed()
+{
+ m_nodesAreInvalid = true;
+ for (QHash<QAbstractAnimationJob *, QQuickAnimatorProxyJob *>::const_iterator it = m_animatorRoots.constBegin();
+ it != m_animatorRoots.constEnd(); ++it) {
+ qquickanimator_invalidate_node(it.key());
+ }
+}
+
void QQuickAnimatorController::itemDestroyed(QObject *o)
{
m_deletedSinceLastFrame << (QQuickItem *) o;
@@ -112,7 +133,7 @@ void QQuickAnimatorController::advance()
m_window->update();
}
-static void qquick_initialize_helper(QAbstractAnimationJob *job, QQuickAnimatorController *c)
+static void qquick_initialize_helper(QAbstractAnimationJob *job, QQuickAnimatorController *c, bool attachListener)
{
if (job->isRenderThreadJob()) {
QQuickAnimatorJob *j = static_cast<QQuickAnimatorJob *>(job);
@@ -121,13 +142,14 @@ static void qquick_initialize_helper(QAbstractAnimationJob *job, QQuickAnimatorC
} else if (c->m_deletedSinceLastFrame.contains(j->target())) {
j->targetWasDeleted();
} else {
- j->addAnimationChangeListener(c, QAbstractAnimationJob::StateChange);
+ if (attachListener)
+ j->addAnimationChangeListener(c, QAbstractAnimationJob::StateChange);
j->initialize(c);
}
} else if (job->isGroup()) {
QAnimationGroupJob *g = static_cast<QAnimationGroupJob *>(job);
for (QAbstractAnimationJob *a = g->firstChild(); a; a = a->nextSibling())
- qquick_initialize_helper(a, c);
+ qquick_initialize_helper(a, c, attachListener);
}
}
@@ -147,7 +169,7 @@ void QQuickAnimatorController::beforeNodeSync()
foreach (QQuickAnimatorProxyJob *proxy, m_starting) {
QAbstractAnimationJob *job = proxy->job();
job->addAnimationChangeListener(this, QAbstractAnimationJob::Completion);
- qquick_initialize_helper(job, this);
+ qquick_initialize_helper(job, this, true);
m_animatorRoots[job] = proxy;
job->start();
proxy->startedByController();
@@ -160,6 +182,18 @@ void QQuickAnimatorController::beforeNodeSync()
}
m_stopping.clear();
+ // First sync after a window was hidden or otherwise invalidated.
+ // call initialize again to pick up new nodes..
+ if (m_nodesAreInvalid) {
+ for (QHash<QAbstractAnimationJob *, QQuickAnimatorProxyJob *>::const_iterator it = m_animatorRoots.constBegin();
+ it != m_animatorRoots.constEnd(); ++it) {
+ qquick_initialize_helper(it.key(), this, false);
+ }
+ m_nodesAreInvalid = false;
+ }
+
+
+
foreach (QQuickAnimatorJob *job, m_activeLeafAnimations) {
if (!job->target())
continue;
diff --git a/src/quick/util/qquickanimatorcontroller_p.h b/src/quick/util/qquickanimatorcontroller_p.h
index 6223a9938f..745a494eec 100644
--- a/src/quick/util/qquickanimatorcontroller_p.h
+++ b/src/quick/util/qquickanimatorcontroller_p.h
@@ -76,6 +76,8 @@ public:
void lock() { m_mutex.lock(); }
void unlock() { m_mutex.unlock(); }
+ void windowNodesDestroyed();
+
public Q_SLOTS:
void itemDestroyed(QObject *);
@@ -92,6 +94,8 @@ public:
QSet<QQuickItem *> m_deletedSinceLastFrame;
QQuickWindow *m_window;
QMutex m_mutex;
+
+ bool m_nodesAreInvalid;
};
QT_END_NAMESPACE
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index 3bc4cef5b9..0bf95a49b4 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -281,6 +281,12 @@ void QQuickTransformAnimatorJob::initialize(QQuickAnimatorController *controller
}
}
+void QQuickTransformAnimatorJob::nodeWasDestroyed()
+{
+ if (m_helper)
+ m_helper->node = 0;
+}
+
void QQuickTransformAnimatorJob::Helper::sync()
{
const quint32 mask = QQuickItemPrivate::Position
@@ -326,7 +332,7 @@ void QQuickTransformAnimatorJob::Helper::sync()
void QQuickTransformAnimatorJob::Helper::apply()
{
- if (!wasChanged)
+ if (!wasChanged || !node)
return;
QMatrix4x4 m;
@@ -412,6 +418,11 @@ void QQuickOpacityAnimatorJob::initialize(QQuickAnimatorController *controller)
}
}
+void QQuickOpacityAnimatorJob::nodeWasDestroyed()
+{
+ m_opacityNode = 0;
+}
+
void QQuickOpacityAnimatorJob::writeBack()
{
if (m_target)
@@ -420,7 +431,7 @@ void QQuickOpacityAnimatorJob::writeBack()
void QQuickOpacityAnimatorJob::updateCurrentTime(int time)
{
- if (!m_controller)
+ if (!m_controller || !m_opacityNode)
return;
Q_ASSERT(m_controller->m_window->openglContext()->thread() == QThread::currentThread());
@@ -504,13 +515,18 @@ void QQuickUniformAnimatorJob::setTarget(QQuickItem *target)
m_target = target;
}
+void QQuickUniformAnimatorJob::nodeWasDestroyed()
+{
+ m_node = 0;
+ m_uniformIndex = -1;
+ m_uniformType = -1;
+}
+
void QQuickUniformAnimatorJob::afterNodeSync()
{
m_node = static_cast<QQuickShaderEffectNode *>(QQuickItemPrivate::get(m_target)->paintNode);
- if (m_node) {
- m_uniformIndex = -1;
- m_uniformType = -1;
+ if (m_node && m_uniformIndex == -1 && m_uniformType == -1) {
QQuickShaderEffectMaterial *material =
static_cast<QQuickShaderEffectMaterial *>(m_node->material());
bool found = false;
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index 8aae121106..03b13bcd30 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -131,6 +131,7 @@ public:
void targetWasDeleted();
virtual void initialize(QQuickAnimatorController *controller);
virtual void writeBack() = 0;
+ virtual void nodeWasDestroyed() = 0;
bool isTransform() const { return m_isTransform; }
bool isUniform() const { return m_isUniform; }
@@ -208,6 +209,7 @@ public:
protected:
QQuickTransformAnimatorJob();
void initialize(QQuickAnimatorController *controller);
+ void nodeWasDestroyed();
Helper *m_helper;
};
@@ -256,6 +258,7 @@ public:
void initialize(QQuickAnimatorController *controller);
void updateCurrentTime(int time);
void writeBack();
+ void nodeWasDestroyed();
private:
QSGOpacityNode *m_opacityNode;
@@ -275,6 +278,7 @@ public:
void updateCurrentTime(int time);
void writeBack();
+ void nodeWasDestroyed();
private:
QByteArray m_uniform;
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index e20e5f22ab..687aeabfe5 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -55,6 +55,8 @@
#include <private/qqmlengine_p.h>
#include <QtCore/qbasictimer.h>
#include <QtGui/QOffscreenSurface>
+#include <QtGui/private/qguiapplication_p.h>
+#include <QtGui/qpa/qplatformintegration.h>
#ifdef Q_OS_WIN
# include <QtWidgets/QMessageBox>
@@ -89,7 +91,11 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
// Do not call create() on offscreenWindow.
createOffscreenSurface();
- setRenderToTexture();
+ if (QGuiApplicationPrivate::platformIntegration()->hasCapability(QPlatformIntegration::RasterGLSurface))
+ setRenderToTexture();
+ else
+ qWarning("QQuickWidget is not supported on this platform.");
+
engine = e;
if (engine.isNull())
@@ -941,6 +947,20 @@ void QQuickWidget::wheelEvent(QWheelEvent *e)
}
#endif
+
+void QQuickWidget::focusInEvent(QFocusEvent * event)
+{
+ Q_D(QQuickWidget);
+ d->offscreenWindow->focusInEvent(event);
+}
+
+void QQuickWidget::focusOutEvent(QFocusEvent * event)
+{
+ Q_D(QQuickWidget);
+ d->offscreenWindow->focusOutEvent(event);
+}
+
+
/*! \reimp */
bool QQuickWidget::event(QEvent *e)
{
diff --git a/src/quickwidgets/qquickwidget.h b/src/quickwidgets/qquickwidget.h
index 81e9af02fb..4287933063 100644
--- a/src/quickwidgets/qquickwidget.h
+++ b/src/quickwidgets/qquickwidget.h
@@ -120,6 +120,9 @@ protected:
virtual void showEvent(QShowEvent *);
virtual void hideEvent(QHideEvent *);
+ virtual void focusInEvent(QFocusEvent * event);
+ virtual void focusOutEvent(QFocusEvent * event);
+
#ifndef QT_NO_WHEELEVENT
virtual void wheelEvent(QWheelEvent *);
#endif