/mkspecs/qws/linux-x86-g++/

/>
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/declarative/rssnews/content/NewsDelegate.qml3
-rw-r--r--demos/declarative/snake/content/snake.js6
-rw-r--r--demos/qtdemo/menumanager.cpp6
-rw-r--r--demos/qtdemo/qmlShell.qml4
-rw-r--r--doc/src/images/qml-focus-example.pngbin43921 -> 31370 bytes
-rw-r--r--doc/src/images/qml-xmlhttprequest-example.pngbin21311 -> 20934 bytes
-rw-r--r--examples/declarative/animation/behaviors/behavior-example.qml2
-rw-r--r--examples/declarative/cppextensions/cppextensions.qmlproject2
-rw-r--r--examples/declarative/keyinteraction/focus/Core/GridMenu.qml7
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml17
-rw-r--r--examples/declarative/keyinteraction/focus/Core/ListViews.qml4
-rw-r--r--examples/declarative/keyinteraction/focus/focus.qml5
-rw-r--r--examples/declarative/ui-components/progressbar/content/ProgressBar.qml2
-rw-r--r--examples/declarative/ui-components/searchbox/SearchBox.qml2
-rw-r--r--examples/declarative/ui-components/tabwidget/main.qml6
-rw-r--r--src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp2
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable.cpp52
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p.h7
-rw-r--r--src/declarative/graphicsitems/qdeclarativeflickable_p_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview.cpp68
-rw-r--r--src/declarative/graphicsitems/qdeclarativegridview_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativeimage.cpp5
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview.cpp84
-rw-r--r--src/declarative/graphicsitems/qdeclarativelistview_p.h3
-rw-r--r--src/declarative/graphicsitems/qdeclarativeloader.cpp10
-rw-r--r--src/declarative/graphicsitems/qdeclarativepainteditem.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepathview.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativepositioners.cpp4
-rw-r--r--src/declarative/graphicsitems/qdeclarativerectangle.cpp1
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext.cpp142
-rw-r--r--src/declarative/graphicsitems/qdeclarativetext_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit.cpp30
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextedit_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput.cpp12
-rw-r--r--src/declarative/graphicsitems/qdeclarativetextinput_p.h2
-rw-r--r--src/declarative/graphicsitems/qdeclarativevisualitemmodel.cpp2
-rw-r--r--src/declarative/qml/qdeclarativecompiler.cpp33
-rw-r--r--src/declarative/qml/qdeclarativecompiler_p.h1
-rw-r--r--src/declarative/qml/qdeclarativecomponent.cpp4
-rw-r--r--src/declarative/qml/qdeclarativecustomparser.cpp10
-rw-r--r--src/declarative/qml/qdeclarativecustomparser_p.h14
-rw-r--r--src/declarative/qml/qdeclarativeengine.cpp24
-rw-r--r--src/declarative/qml/qdeclarativeengine_p.h1
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass.cpp28
-rw-r--r--src/declarative/qml/qdeclarativeglobalscriptclass_p.h5
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass.cpp24
-rw-r--r--src/declarative/qml/qdeclarativeobjectscriptclass_p.h2
-rw-r--r--src/declarative/qml/qdeclarativetypenamescriptclass.cpp4
-rw-r--r--src/declarative/util/qdeclarativeanimation.cpp2
-rw-r--r--src/declarative/util/qdeclarativelistmodel.cpp11
-rw-r--r--src/declarative/util/qdeclarativelistmodel_p.h2
-rw-r--r--src/declarative/util/qdeclarativepixmapcache.cpp6
-rw-r--r--src/declarative/util/qdeclarativepropertychanges_p.h3
-rw-r--r--src/gui/graphicsview/qgraphicsitem.cpp11
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/data/runningTrueBug.qml30
-rw-r--r--tests/auto/declarative/qdeclarativeanimations/tst_qdeclarativeanimations.cpp15
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/eval.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/function.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.js1
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11600.qml8
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/qtbug_11606.qml12
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scope.3.qml4
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/data/scriptErrors.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/testtypes.h6
-rw-r--r--tests/auto/declarative/qdeclarativeecmascript/tst_qdeclarativeecmascript.cpp41
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/data/flickable04.qml6
-rw-r--r--tests/auto/declarative/qdeclarativeflickable/tst_qdeclarativeflickable.cpp4
-rw-r--r--tests/auto/declarative/qdeclarativegridview/data/gridview-initCurrent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativegridview/tst_qdeclarativegridview.cpp231
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.errors.txt1
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/data/invalidProperty.qml5
-rw-r--r--tests/auto/declarative/qdeclarativelanguage/tst_qdeclarativelanguage.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativelistmodel/tst_qdeclarativelistmodel.cpp12
-rw-r--r--tests/auto/declarative/qdeclarativelistview/data/listview-initCurrent.qml2
-rw-r--r--tests/auto/declarative/qdeclarativelistview/tst_qdeclarativelistview.cpp274
-rw-r--r--tests/auto/declarative/qdeclarativeloader/tst_qdeclarativeloader.cpp9
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/data/flow-testimplicitsize.qml16
-rw-r--r--tests/auto/declarative/qdeclarativepositioners/tst_qdeclarativepositioners.cpp23
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.js4
-rw-r--r--tests/auto/declarative/qdeclarativeqt/data/createComponent_lib.qml2
-rw-r--r--tests/auto/declarative/qdeclarativeqt/tst_qdeclarativeqt.cpp6
-rw-r--r--tests/auto/declarative/qdeclarativestates/tst_qdeclarativestates.cpp1
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments.qml41
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_cb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_cc.pngbin0 -> 556 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_ct.pngbin0 -> 533 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lc.pngbin0 -> 535 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_lt.pngbin0 -> 514 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rb.pngbin0 -> 505 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rc.pngbin0 -> 559 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/data/alignments_rt.pngbin0 -> 539 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetext/tst_qdeclarativetext.cpp73
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments.qml41
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_cb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_cc.pngbin0 -> 556 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_ct.pngbin0 -> 533 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lb.pngbin0 -> 496 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lc.pngbin0 -> 535 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_lt.pngbin0 -> 514 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rb.pngbin0 -> 505 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rc.pngbin0 -> 559 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/data/alignments_rt.pngbin0 -> 539 bytes
-rw-r--r--tests/auto/declarative/qdeclarativetextedit/tst_qdeclarativetextedit.cpp61
-rw-r--r--tests/auto/declarative/qdeclarativeviewer/tst_qdeclarativeviewer.cpp64
-rw-r--r--tests/auto/declarative/qdeclarativevisualdatamodel/tst_qdeclarativevisualdatamodel.cpp6
-rw-r--r--tests/benchmarks/declarative/script/data/block.qml6
-rw-r--r--tests/benchmarks/declarative/script/data/global.js54
-rw-r--r--tests/benchmarks/declarative/script/data/global_prop.qml53
-rw-r--r--tests/benchmarks/declarative/script/tst_script.cpp75
-rw-r--r--tools/linguist/lupdate/qdeclarative.cpp84
-rw-r--r--tools/qdoc3/test/qdeclarative.qdocconf4
-rw-r--r--tools/qml/deviceorientation_maemo5.cpp (renamed from tools/qml/deviceorientation_maemo.cpp)2
-rw-r--r--tools/qml/loggerwidget.cpp25
-rw-r--r--tools/qml/loggerwidget.h12
-rw-r--r--tools/qml/proxysettings.cpp5
-rw-r--r--tools/qml/proxysettings.h4
-rw-r--r--tools/qml/proxysettings_maemo5.ui177
-rw-r--r--tools/qml/qml.pri10
-rw-r--r--tools/qml/qml.pro3
-rw-r--r--tools/qml/qmlruntime.cpp480
-rw-r--r--tools/qml/qmlruntime.h23
-rw-r--r--tools/qml/recopts_maemo5.ui254
-rw-r--r--tools/qml/texteditautoresizer_maemo5.h113
124 files changed, 2366 insertions, 726 deletions
diff --git a/demos/declarative/rssnews/content/NewsDelegate.qml b/demos/declarative/rssnews/content/NewsDelegate.qml
index 040dadc..cfe9b00 100644
--- a/demos/declarative/rssnews/content/NewsDelegate.qml
+++ b/demos/declarative/rssnews/content/NewsDelegate.qml
@@ -43,10 +43,11 @@ import Qt 4.7
Item {
id: delegate
- height: childrenRect.height + 20
+ height: column.height + 40
width: delegate.ListView.view.width
Column {
+ id: column
x: 20; y: 20
width: parent.width - 40
diff --git a/demos/declarative/snake/content/snake.js b/demos/declarative/snake/content/snake.js
index 4d05e33..0f0dbf7 100644
--- a/demos/declarative/snake/content/snake.js
+++ b/demos/declarative/snake/content/snake.js
@@ -150,7 +150,7 @@ function move() {
snake.push(newLink);
} else {
var lastLink = snake[snake.length-1];
- board[lastLink.row * numColumns + lastLink.column] = Undefined;
+ board[lastLink.row * numColumns + lastLink.column] = undefined;
}
if (waitForCookie > 0) {
@@ -186,7 +186,7 @@ function move() {
function isFree(row, column)
{
- return board[row * numColumns + column] == Undefined;
+ return board[row * numColumns + column] == undefined;
}
function isHead(row, column)
@@ -214,7 +214,7 @@ function moveSkull()
--linksToDie;
var link = snake.pop();
link.dying = true;
- board[link.row * numColumns + link.column] = Undefined;
+ board[link.row * numColumns + link.column] = undefined;
if (score > 0)
--score;
if (snake.length == 0) {
diff --git a/demos/qtdemo/menumanager.cpp b/demos/qtdemo/menumanager.cpp
index a2ceb0e..15561ab 100644
--- a/demos/qtdemo/menumanager.cpp
+++ b/demos/qtdemo/menumanager.cpp
@@ -369,10 +369,10 @@ void MenuManager::launchQmlExample(const QString &name)
dir = QDir(QLibraryInfo::location(QLibraryInfo::DemosPath));
else
dir = QDir(QLibraryInfo::location(QLibraryInfo::ExamplesPath));
- QFile file(dir.path() + "/" + dirName + "/" + fileName + "/" + fileName.split('/').last() + ".qml");
+ QFile file(dir.path() + "/" + dirName + "/" + fileName + "/" + "main.qml");
if(!file.exists()){
- //try main.qml as well
- file.setFileName(dir.path() + "/" + dirName + "/" + fileName + "/" + "main.qml");
+ //try dirname.qml as well
+ file.setFileName(dir.path() + "/" + dirName + "/" + fileName + "/" + fileName.split('/').last() + ".qml");
if(!file.exists()){
exampleError(QProcess::UnknownError);
return;
diff --git a/demos/qtdemo/qmlShell.qml b/demos/qtdemo/qmlShell.qml
index 5c5f96c..e15d33c 100644
--- a/demos/qtdemo/qmlShell.qml
+++ b/demos/qtdemo/qmlShell.qml
@@ -99,6 +99,7 @@ Item {
}
MouseArea{
anchors.fill: parent
+ acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
onClicked: loader.focus=true;/* and don't propogate to the 'exit' area*/
}
@@ -130,7 +131,7 @@ Item {
textFormat: Text.RichText
//Note that if loader is Error, it is because the file was found but there was an error creating the component
//This means either we have a bug in our demos, or the required modules (which ship with Qt) did not deploy correctly
- text: "The example has failed to load.<br />If you installed Qt's QML modules this is a bug!<br />"
+ text: "The example has failed to load.<br />If you installed all Qt's C++ and QML modules then this is a bug!<br />"
+ 'Report it at <a href="http://bugreports.qt.nokia.com">http://bugreports.qt.nokia.com</a>';
onLinkActivated: Qt.openUrlExternally(link);
}
@@ -145,6 +146,7 @@ Item {
z: 8
enabled: main.show
hoverEnabled: main.show //To steal focus from the buttons
+ acceptedButtons: Qt.LeftButton | Qt.RightButton | Qt.MiddleButton
anchors.fill: parent
onClicked: main.show=false;
}
diff --git a/doc/src/images/qml-focus-example.png b/doc/src/images/qml-focus-example.png
index 0ec2bff..107d2cb 100644
--- a/doc/src/images/qml-focus-example.png
+++ b/doc/src/images/qml-focus-example.png
Binary files differ
diff --git a/doc/src/images/qml-xmlhttprequest-example.png b/doc/src/images/qml-xmlhttprequest-example.png
index 68e7d27..f585613 100644
--- a/doc/src/images/qml-xmlhttprequest-example.png
+++ b/doc/src/images/qml-xmlhttprequest-example.png
Binary files differ
diff --git a/examples/declarative/animation/behaviors/behavior-example.qml b/examples/declarative/animation/behaviors/behavior-example.qml
index d187fbf..adefb9e 100644
--- a/examples/declarative/animation/behaviors/behavior-example.qml
+++ b/examples/declarative/animation/behaviors/behavior-example.qml
@@ -82,7 +82,7 @@ Rectangle {
property string text
- x: 62.5; y: 75; width: 75; height: 50
+ x: 62; y: 75; width: 75; height: 50
radius: 6
border.width: 4; border.color: "white"
color: "firebrick"
diff --git a/examples/declarative/cppextensions/cppextensions.qmlproject b/examples/declarative/cppextensions/cppextensions.qmlproject
index d4909f8..6b36284 100644
--- a/examples/declarative/cppextensions/cppextensions.qmlproject
+++ b/examples/declarative/cppextensions/cppextensions.qmlproject
@@ -12,5 +12,5 @@ Project {
directory: "."
}
/* List of plugin directories passed to QML runtime */
- // importPaths: [ " ../exampleplugin " ]
+ importPaths: [ "plugins" ]
}
diff --git a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
index d0b45f5..9a8d3f3 100644
--- a/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
+++ b/examples/declarative/keyinteraction/focus/Core/GridMenu.qml
@@ -55,10 +55,11 @@ FocusScope {
GridView {
id: gridView
- x: 20; width: parent.width - 40; height: parent.height
+ anchors.fill: parent; anchors.leftMargin: 20; anchors.rightMargin: 20
cellWidth: 152; cellHeight: 152
focus: true
model: 12
+
KeyNavigation.down: listViews
KeyNavigation.left: contextMenu
@@ -70,9 +71,9 @@ FocusScope {
id: content
color: "transparent"
smooth: true
- anchors.centerIn: parent; width: container.width - 40; height: container.height - 40; radius: 10
+ anchors.fill: parent; anchors.margins: 20; radius: 10
- Rectangle { color: "#91AA9D"; x: 3; y: 3; width: parent.width - 6; height: parent.height - 6; radius: 8 }
+ Rectangle { color: "#91AA9D"; anchors.fill: parent; anchors.margins: 3; radius: 8; smooth: true }
Image { source: "images/qt-logo.png"; anchors.centerIn: parent; smooth: true }
}
diff --git a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
index fba9b05..cc13637 100644
--- a/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViewDelegate.qml
@@ -42,7 +42,7 @@ import Qt 4.7
Item {
id: container
- x: 5; width: ListView.view.width - 10; height: 60
+ width: ListView.view.width; height: 60; anchors.leftMargin: 10; anchors.rightMargin: 10
Rectangle {
id: content
@@ -51,11 +51,15 @@ Item {
smooth: true
radius: 10
- Rectangle { color: "#91AA9D"; x: 3; y: 3; width: parent.width - 6; height: parent.height - 6; radius: 8 }
- Text {
- text: "List element " + (index + 1); color: "#193441"; font.bold: false; anchors.centerIn: parent
- font.pixelSize: 14
- }
+ Rectangle { anchors.fill: parent; anchors.margins: 3; color: "#91AA9D"; smooth: true; radius: 8 }
+ }
+
+ Text {
+ id: label
+ anchors.centerIn: content
+ text: "List element " + (index + 1)
+ color: "#193441"
+ font.pixelSize: 14
}
MouseArea {
@@ -72,6 +76,7 @@ Item {
states: State {
name: "active"; when: container.focus == true
PropertyChanges { target: content; color: "#FCFFF5"; scale: 1.1 }
+ PropertyChanges { target: label; font.pixelSize: 16 }
}
transitions: Transition {
diff --git a/examples/declarative/keyinteraction/focus/Core/ListViews.qml b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
index 670a3fa..6f9ceb4 100644
--- a/examples/declarative/keyinteraction/focus/Core/ListViews.qml
+++ b/examples/declarative/keyinteraction/focus/Core/ListViews.qml
@@ -60,7 +60,7 @@ FocusScope {
ListView {
id: list2
- y: wantsFocus ? 10 : 40; x: parent.width / 3; width: parent.width / 3; height: parent.height - 20
+ y: wantsFocus ? 10 : 40; x: parseInt(parent.width / 3); width: parent.width / 3; height: parent.height - 20
KeyNavigation.up: gridMenu; KeyNavigation.left: list1; KeyNavigation.right: list3
model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
@@ -72,7 +72,7 @@ FocusScope {
ListView {
id: list3
- y: wantsFocus ? 10 : 40; x: 2 * parent.width / 3; width: parent.width / 3; height: parent.height - 20
+ y: wantsFocus ? 10 : 40; x: parseInt(2 * parent.width / 3); width: parent.width / 3; height: parent.height - 20
KeyNavigation.up: gridMenu; KeyNavigation.left: list2
model: 10; cacheBuffer: 200
delegate: ListViewDelegate {}
diff --git a/examples/declarative/keyinteraction/focus/focus.qml b/examples/declarative/keyinteraction/focus/focus.qml
index 068ba1d..8b2af70 100644
--- a/examples/declarative/keyinteraction/focus/focus.qml
+++ b/examples/declarative/keyinteraction/focus/focus.qml
@@ -68,7 +68,8 @@ Rectangle {
Rectangle {
id: shade
- color: "black"; opacity: 0; anchors.fill: parent
+ anchors.fill: parent
+ color: "black"; opacity: 0
}
states: State {
@@ -88,7 +89,7 @@ Rectangle {
anchors.verticalCenter: parent.verticalCenter
MouseArea {
- anchors { fill: parent; leftMargin: -10; topMargin: -10; rightMargin: -10; bottomMargin: -10 }
+ anchors.fill: parent; anchors.margins: -10
onClicked: window.state = "contextMenuOpen"
}
}
diff --git a/examples/declarative/ui-components/progressbar/content/ProgressBar.qml b/examples/declarative/ui-components/progressbar/content/ProgressBar.qml
index 829ab9b..6aa6765 100644
--- a/examples/declarative/ui-components/progressbar/content/ProgressBar.qml
+++ b/examples/declarative/ui-components/progressbar/content/ProgressBar.qml
@@ -66,7 +66,7 @@ Item {
width: highlight.widthDest
Behavior on width { SmoothedAnimation { velocity: 1200 } }
- anchors { left: parent.left; top: parent.top; bottom: parent.bottom; leftMargin: 3; topMargin: 3; bottomMargin: 3 }
+ anchors { left: parent.left; top: parent.top; bottom: parent.bottom; margins: 3 }
radius: 1
gradient: Gradient {
GradientStop { id: gradient1; position: 0.0 }
diff --git a/examples/declarative/ui-components/searchbox/SearchBox.qml b/examples/declarative/ui-components/searchbox/SearchBox.qml
index e6b9c8f..6d87837 100644
--- a/examples/declarative/ui-components/searchbox/SearchBox.qml
+++ b/examples/declarative/ui-components/searchbox/SearchBox.qml
@@ -73,7 +73,7 @@ FocusScope {
TextInput {
id: textInput
- anchors { left: parent.left; leftMargin: 8; verticalCenter: parent.verticalCenter }
+ anchors { left: parent.left; leftMargin: 8; right: clear.left; rightMargin: 8; verticalCenter: parent.verticalCenter }
focus: true
}
diff --git a/examples/declarative/ui-components/tabwidget/main.qml b/examples/declarative/ui-components/tabwidget/main.qml
index e11902a..4a27806 100644
--- a/examples/declarative/ui-components/tabwidget/main.qml
+++ b/examples/declarative/ui-components/tabwidget/main.qml
@@ -50,7 +50,7 @@ TabWidget {
color: "#e3e3e3"
Rectangle {
- anchors { fill: parent; topMargin: 20; leftMargin: 20; rightMargin: 20; bottomMargin: 20 }
+ anchors.fill: parent; anchors.margins: 20
color: "#ff7f7f"
Text {
width: parent.width - 20
@@ -68,7 +68,7 @@ TabWidget {
color: "#e3e3e3"
Rectangle {
- anchors { fill: parent; topMargin: 20; leftMargin: 20; rightMargin: 20; bottomMargin: 20 }
+ anchors.fill: parent; anchors.margins: 20
color: "#7fff7f"
Text {
width: parent.width - 20
@@ -85,7 +85,7 @@ TabWidget {
anchors.fill: parent; color: "#e3e3e3"
Rectangle {
- anchors { fill: parent; topMargin: 20; leftMargin: 20; rightMargin: 20; bottomMargin: 20 }
+ anchors.fill: parent; anchors.margins: 20
color: "#7f7fff"
Text {
width: parent.width - 20
diff --git a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
index a349bec..0342c9f 100644
--- a/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
+++ b/src/3rdparty/webkit/WebKit/qt/declarative/qdeclarativewebview.cpp
@@ -180,6 +180,8 @@ void GraphicsWebView::mouseMoveEvent(QGraphicsSceneMouseEvent* event)
When this item has keyboard focus, all keyboard input will be sent directly to the
web page within.
+
+ \sa {declarative/modelviews/webview}{WebView example}, {demos/declarative/webbrowser}{Web Browser demo}
*/
/*!
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable.cpp b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
index 3f681b7..65bc233 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable.cpp
+++ b/src/declarative/graphicsitems/qdeclarativeflickable.cpp
@@ -122,7 +122,7 @@ void QDeclarativeFlickableVisibleArea::updateVisible()
QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate()
- : viewport(new QDeclarativeItem)
+ : contentItem(new QDeclarativeItem)
, hData(this, &QDeclarativeFlickablePrivate::setRoundedViewportX)
, vData(this, &QDeclarativeFlickablePrivate::setRoundedViewportY)
, flickingHorizontally(false), flickingVertically(false)
@@ -140,8 +140,8 @@ QDeclarativeFlickablePrivate::QDeclarativeFlickablePrivate()
void QDeclarativeFlickablePrivate::init()
{
Q_Q(QDeclarativeFlickable);
- QDeclarative_setParent_noEvent(viewport, q);
- viewport->setParentItem(q);
+ QDeclarative_setParent_noEvent(contentItem, q);
+ contentItem->setParentItem(q);
static int timelineUpdatedIdx = -1;
static int timelineCompletedIdx = -1;
static int flickableTickedIdx = -1;
@@ -158,7 +158,7 @@ void QDeclarativeFlickablePrivate::init()
q, flickableMovementEndingIdx, Qt::DirectConnection);
q->setAcceptedMouseButtons(Qt::LeftButton);
q->setFiltersChildEvents(true);
- QDeclarativeItemPrivate *viewportPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(viewport));
+ QDeclarativeItemPrivate *viewportPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(contentItem));
viewportPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
lastPosTime.invalidate();
}
@@ -182,7 +182,7 @@ qreal QDeclarativeFlickablePrivate::overShootDistance(qreal velocity, qreal size
void QDeclarativeFlickablePrivate::itemGeometryChanged(QDeclarativeItem *item, const QRectF &newGeom, const QRectF &oldGeom)
{
Q_Q(QDeclarativeFlickable);
- if (item == viewport) {
+ if (item == contentItem) {
if (newGeom.x() != oldGeom.x())
emit q->contentXChanged();
if (newGeom.y() != oldGeom.y())
@@ -579,10 +579,28 @@ void QDeclarativeFlickable::ticked()
viewportMoved();
}
-QDeclarativeItem *QDeclarativeFlickable::viewport()
+/*!
+ \qmlproperty Item Flickable::contentItem
+
+ The internal item that contains the Items to be moved in the Flickable.
+
+ Items declared as children of a Flickable are automatically parented to the Flickable's contentItem.
+
+ Items created dynamically need to be explicitly parented to the \e contentItem:
+ \code
+ Flickable {
+ id: myFlickable
+ function addItem(file) {
+ var component = Qt.createComponent(file)
+ component.createObject(myFlickable.contentItem);
+ }
+ }
+ \endcode
+*/
+QDeclarativeItem *QDeclarativeFlickable::contentItem()
{
Q_D(QDeclarativeFlickable);
- return d->viewport;
+ return d->contentItem;
}
QDeclarativeFlickableVisibleArea *QDeclarativeFlickable::visibleArea()
@@ -899,12 +917,12 @@ void QDeclarativeFlickablePrivate::clearDelayedPress()
void QDeclarativeFlickablePrivate::setRoundedViewportX(qreal x)
{
- viewport->setX(qRound(x));
+ contentItem->setX(qRound(x));
}
void QDeclarativeFlickablePrivate::setRoundedViewportY(qreal y)
{
- viewport->setY(qRound(y));
+ contentItem->setY(qRound(y));
}
void QDeclarativeFlickable::timerEvent(QTimerEvent *event)
@@ -991,13 +1009,13 @@ void QDeclarativeFlickable::geometryChanged(const QRectF &newGeometry,
bool changed = false;
if (newGeometry.width() != oldGeometry.width()) {
if (d->hData.viewSize < 0) {
- d->viewport->setWidth(width());
+ d->contentItem->setWidth(width());
emit contentWidthChanged();
}
}
if (newGeometry.height() != oldGeometry.height()) {
if (d->vData.viewSize < 0) {
- d->viewport->setHeight(height());
+ d->contentItem->setHeight(height());
emit contentHeightChanged();
}
}
@@ -1018,7 +1036,7 @@ void QDeclarativeFlickablePrivate::data_append(QDeclarativeListProperty<QObject>
{
QDeclarativeItem *i = qobject_cast<QDeclarativeItem *>(o);
if (i)
- i->setParentItem(static_cast<QDeclarativeFlickablePrivate*>(prop->data)->viewport);
+ i->setParentItem(static_cast<QDeclarativeFlickablePrivate*>(prop->data)->contentItem);
else
o->setParent(prop->object);
}
@@ -1032,7 +1050,7 @@ QDeclarativeListProperty<QObject> QDeclarativeFlickable::flickableData()
QDeclarativeListProperty<QGraphicsObject> QDeclarativeFlickable::flickableChildren()
{
Q_D(QDeclarativeFlickable);
- return QGraphicsItemPrivate::get(d->viewport)->childrenList();
+ return QGraphicsItemPrivate::get(d->contentItem)->childrenList();
}
/*!
@@ -1102,9 +1120,9 @@ void QDeclarativeFlickable::setContentWidth(qreal w)
return;
d->hData.viewSize = w;
if (w < 0)
- d->viewport->setWidth(width());
+ d->contentItem->setWidth(width());
else
- d->viewport->setWidth(w);
+ d->contentItem->setWidth(w);
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
int oldDuration = d->fixupDuration;
@@ -1129,9 +1147,9 @@ void QDeclarativeFlickable::setContentHeight(qreal h)
return;
d->vData.viewSize = h;
if (h < 0)
- d->viewport->setHeight(height());
+ d->contentItem->setHeight(height());
else
- d->viewport->setHeight(h);
+ d->contentItem->setHeight(h);
// Make sure that we're entirely in view.
if (!d->pressed && !d->movingHorizontally && !d->movingVertically) {
int oldDuration = d->fixupDuration;
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
index d40a0dc..eb738d9 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p.h
@@ -60,6 +60,7 @@ class Q_DECLARATIVE_EXPORT QDeclarativeFlickable : public QDeclarativeItem
Q_PROPERTY(qreal contentHeight READ contentHeight WRITE setContentHeight NOTIFY contentHeightChanged)
Q_PROPERTY(qreal contentX READ contentX WRITE setContentX NOTIFY contentXChanged)
Q_PROPERTY(qreal contentY READ contentY WRITE setContentY NOTIFY contentYChanged)
+ Q_PROPERTY(QDeclarativeItem *contentItem READ contentItem CONSTANT)
Q_PROPERTY(qreal horizontalVelocity READ horizontalVelocity NOTIFY horizontalVelocityChanged)
Q_PROPERTY(qreal verticalVelocity READ verticalVelocity NOTIFY verticalVelocityChanged)
@@ -111,10 +112,10 @@ public:
void setContentHeight(qreal);
qreal contentX() const;
- void setContentX(qreal pos);
+ virtual void setContentX(qreal pos);
qreal contentY() const;
- void setContentY(qreal pos);
+ virtual void setContentY(qreal pos);
bool isMoving() const;
bool isMovingHorizontally() const;
@@ -143,7 +144,7 @@ public:
bool isAtYEnd() const;
bool isAtYBeginning() const;
- QDeclarativeItem *viewport();
+ QDeclarativeItem *contentItem();
enum FlickableDirection { AutoFlickDirection=0x00, HorizontalFlick=0x01, VerticalFlick=0x02, HorizontalAndVerticalFlick=0x03 };
FlickableDirection flickDirection() const; // deprecated
diff --git a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
index 66d2678..b919e1b 100644
--- a/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
+++ b/src/declarative/graphicsitems/qdeclarativeflickable_p_p.h
@@ -125,7 +125,7 @@ public:
void itemGeometryChanged(QDeclarativeItem *, const QRectF &, const QRectF &);
public:
- QDeclarativeItem *viewport;
+ QDeclarativeItem *contentItem;
AxisData hData;
AxisData vData;
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp
index 3792595..dda1efb 100644
--- a/src/declarative/graphicsitems/qdeclarativegridview.cpp
+++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp
@@ -151,9 +151,9 @@ public:
void setPosition(qreal pos) {
Q_Q(QDeclarativeGridView);
if (flow == QDeclarativeGridView::LeftToRight)
- q->setContentY(pos);
+ q->QDeclarativeFlickable::setContentY(pos);
else
- q->setContentX(pos);
+ q->QDeclarativeFlickable::setContentX(pos);
}
int size() const {
Q_Q(const QDeclarativeGridView);
@@ -421,10 +421,10 @@ FxGridItem *QDeclarativeGridViewPrivate::createItem(int modelIndex)
if (model->completePending()) {
// complete
listItem->item->setZValue(1);
- listItem->item->setParentItem(q->viewport());
+ listItem->item->setParentItem(q->contentItem());
model->completeItem();
} else {
- listItem->item->setParentItem(q->viewport());
+ listItem->item->setParentItem(q->contentItem());
}
unrequestedItems.remove(listItem->item);
}
@@ -716,12 +716,12 @@ void QDeclarativeGridViewPrivate::createHighlight()
}
} else {
item = new QDeclarativeItem;
- QDeclarative_setParent_noEvent(item, q->viewport());
- item->setParentItem(q->viewport());
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
}
if (item) {
- QDeclarative_setParent_noEvent(item, q->viewport());
- item->setParentItem(q->viewport());
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
highlight = new FxGridItem(item, q);
highlightXAnimator = new QSmoothedAnimation(q);
highlightXAnimator->target = QDeclarativeProperty(highlight->item, QLatin1String("x"));
@@ -808,8 +808,8 @@ void QDeclarativeGridViewPrivate::updateFooter()
delete context;
}
if (item) {
- QDeclarative_setParent_noEvent(item, q->viewport());
- item->setParentItem(q->viewport());
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
item->setZValue(1);
QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
@@ -854,8 +854,8 @@ void QDeclarativeGridViewPrivate::updateHeader()
delete context;
}
if (item) {
- QDeclarative_setParent_noEvent(item, q->viewport());
- item->setParentItem(q->viewport());
+ QDeclarative_setParent_noEvent(item, q->contentItem());
+ item->setParentItem(q->contentItem());
item->setZValue(1);
QDeclarativeItemPrivate *itemPrivate = static_cast<QDeclarativeItemPrivate*>(QGraphicsItemPrivate::get(item));
itemPrivate->addItemChangeListener(this, QDeclarativeItemPrivate::Geometry);
@@ -1742,6 +1742,22 @@ void QDeclarativeGridView::setHeader(QDeclarativeComponent *header)
}
}
+void QDeclarativeGridView::setContentX(qreal pos)
+{
+ Q_D(QDeclarativeGridView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ QDeclarativeFlickable::setContentX(pos);
+}
+
+void QDeclarativeGridView::setContentY(qreal pos)
+{
+ Q_D(QDeclarativeGridView);
+ // Positioning the view manually should override any current movement state
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ QDeclarativeFlickable::setContentY(pos);
+}
+
bool QDeclarativeGridView::event(QEvent *event)
{
Q_D(QDeclarativeGridView);
@@ -1919,6 +1935,8 @@ void QDeclarativeGridView::keyPressEvent(QKeyEvent *event)
Move the currentIndex up one item in the view.
The current index will wrap if keyNavigationWraps is true and it
is currently at the end.
+
+ \bold Note: methods should only be called after the Component has completed.
*/
void QDeclarativeGridView::moveCurrentIndexUp()
{
@@ -1942,6 +1960,8 @@ void QDeclarativeGridView::moveCurrentIndexUp()
Move the currentIndex down one item in the view.
The current index will wrap if keyNavigationWraps is true and it
is currently at the end.
+
+ \bold Note: methods should only be called after the Component has completed.
*/
void QDeclarativeGridView::moveCurrentIndexDown()
{
@@ -1965,6 +1985,8 @@ void QDeclarativeGridView::moveCurrentIndexDown()
Move the currentIndex left one item in the view.
The current index will wrap if keyNavigationWraps is true and it
is currently at the end.
+
+ \bold Note: methods should only be called after the Component has completed.
*/
void QDeclarativeGridView::moveCurrentIndexLeft()
{
@@ -1988,6 +2010,8 @@ void QDeclarativeGridView::moveCurrentIndexLeft()
Move the currentIndex right one item in the view.
The current index will wrap if keyNavigationWraps is true and it
is currently at the end.
+
+ \bold Note: methods should only be called after the Component has completed.
*/
void QDeclarativeGridView::moveCurrentIndexRight()
{
@@ -2028,6 +2052,14 @@ void QDeclarativeGridView::moveCurrentIndexRight()
at a particular index. This is unreliable since removing items from the start
of the view does not cause all other items to be repositioned.
The correct way to bring an item into view is with \c positionViewAtIndex.
+
+ \bold Note: methods should only be called after the Component has completed. To position
+ the view at startup, this method should be called by Component.onCompleted. For
+ example, to position the view at the end:
+
+ \code
+ Component.onCompleted: positionViewAtIndex(count - 1, GridView.Beginning)
+ \endcode
*/
void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
{
@@ -2037,6 +2069,8 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
if (mode < Beginning || mode > Contain)
return;
+ if (d->layoutScheduled)
+ d->layout();
qreal pos = d->position();
FxGridItem *item = d->visibleItem(index);
if (!item) {
@@ -2079,6 +2113,8 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
pos = qMin(pos, maxExtent);
qreal minExtent = d->flow == QDeclarativeGridView::LeftToRight ? -minYExtent() : -minXExtent();
pos = qMax(pos, minExtent);
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
+ cancelFlick();
d->setPosition(pos);
}
d->fixupPosition();
@@ -2093,6 +2129,8 @@ void QDeclarativeGridView::positionViewAtIndex(int index, int mode)
If the item is outside the visible area, -1 is returned, regardless of
whether an item will exist at that point when scrolled into view.
+
+ \bold Note: methods should only be called after the Component has completed.
*/
int QDeclarativeGridView::indexAt(int x, int y) const
{
@@ -2113,10 +2151,16 @@ void QDeclarativeGridView::componentComplete()
d->updateGrid();
if (d->isValid()) {
refill();
+ d->moveReason = QDeclarativeGridViewPrivate::SetIndex;
if (d->currentIndex < 0)
d->updateCurrent(0);
else
d->updateCurrent(d->currentIndex);
+ if (d->highlight) {
+ d->highlight->setPosition(d->currentItem->colPos(), d->currentItem->rowPos());
+ d->updateTrackedItem();
+ }
+ d->moveReason = QDeclarativeGridViewPrivate::Other;
d->fixupPosition();
}
}
diff --git a/src/declarative/graphicsitems/qdeclarativegridview_p.h b/src/declarative/graphicsitems/qdeclarativegridview_p.h