diff --git a/examples/quick/controls/shared/qt_quick_controls_examplemain.h b/examples/quick/controls/shared/qt_quick_controls_examplemain.h
index e3cae9a09ec444f3bdb1772045f6743a6016e102..324d7110579268db318d7242e5b9ba8b2e315b2d 100644
--- a/examples/quick/controls/shared/qt_quick_controls_examplemain.h
+++ b/examples/quick/controls/shared/qt_quick_controls_examplemain.h
@@ -64,20 +64,13 @@ QT_BEGIN_NAMESPACE
     int main(int argc, char *argv[]) \
     { \
         Application app(argc, argv); \
-        QQmlEngine engine; \
-        QQmlComponent component(&engine); \
-        component.loadUrl(QUrl(#url)); \
-        if ( !component.isReady() ) { \
-            qWarning("%s", qPrintable(component.errorString())); \
-            return -1; \
-        } \
-        QObject *topLevel = component.create(); \
+        QQmlApplicationEngine engine(QUrl(#url)); \
+        QObject *topLevel = engine.rootObjects().value(0); \
         QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel); \
         if ( !window ) { \
             qWarning("Error: Your root item has to be a Window."); \
             return -1; \
         } \
-        QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit())); \
         window->show(); \
         return app.exec(); \
     }
diff --git a/examples/quick/controls/text/example.html b/examples/quick/controls/text/example.html
index 0560897b69384090c36a28873f7356340e6cb93b..52bb507a1a1787c85355ba9d7e51293806a66185 100644
--- a/examples/quick/controls/text/example.html
+++ b/examples/quick/controls/text/example.html
@@ -1,11 +1,13 @@
-<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>QTextEdit Example</title><style type="text/css">
+<html><head><meta name="qrichtext" content="1" /><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>TextArea Example</title><style type="text/css">
 p, li { white-space: pre-wrap; }
 </style></head><body style=" font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:20pt; font-weight:600;">QTextEdit</span></p>
-<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">The QTextEdit widget is an advanced editor that supports formatted rich text. It can be used to display HTML and other rich document formats. Internally, QTextEdit uses the QTextDocument class to describe both the high-level structure of each document and the low-level formatting of paragraphs.</span></p>
-<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">If you are viewing this document in the <span style=" font-style:italic;">textedit</span> example, you can edit this document to explore Qt's rich text editing features. We have included some comments in each of the following sections to encourage you to experiment.  </p>
+<p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:20pt; font-weight:600;">TextArea</span></p>
+<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">The TextArea control is an advanced editor that supports formatted rich text. It can be used to display HTML and other rich document formats. Internally, TextArea uses the QQuickTextDocument class to describe both the high-level structure of each document and the low-level formatting of paragraphs.</span></p>
+<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">If you are viewing this document in the <span style=" font-style:italic;">Text Editor</span> example, you can edit this document to explore Qt's rich text editing features. We have included some comments in each of the following sections to encourage you to experiment.  </p>
 <p style=" margin-top:16px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:18pt; font-weight:600;"><span style=" font-size:16pt;">Font and Paragraph Styles</span></p>
-<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">QTextEdit supports </span><span style=" font-size:11pt; font-weight:600;">bold</span><span style=" font-size:11pt;">, </span><span style=" font-size:11pt; font-style:italic;">italic</span><span style=" font-size:11pt;">, and </span><span style=" font-size:11pt; text-decoration: underline;">underlined</span><span style=" font-size:11pt;"> font styles, and can display </span><span style=" font-size:11pt; font-weight:600; color:#00007f;">multicolored</span><span style=" font-size:11pt;"> </span><span style=" font-size:11pt; font-weight:600; color:#aa0000;">text</span><span style=" font-size:11pt;">. Font families such as </span><span style=" font-family:'Times'; font-size:11pt; font-weight:600;">Times New Roman</span><span style=" font-size:11pt;"> and </span><span style=" font-family:'Courier'; font-size:11pt; font-weight:600;">Courier</span><span style=" font-size:11pt;"> can also be used directly. </span><span style=" font-size:11pt; font-style:italic;">If you place the cursor in a region of styled text, the controls in the tool bars will change to reflect the current style.</span></p>
+<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">TextArea supports </span><span style=" font-size:11pt; font-weight:600;">bold</span><span style=" font-size:11pt;">, </span><span style=" font-size:11pt; font-style:italic;">italic</span><span style=" font-size:11pt;">, and </span><span style=" font-size:11pt; text-decoration: underline;">underlined</span><span style=" font-size:11pt;"> font styles, and can display </span><span style=" font-size:11pt; font-weight:600; color:#00007f;">multicolored</span>
+<span style=" font-size:11pt;"> </span><span style=" font-size:11pt; font-weight:600; color:#aa0000;">text</span><span style=" font-size:11pt;">. Font families such as</span><span style=" font-family:'Helvetica'; font-size:11pt; font-weight:600;"> Helvetica</span><span style=" font-size:11pt;"> and
+</span><span style=" font-family:'Courier'; font-size:11pt; font-weight:600;"> Courier</span><span style=" font-size:11pt;"> can also be used directly.<span style=" font-size:11pt; font-style:italic;"> If you place the cursor in a region of styled text, the corresponding controls in the tool bar will change to reflect the current style, font size and color.</span></p>
 <p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Paragraphs can be formatted so that the text is left-aligned, right-aligned, centered, or fully justified.</p>
 <p align="center" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-style:italic;">Try changing the alignment of some text and resize the editor to see how the text layout changes.</span> </p>
 <p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:16pt; font-weight:600;">Lists</span></p>
@@ -13,7 +15,7 @@ p, li { white-space: pre-wrap; }
 <ul style="-qt-list-indent: 1;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Disc symbols are typically used for top-level list items. </li></ul>
 <ul type=circle style="-qt-list-indent: 2;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Circle symbols can be used to distinguish between items in lower-level lists.</li></ul>
 <ul type=square style="-qt-list-indent: 3;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Square symbols provide a reasonable alternative to discs and circles. </li></ul>
-<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Ordered lists can be created that can be used for tables of contents. Different characters can be used to enumerate items, and we can use both Roman and Arabic numerals in the same list structure: </p>
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Ordered lists can be used for tables of contents. Different characters can be used to enumerate items, and one can use both Roman and Arabic numerals in the same list structure: </p>
 <ol style="-qt-list-indent: 1;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Introduction</li>
 <li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qt Tools </li></ol>
 <ol type=a style="-qt-list-indent: 2;"><li style=" font-size:11pt;" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Qt Assistant</li>
@@ -26,9 +28,9 @@ p, li { white-space: pre-wrap; }
 <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
 <p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-size:16pt; font-weight:600;">Images</span></p>
 <p style=" margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"><span style=" font-size:11pt; font-weight:400;">Inline images are treated like ordinary ranges of characters in the text editor, so they flow with the surrounding text. Images can also be selected in the same way as text, making it easy to cut, copy, and paste them. </span></p>
-<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><img src="qrc:qml/images/logo32.png" /><span style=" font-style:italic;"> Try to select this image by clicking and dragging over it with the mouse, or use the text cursor to select it by holding down Shift and using the arrow keys. You can then cut or copy it, and paste it into different parts of this document.</span></p>
+<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><img src="qrc:qml/images/qt-logo.png" /><span style=" font-style:italic;"> Try to select this image by clicking and dragging over it with the mouse, or use the text cursor to select it by holding down Shift and using the arrow keys. You can then cut or copy it, and paste it into different parts of this document.</span></p>
 <p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-size:16pt; font-weight:600;">Tables</span></p>
-<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"><span style=" font-size:11pt; font-weight:400;">QTextEdit can arrange and format tables, supporting features such as row and column spans, text formatting within cells, and size constraints for columns. </span></p>
+<p align="justify" style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:16pt; font-weight:600;"><span style=" font-size:11pt; font-weight:400;">TextArea can arrange and format tables, supporting features such as row and column spans, text formatting within cells, and size constraints for columns. </span></p>
 <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
 <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
 <table border="1" align="center" width="90%" cellspacing="0" cellpadding="4">
@@ -72,8 +74,6 @@ p, li { white-space: pre-wrap; }
 <td></td></tr></table>
 <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"></p>
 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt; font-style:italic;">Try adding text to the cells in the table and experiment with the alignment of the paragraphs.</p>
-<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-size:16pt; font-weight:600;">Hyperlinks</span></p>
-<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:11pt;">QTextEdit is designed to support hyperlinks between documents, and this feature is used extensively in </span><span style=" font-size:11pt; font-style:italic;">Qt Assistant</span><span style=" font-size:11pt;">. Hyperlinks are automatically created when an HTML file is imported into an editor. Since the rich text framework supports hyperlinks natively, they can also be created programatically.</span></p>
 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-size:16pt; font-weight:600;">Undo and Redo</span></p>
-<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Full support for undo and redo operations is built into QTextEdit and the underlying rich text framework. Operations on a document can be packaged together to make editing a more comfortable experience for the user.</p>
+<p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;">Full support for undo and redo operations is built into TextArea and the underlying rich text framework. Operations on a document can be packaged together to make editing easier for the user.</p>
 <p style=" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:11pt;"><span style=" font-style:italic;">Try making changes to this document and press Ctrl+Z to undo them. You can always recover  the original contents of the document.</span> </p></body></html>
diff --git a/examples/quick/controls/text/qml/images/logo32.png b/examples/quick/controls/text/qml/images/logo32.png
deleted file mode 100644
index 5f91e9873b7852876a84f0853a092868618a3fb1..0000000000000000000000000000000000000000
Binary files a/examples/quick/controls/text/qml/images/logo32.png and /dev/null differ
diff --git a/examples/quick/controls/text/qml/images/qt-logo.png b/examples/quick/controls/text/qml/images/qt-logo.png
new file mode 100644
index 0000000000000000000000000000000000000000..6dedc8bf0d14fa19e37f5404750bcf2a18157df5
Binary files /dev/null and b/examples/quick/controls/text/qml/images/qt-logo.png differ
diff --git a/examples/quick/controls/text/qml/main.qml b/examples/quick/controls/text/qml/main.qml
index ec6bff7b06d7457bc9aa463c815877e8dd90b8da..d8f175ed17a1bd703b239ed42a79bcc5a76cf6d1 100644
--- a/examples/quick/controls/text/qml/main.qml
+++ b/examples/quick/controls/text/qml/main.qml
@@ -85,32 +85,34 @@ ApplicationWindow {
     }
 
     Action {
-        id: cut
+        id: cutAction
         text: "Cut"
         shortcut: "ctrl+x"
         iconSource: "images/editcut.png"
         iconName: "edit-cut"
+        onTriggered: textArea.cut()
     }
 
     Action {
-        id: copy
+        id: copyAction
         text: "Copy"
         shortcut: "Ctrl+C"
         iconSource: "images/editcopy.png"
         iconName: "edit-copy"
-        onTriggered: console.log("Ctrl C pressed - in action...")
+        onTriggered: textArea.copy()
     }
 
     Action {
-        id: paste
+        id: pasteAction
         text: "Paste"
         shortcut: "ctrl+v"
         iconSource: "qrc:images/editpaste.png"
         iconName: "edit-paste"
+        onTriggered: textArea.paste()
     }
 
     Action {
-        id: alignLeft
+        id: alignLeftAction
         text: "&Left"
         iconSource: "images/textleft.png"
         iconName: "format-justify-left"
@@ -120,16 +122,16 @@ ApplicationWindow {
         checked: document.alignment == Qt.AlignLeft
     }
     Action {
-        id: alignCenter
+        id: alignCenterAction
         text: "C&enter"
         iconSource: "images/textcenter.png"
         iconName: "format-justify-center"
-        onTriggered: document.alignment = Qt.AlignCenter
+        onTriggered: document.alignment = Qt.AlignHCenter
         checkable: true
-        checked: document.alignment == Qt.AlignCenter
+        checked: document.alignment == Qt.AlignHCenter
     }
     Action {
-        id: alignRight
+        id: alignRightAction
         text: "&Right"
         iconSource: "images/textright.png"
         iconName: "format-justify-right"
@@ -138,7 +140,7 @@ ApplicationWindow {
         checked: document.alignment == Qt.AlignRight
     }
     Action {
-        id: alignJustify
+        id: alignJustifyAction
         text: "&Justify"
         iconSource: "images/textjustify.png"
         iconName: "format-justify-fill"
@@ -148,7 +150,7 @@ ApplicationWindow {
     }
 
     Action {
-        id: bold
+        id: boldAction
         text: "&Bold"
         iconSource: "images/textbold.png"
         iconName: "format-text-bold"
@@ -156,8 +158,9 @@ ApplicationWindow {
         checkable: true
         checked: document.bold
     }
+
     Action {
-        id: italic
+        id: italicAction
         text: "&Italic"
         iconSource: "images/textitalic.png"
         iconName: "format-text-italic"
@@ -166,7 +169,7 @@ ApplicationWindow {
         checked: document.italic
     }
     Action {
-        id: underline
+        id: underlineAction
         text: "&Underline"
         iconSource: "images/textunder.png"
         iconName: "format-text-underline"
@@ -176,41 +179,55 @@ ApplicationWindow {
     }
 
     FileDialog {
-        id: file
+        id: fileDialog
         nameFilters: ["Text files (*.txt)", "HTML files (*.html)"]
         onAccepted: document.fileUrl = fileUrl
     }
 
+    ColorDialog {
+        id: colorDialog
+        color: "black"
+        onAccepted: document.textColor = color
+    }
+
     Action {
-        id: fileOpen
+        id: fileOpenAction
         iconSource: "images/fileopen.png"
         iconName: "document-open"
         text: "Open"
-        onTriggered: file.open()
+        onTriggered: fileDialog.open()
     }
 
     menuBar: MenuBar {
         Menu {
             title: "&File"
-            MenuItem { action: fileOpen }
+            MenuItem { action: fileOpenAction }
             MenuItem { text: "Quit"; onTriggered: Qt.quit() }
         }
         Menu {
             title: "&Edit"
-            MenuItem { action: copy }
-            MenuItem { action: cut }
-            MenuItem { action: paste }
+            MenuItem { action: copyAction }
+            MenuItem { action: cutAction }
+            MenuItem { action: pasteAction }
         }
         Menu {
             title: "F&ormat"
-            MenuItem { action: bold }
-            MenuItem { action: italic }
-            MenuItem { action: underline }
+            MenuItem { action: boldAction }
+            MenuItem { action: italicAction }
+            MenuItem { action: underlineAction }
+            MenuSeparator {}
+            MenuItem { action: alignLeftAction }
+            MenuItem { action: alignCenterAction }
+            MenuItem { action: alignRightAction }
+            MenuItem { action: alignJustifyAction }
             MenuSeparator {}
-            MenuItem { action: alignLeft }
-            MenuItem { action: alignCenter }
-            MenuItem { action: alignRight }
-            MenuItem { action: alignJustify }
+            MenuItem {
+                text: "&Color ..."
+                onTriggered: {
+                    colorDialog.color = document.textColor
+                    colorDialog.open()
+                }
+            }
         }
         Menu {
             title: "&Help"
@@ -224,26 +241,71 @@ ApplicationWindow {
         RowLayout {
             anchors.fill: parent
             spacing: 0
-            ToolButton { action: fileOpen }
+            ToolButton { action: fileOpenAction }
 
             ToolBarSeparator {}
 
-            ToolButton { action: copy }
-            ToolButton { action: cut }
-            ToolButton { action: paste }
+            ToolButton { action: copyAction }
+            ToolButton { action: cutAction }
+            ToolButton { action: pasteAction }
 
             ToolBarSeparator {}
 
-            ToolButton { action: bold }
-            ToolButton { action: italic }
-            ToolButton { action: underline }
+            ToolButton { action: boldAction }
+            ToolButton { action: italicAction }
+            ToolButton { action: underlineAction }
 
             ToolBarSeparator {}
 
-            ToolButton { action: alignLeft }
-            ToolButton { action: alignCenter }
-            ToolButton { action: alignRight }
-            ToolButton { action: alignJustify }
+            ToolButton { action: alignLeftAction }
+            ToolButton { action: alignCenterAction }
+            ToolButton { action: alignRightAction }
+            ToolButton { action: alignJustifyAction }
+
+            ToolBarSeparator {}
+
+            ToolButton {
+                id: colorButton
+                property var color : document.textColor
+                Rectangle {
+                    id: colorRect
+                    anchors.fill: parent
+                    anchors.margins: 8
+                    color: Qt.darker(document.textColor, colorButton.pressed ? 1.4 : 1)
+                    border.width: 1
+                    border.color: Qt.darker(colorRect.color, 2)
+                }
+                onClicked: {
+                    colorDialog.color = document.textColor
+                    colorDialog.open()
+                }
+            }
+            Item { Layout.fillWidth: true }
+        }
+    }
+
+    ToolBar {
+        id: secondaryToolBar
+        width: parent.width
+
+        RowLayout {
+            anchors.fill: parent
+            ComboBox {
+                id: fontFamilyComboBox
+                implicitWidth: 150
+                model: Qt.fontFamilies()
+                property bool special : false
+                onCurrentTextChanged: {
+                    if (special == false || currentIndex != 0)
+                        document.fontFamily = currentText
+                }
+            }
+            SpinBox {
+                id: fontSizeSpinBox
+                implicitWidth: 50
+                value: 0
+                onValueChanged: document.fontSize = value
+            }
             Item { Layout.fillWidth: true }
         }
     }
@@ -253,7 +315,7 @@ ApplicationWindow {
         id: textArea
         frameVisible: false
         width: parent.width
-        anchors.top: parent.top
+        anchors.top: secondaryToolBar.bottom
         anchors.bottom: parent.bottom
         text: document.text
         textFormat: Qt.RichText
@@ -266,5 +328,17 @@ ApplicationWindow {
         cursorPosition: textArea.cursorPosition
         selectionStart: textArea.selectionStart
         selectionEnd: textArea.selectionEnd
+        Component.onCompleted: document.fileUrl = "qrc:/example.html"
+        onFontSizeChanged: fontSizeSpinBox.value = document.fontSize
+        onFontFamilyChanged: {
+            var index = Qt.fontFamilies().indexOf(document.fontFamily)
+            if (index == -1) {
+                fontFamilyComboBox.currentIndex = 0
+                fontFamilyComboBox.special = true
+            } else {
+                fontFamilyComboBox.currentIndex = index
+                fontFamilyComboBox.special = false
+            }
+        }
     }
 }
diff --git a/examples/quick/controls/text/resources.qrc b/examples/quick/controls/text/resources.qrc
index 4d137ff797383d6933e3bd47fd142540489971a0..27c7b92159e8e327ff4abf3eebf924f17a9d7bc6 100644
--- a/examples/quick/controls/text/resources.qrc
+++ b/examples/quick/controls/text/resources.qrc
@@ -1,27 +1,27 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="/">
-  <file>qml/main.qml</file>
-  <file>qml/ToolBarSeparator.qml</file>
-  <file>qml/images/logo32.png</file>
-  <file>qml/images/editcopy.png</file>
-  <file>qml/images/editcut.png</file>
-  <file>qml/images/editpaste.png</file>
-  <file>qml/images/editredo.png</file>
-  <file>qml/images/editundo.png</file>
-  <file>qml/images/exportpdf.png</file>
-  <file>qml/images/filenew.png</file>
-  <file>qml/images/fileopen.png</file>
-  <file>qml/images/fileprint.png</file>
-  <file>qml/images/filesave.png</file>
-  <file>qml/images/textbold.png</file>
-  <file>qml/images/textcenter.png</file>
-  <file>qml/images/textitalic.png</file>
-  <file>qml/images/textjustify.png</file>
-  <file>qml/images/textleft.png</file>
-  <file>qml/images/textright.png</file>
-  <file>qml/images/textunder.png</file>
-  <file>qml/images/zoomin.png</file>
-  <file>qml/images/zoomout.png</file>
-  <file>example.html</file>
-</qresource>
+<RCC>
+    <qresource prefix="/">
+        <file>qml/main.qml</file>
+        <file>qml/ToolBarSeparator.qml</file>
+        <file>qml/images/editcopy.png</file>
+        <file>qml/images/editcut.png</file>
+        <file>qml/images/editpaste.png</file>
+        <file>qml/images/editredo.png</file>
+        <file>qml/images/editundo.png</file>
+        <file>qml/images/exportpdf.png</file>
+        <file>qml/images/filenew.png</file>
+        <file>qml/images/fileopen.png</file>
+        <file>qml/images/fileprint.png</file>
+        <file>qml/images/filesave.png</file>
+        <file>qml/images/textbold.png</file>
+        <file>qml/images/textcenter.png</file>
+        <file>qml/images/textitalic.png</file>
+        <file>qml/images/textjustify.png</file>
+        <file>qml/images/textleft.png</file>
+        <file>qml/images/textright.png</file>
+        <file>qml/images/textunder.png</file>
+        <file>qml/images/zoomin.png</file>
+        <file>qml/images/zoomout.png</file>
+        <file>example.html</file>
+        <file>qml/images/qt-logo.png</file>
+    </qresource>
 </RCC>
diff --git a/examples/quick/controls/text/src/documenthandler.cpp b/examples/quick/controls/text/src/documenthandler.cpp
index 81eb744b6e9b5d1b6cb2c9821ae76a5390610af5..e0c9610d0df79d36e418f68faf46d3cbc9f90775 100644
--- a/examples/quick/controls/text/src/documenthandler.cpp
+++ b/examples/quick/controls/text/src/documenthandler.cpp
@@ -52,7 +52,6 @@ DocumentHandler::DocumentHandler()
     , m_selectionStart(0)
     , m_selectionEnd(0)
 {
-    setFileUrl(QUrl("qrc:/example.html"));
 }
 
 void DocumentHandler::setTarget(QQuickItem *target)
@@ -91,6 +90,8 @@ void DocumentHandler::setFileUrl(const QUrl &arg)
 
                 emit textChanged();
                 emit documentTitleChanged();
+
+                reset();
             }
         }
         emit fileUrlChanged();
@@ -135,12 +136,18 @@ void DocumentHandler::setCursorPosition(int position)
 
     m_cursorPosition = position;
 
-    emit currentFontChanged();
+    reset();
+}
+
+void DocumentHandler::reset()
+{
+    emit fontFamilyChanged();
     emit alignmentChanged();
     emit boldChanged();
     emit italicChanged();
     emit underlineChanged();
     emit fontSizeChanged();
+    emit textColorChanged();
 }
 
 QTextCursor DocumentHandler::textCursor() const
@@ -260,13 +267,44 @@ void DocumentHandler::setFontSize(int arg)
     emit fontSizeChanged();
 }
 
-QFont DocumentHandler::currentFont() const
+QColor DocumentHandler::textColor() const
+{
+    QTextCursor cursor = textCursor();
+    if (cursor.isNull())
+        return QColor(Qt::black);
+    QTextCharFormat format = cursor.charFormat();
+    return format.foreground().color();
+}
+
+void DocumentHandler::setTextColor(const QColor &c)
+{
+    QTextCursor cursor = textCursor();
+    if (cursor.isNull())
+        return;
+    QTextCharFormat format;
+    format.setForeground(QBrush(c));
+    mergeFormatOnWordOrSelection(format);
+    emit textColorChanged();
+}
+
+QString DocumentHandler::fontFamily() const
 {
     QTextCursor cursor = textCursor();
     if (cursor.isNull())
-        return QFont();
+        return QString();
     QTextCharFormat format = cursor.charFormat();
-    return format.font();
+    return format.font().family();
+}
+
+void DocumentHandler::setFontFamily(const QString &arg)
+{
+    QTextCursor cursor = textCursor();
+    if (cursor.isNull())
+        return;
+    QTextCharFormat format;
+    format.setFontFamily(arg);
+    mergeFormatOnWordOrSelection(format);
+    emit fontFamilyChanged();
 }
 
 QStringList DocumentHandler::defaultFontSizes() const
diff --git a/examples/quick/controls/text/src/documenthandler.h b/examples/quick/controls/text/src/documenthandler.h
index c60bc1d51988cccc4386dab71cca2b3c3ddbf310..a759c4033308180c97980ffc30336ec63a9d7966 100644
--- a/examples/quick/controls/text/src/documenthandler.h
+++ b/examples/quick/controls/text/src/documenthandler.h
@@ -63,7 +63,8 @@ class DocumentHandler : public QObject
     Q_PROPERTY(int selectionStart READ selectionStart WRITE setSelectionStart NOTIFY selectionStartChanged)
     Q_PROPERTY(int selectionEnd READ selectionEnd WRITE setSelectionEnd NOTIFY selectionEndChanged)
 
-    Q_PROPERTY(QFont currentFont READ currentFont NOTIFY currentFontChanged)
+    Q_PROPERTY(QColor textColor READ textColor WRITE setTextColor NOTIFY textColorChanged)
+    Q_PROPERTY(QString fontFamily READ fontFamily WRITE setFontFamily NOTIFY fontFamilyChanged)
     Q_PROPERTY(Qt::Alignment alignment READ alignment WRITE setAlignment NOTIFY alignmentChanged)
 
     Q_PROPERTY(bool bold READ bold WRITE setBold NOTIFY boldChanged)
@@ -93,7 +94,9 @@ public:
     int selectionStart() const { return m_selectionStart; }
     int selectionEnd() const { return m_selectionEnd; }
 
-    QFont currentFont() const;
+    QString fontFamily() const;
+
+    QColor textColor() const;
 
     Qt::Alignment alignment() const;
     void setAlignment(Qt::Alignment a);
@@ -114,6 +117,8 @@ public Q_SLOTS:
     void setItalic(bool arg);
     void setUnderline(bool arg);
     void setFontSize(int arg);
+    void setTextColor(const QColor &arg);
+    void setFontFamily(const QString &arg);
 
     void setFileUrl(const QUrl &arg);
     void setText(const QString &arg);
@@ -126,7 +131,8 @@ Q_SIGNALS:
     void selectionStartChanged();
     void selectionEndChanged();
 
-    void currentFontChanged();
+    void fontFamilyChanged();
+    void textColorChanged();
     void alignmentChanged();
 
     void boldChanged();
@@ -142,6 +148,7 @@ Q_SIGNALS:
     void documentTitleChanged();
 
 private:
+    void reset();
     QTextCursor textCursor() const;
     void mergeFormatOnWordOrSelection(const QTextCharFormat &format);
 
@@ -153,9 +160,6 @@ private:
     int m_selectionEnd;
 
     QFont m_font;
-    bool m_bold;
-    bool m_italic;
-    bool m_underline;
     int m_fontSize;
     QUrl m_fileUrl;
     QString m_text;
diff --git a/examples/quick/controls/text/src/main.cpp b/examples/quick/controls/text/src/main.cpp
index 0fc064dcedd405234de8bb8b5c75d19bc0d9883e..8d2b8dd0710221d7fab4c164e815909bf467adec 100644
--- a/examples/quick/controls/text/src/main.cpp
+++ b/examples/quick/controls/text/src/main.cpp
@@ -49,24 +49,14 @@
 int main(int argc, char *argv[])
 {
     QApplication app(argc, argv);
-    QQmlEngine engine;
-
     qmlRegisterType<DocumentHandler>("org.qtproject.example", 1, 0, "DocumentHandler");
-
-    QQmlComponent component(&engine);
-    component.loadUrl(QUrl("qrc:/qml/main.qml"));
-    if ( !component.isReady() ) {
-        qWarning("%s", qPrintable(component.errorString()));
-        return -1;
-    }
-    QObject *topLevel = component.create();
+    QQmlApplicationEngine engine(QUrl("qrc:/qml/main.qml"));
+    QObject *topLevel = engine.rootObjects().value(0);
     QQuickWindow *window = qobject_cast<QQuickWindow *>(topLevel);
     if ( !window ) {
         qWarning("Error: Your root item has to be a Window.");
         return -1;
     }
-
-    QObject::connect(&engine, SIGNAL(quit()), &app, SLOT(quit()));
     window->show();
     return app.exec();
 }
diff --git a/src/controls/StackView.qml b/src/controls/StackView.qml
index be1ddf062ac99d3a577553779497d1fe46ffb04e..9559ea87248b9895f26130a853a80f5a2b5d88ef 100644
--- a/src/controls/StackView.qml
+++ b/src/controls/StackView.qml
@@ -52,39 +52,38 @@ import "Private/StackView.js" as JSArray
 
     \brief Provides a stack-based navigation model.
 
-    StackView implements a stack-based navigation model. You use this view when you
-    have a set of interlinked information pages for the user to browse.
-    Items are pushed onto the stack as the user navigates deeper into the material, and
-    popped off again when he chooses to go back.
+    StackView implements a stack-based navigation model, which can be used
+    with a set of interlinked information pages. Items are pushed onto the stack
+    as the user navigates deeper into the material, and popped off again when he
+    chooses to go back.
 
     \section1 Using StackView in an Application
     Using the StackView in the application is typically a simple matter of adding
-    the StackView as a child of a Window. The stack is usually
-    anchored to the edges of the window, except at the top or bottom where it might
-    be anchored to a status bar, or some other similar UI component.
-    The stack can then be used by invoking its navigation methods. The first item
-    to show in the StackView is commonly loaded assigning it to \l initialItem.
+    the StackView as a child of a Window. The stack is usually anchored to the
+    edges of the window, except at the top or bottom where it might be anchored
+    to a status bar, or some other similar UI component. The stack can then be
+    used by invoking its navigation methods. The first item to show in the StackView
+    is commonly loaded assigning it to \l initialItem.
 
     \note Items pushed onto the stack view have \l{Supported Attached Properties}{Stack attached properties}.
 
     \section1 Basic Navigation
-    There are three primary navigation operations in StackView: push(), pop() and
-    replace (you replace by specifying argument \c replace to push()).
+    There are three primary navigation operations in StackView: push(), pop(), and
+    replace (replace by specifying argument \c replace to push()).
     These correspond to classic stack operations where "push" adds an item to the
     top of a stack, "pop" removes the top item from the stack, and "replace" is like a
     pop followed by a push in that it replaces the topmost item on the stack with
     a new item (but the applied transtition might be different). The topmost item
-    in the stack corresponds to the one that is \l{StackView::currentItem} {current},
-    i.e. the one that is visible on
-    screen. That means that "push" is the logical equivalent of navigating forward or
-    deeper into the application, "pop" is the equivalent of navigation back and
-    "replace" is the equivalent of replacing the current item with a different item.
-
-    Sometimes it is necessary to go back more than a single step in the stack, e.g.
-    to return to a "main" item or some kind of section item in the application.
-    For this use case, pop() can be provided with a item to pop to. This is called
-    an "unwind" operation as the stack gets unwound to the specified item. If the
-    item is not found then the stack unwinds until there is only a single item in
+    in the stack corresponds to the one that is \l{StackView::currentItem} {currently}
+    visible on the screen. That means that "push" is the logical equivalent of navigating
+    forward or deeper into the application, "pop" is the equivalent of navigating back,
+    and "replace" is the equivalent of replacing the current item.
+
+    Sometimes it is necessary to go back more than a single step in the stack, for
+    example, to return to a "main" item or some kind of section item in the application.
+    For this use case, it is possible to specify an item as a parameter for pop().
+    This is called an "unwind" operation as the stack gets unwound to the specified item.
+    If the item is not found then the stack unwinds until there is only a single item in
     the stack, which becomes the current item. To explicitly unwind to the bottom
     of the stack it is recommended to use \l{pop()} {pop(null)}, though technically any
     non-existent item will do.
@@ -98,11 +97,11 @@ import "Private/StackView.js" as JSArray
     \li \l{pop()}{pop(A)} => [A] - "pop" transition between C and A
     \endlist
 
-    Note that when the stack is empty, a push() will not perform a
-    transition animation because there is nothing to transition from (which will
-    typically happend during application start-up). A pop() on a stack with
-    depth 1 or 0 is a no-operation. If removing all items from the stack is
-    needed, a separate function clear() is available.
+    \note Note that when the stack is empty, a push() will not perform a
+    transition animation because there is nothing to transition from (typically during
+    application start-up). A pop() on a stack with depth 1 or 0 is a no-operation.
+    If removing all items from the stack is needed, a separate function clear() is
+    available.
 
     Calling push() returns the item that was pushed onto the stack.
     Calling pop() returns the item that was popped off the stack. When pop() is
@@ -110,22 +109,22 @@ import "Private/StackView.js" as JSArray
     popped, which will also be the one transitioning out) is returned.
 
     \section1 Deep Linking
-    Deep linking means launching an application into a particular state. For example
-    a Newspaper application could be launched into showing a particular article,
-    bypassing the front item (and possible a section item) that would normally have
-    to be navigated through to get to the article in question. In terms of StackView, deep
-    linking means the ability to modify the state of the stack so that
-    you e.g. push a set of items to the top of the stack, or that you completely reset
+    \e{Deep linking} means launching an application into a particular state. For example,
+    a newspaper application could be launched into showing a particular article,
+    bypassing the front item (and possibly a section item) that would normally have
+    to be navigated through to get to the article concerned. In terms of StackView, deep
+    linking means the ability to modify the state of the stack, so much so that it is
+    possible to push a set of items to the top of the stack, or to completely reset
     the stack to a given state.
 
-    The API for deep linking in StackView is the same as for basic navigation. If
-    you push an array instead of a single item then all the items in that array will
+    The API for deep linking in StackView is the same as for basic navigation. Pushing
+    an array instead of a single item, will involve that all the items in that array will
     be pushed onto the stack. The transition animation, however, will be conducted as
     if only the last item in the array was pushed onto the stack. The normal semantics
-    of push() apply for deep linking, meaning that push() adds whatever you push onto
-    the stack. Note also that only the last item in the array will actually be loaded.
-    The rest will be lazy loaded as needed when entering
-    the screen upon subsequent calls to pop (or when requesting the item by using \a get).
+    of push() apply for deep linking, meaning that push() adds whatever is pushed onto
+    the stack. Note also that only the last item of the array will be loaded.
+    The rest will be lazy-loaded as needed when entering the screen upon subsequent
+    calls to pop (or when requesting the item by using \a get).
 
     This gives us the following result, given the stack [A, B, C]:
 
@@ -137,93 +136,95 @@ import "Private/StackView.js" as JSArray
 
     \section1 Pushing items
 
-    An item you push onto the StackView can be either an Item, a URL, a
-    string with a URL, or a Component. To push it, you assign it
-    to a property "item" inside a property list, and send it as argument to \l{StackView::push}{push}:
+    An item pushed onto the StackView can be either an Item, a URL, a string
+    with a URL, or a Component. To push it, assign it to a property "item"
+    inside a property list, and send it as an argument to \l{StackView::push}{push}:
 
     \code
     stackView.push({item: yourItem})
     \endcode
 
-    The list can contain several properties that controls how the item should be pushed:
+    The list can contain several properties that control how the item should be pushed:
     \list
-    \li \c item: This property is required, and holds the item you want to push.
-    \li \c properties: You can set a property list of QML properties that should be assigned
-        to the item upon push. These properties will be copied into the item at the
-        time the item is loaded, or about to become the current item (normally upon push).
-    \li \c immediate: Set this property to \c true to skip transition effects. When pushing
-        an array, you only need to set this property on the first element to make the
+    \li \c item: this property is required, and holds the item to be pushed.
+    \li \c properties: a list of QML properties to be assigned to the item upon push. These
+        properties will be copied into the item at load time, or when the item will become
+        the current item (normally upon push).
+    \li \c immediate: set this property to \c true to skip transition effects. When pushing
+        an array, this property only needs to be set on the first element to make the
         whole operation immediate.
-    \li \c replace: Set this property to replace the current item on the stack. When pushing
+    \li \c replace: set this property to replace the current item on the stack. When pushing
         an array, you only need to set this property on the first element to replace
         as many elements on the stack as inside the array.
-    \li \c destroyOnPop: Set this property to be explicit to whether or not StackView should
-        destroy the item when its popped off the stack. By default (if \a destroyOnPop is
-        not specified), StackView will destroy items pushed as components or URLs. Items
-        not destroyed will be reparented back to the original parents they had before being
-        pushed onto the stack, and hidden. If you need to set this property, do it with
-        care, so that items are not leaked.
+    \li \c destroyOnPop: set this boolean to true if StackView needs to destroy the item when
+        it is popped off the stack. By default (if \a destroyOnPop is not specified), StackView
+        will destroy items pushed as components or URLs. Items not destroyed will be re-parented
+        back to the original parents they had before being pushed onto the stack and hidden.
+        If you need to set this property, do it with care, so that items are not leaked.
     \endlist
 
-    If the only argument needed is "item", you can also, as a short-hand
-    notation, do:
+    If the only argument needed is "item", the following short-hand notation can be applied:
 
     \code
-    stackView.push(yourItem).
+    stackView.push(yourItem)
     \endcode
 
     You can push several items in one go by using an array of property lists. This is
     optimizing compared to pushing items one by one, since StackView then can load only the
     last item in the list. The rest will be loaded as they are about to become
-    the current item (which happends when the stack is popped). The following example shows how
+    the current item (which happens when the stack is popped). The following example shows how
     to push an array of items:
 
     \code
     stackView.push([{item: yourItem1}, {item: yourItem2}])
     \endcode
 
-    If inline items are pushed, the item gets re-parented into an internal
-    container in the StackView. When the item is later popped off, it gets
-    re-parented back to its original owner. If, however, an item is pushed
-    as a component or a URL, the actual item will be created as a item from that component. This
-    happens automatically when the item is about to become the current item in the stack. Ownership
-    over the item will then normally be taken by the StackView. It will as such automatically
-    destroy the item when it is later popped off. The component that declared the item, by
+    If an inline item is pushed, the item is temporarily re-parented into the StackView. When the item
+    is later popped off, it gets re-parented back to its original owner again.
+    If, however, an item is pushed as a component or a URL, the actual item will be created as an
+    item from that component. This happens automatically when the item is about to become the current
+    item in the stack. Ownership of the item will then normally be taken by the StackView. It will as
+    such automatically destroy the item when it is later popped off. The component that declared the item, by
     contrast, remains in the ownership of the application and is not destroyed by the stack.
-    You can override this behavior if needed by explicitly setting "destroyOnPop" in the list
-    argument given to push.
+    This can be overridden by explicitly setting \c{destroyOnPop} in the list of arguments given to push.
 
-    If you specify the \c properties property to push, these properties will be copied into
-    the item at the time the item is loaded (in case of a component or URL), or instead when
-    its about to become the current item (in case of an inline item). This normally happens when
-    the item is pushed. The following example shows how this can be done:
+    If the \c properties to be pushed are specified, they will be copied into the item at loading time
+    (in case of a component or URL), or when the item will become the current item (in case of an inline
+    item). The following example shows how this can be done:
 
     \code
-    stackView.push({item: someItem, properties: {fgcolor: "red", bgcolor: "blue"}});
+    stackView.push({item: someItem, properties: {fgcolor: "red", bgcolor: "blue"}})
     \endcode
 
-    Note that if an item is declared inside another item that is destroyed - even if a component
-    was used - that child item also gets destroyed.
-    This follows normal Qt parent-child destruction rules but sometimes comes as a surprise
-    for developers. In practice this means that if you declare a item B as a child of
-    item A and then do a replace from item A to item B, then item B will be destroyed when
-    item A was destroyed (as it was popped off the stack) and the application will effectively
-    be switching to a item that has been destroyed.
+
+    \note Note that if an item is declared inside another item, and if that parent gets destroyed,
+    (even if a component was used), that child item will also be destroyed.
+    This follows normal Qt parent-child destruction rules, but sometimes comes as a surprise
+    for developers.
 
     \section1 Lifecycle
-    An items lifecycle in the StackView goes from instantiation to inactive, activating, active,
-    deactivating, inactive, and when no longer needed, destruction.
+    An item's lifecycle in the StackView can have the following transitions:
+    \list 1
+    \li instantiation
+    \li inactive
+    \li activating
+    \li active
+    \li deactivating
+    \li inactive
+    \li destruction
+    \endlist
+
     It can move any number of times between inactive and active. When an item is activated,
     it's visible on the screen and is considered to be the current item. An item
     in a StackView that is not visible is not activated, even if the item is currently the
-    top-most item in the stack. When the stack becomes visible the item that is top-most gets
-    activated. Likewise if the stack is then hidden, the top-most item would be deactivated.
+    top-most item in the stack. When the stack becomes visible, the item that is top-most gets
+    activated. Likewise if the stack is then hidden, the topmost item would be deactivated.
     Popping the item off the top of the stack at this point would not result in further
     deactivation since the item is not active.
 
-    There is an attached \l{Stack::status}{Stack.status} property that tracks the lifecycle. The value of status is
-    an enumeration with values \c Stack.Inactive, \c Stack.Activating, \c Stack.Active
-    and \c Stack.Deactivating. Combined with the normal \c Component.onComplete and
+    There is an attached \l{Stack::status}{Stack.status} property that tracks the lifecycle. The
+    status values list is an enumeration with values \c Stack.Inactive, \c Stack.Activating,
+    \c Stack.Active and \c Stack.Deactivating. Combined with the normal \c Component.onComplete and
     \c Component.onDestruction signals the entire lifecycle is thus:
 
     \list
@@ -236,26 +237,26 @@ import "Private/StackView.js" as JSArray
     \endlist
 
     \section1 Finding items
-    Sometimes it is necessary to search for a item, e.g. in order to unwind the stack to
+    Sometimes it is necessary to search for an item, for example, in order to unwind the stack to
     an item to which the application does not have a reference. This is facilitated using a
     function find() in StackView. The find() function takes a callback function as its
     only argument. The callback gets invoked for each item in the stack (starting at the top).
-    If the callback returns true then it signals that a match has been found and the find()
-    function returns that item. If the callback fails to return true (i.e. no match is found)
+    If the callback returns true, then it signals that a match has been found and the find()
+    function returns that item. If the callback fails to return true (no match is found),
     then find() returns \c null.
 
-    The code below searches for an item in the stack that has a name "foo" and then unwinds to
-    that item. Note that since find() returns null if no item is found and since pop unwinds to
-    the bottom of the stack if null is given as the target item, the code works well even in the
-    case that no matching item was found.
+    The code below searches for an item in the stack that has a name "order_id" and then unwinds to
+    that item. Note that since find() returns \c {null} if no item is found, and since pop unwinds to
+    the bottom of the stack if null is given as the target item, the code works well even in
+    case no matching item is found.
 
     \code
     stackView.pop(stackView.find(function(item) {
-        return item.name == "foo";
+        return item.name == "order_id";
     }));
     \endcode
 
-    You can also get to a item in the stack using get(index). You should use
+    You can also get to an item in the stack using \l {get()}{get(index)}. You should use
     this function if your item depends on another item in the stack, as the function will
     ensure that the item at the given index gets loaded before it is returned.
 
@@ -316,8 +317,8 @@ import "Private/StackView.js" as JSArray
     Implement this function to reset any properties animated on the exitItem so that later
     transitions can expect the items to be in a default state.
 
-    A more complex example could look like the following. Here, the items slides in lying on the side before
-    they are rotated up in an upright position:
+    A more complex example could look like the following. Here, the items are lying on the side before
+    being rotated to an upright position:
 
     \qml
     StackView {
@@ -376,7 +377,7 @@ import "Private/StackView.js" as JSArray
     depending on the their internal state. StackView will expect you to return a Component that
     contains a StackViewTransition, or a StackViewTransition directly. The former is easier, as StackView will
     then create the transition and later destroy it when it's done, while avoiding any sideeffects
-    caused by the transition being alive long after it ran. Returning a StackViewTransition directly
+    caused by the transition being alive long after it has run. Returning a StackViewTransition directly
     can be useful if you need to write some sort of transition caching for performance reasons.
     As an optimization, you can also return \c null to signal that you just want to show/hide the items
     immediately without creating or running any transitions. You can also override this function if
@@ -385,9 +386,9 @@ import "Private/StackView.js" as JSArray
     \c properties contains the properties that will be assigned to the StackViewTransition before
     it runs. In fact, you can add more properties to this object during the call
     if you need to initialize additional properties of your custom StackViewTransition when the returned
-    component is instanciated.
+    component is instantiated.
 
-    The following example shows how you can decide run-time which animation to use:
+    The following example shows how you can decide which animation to use during runtime :
 
     \qml
     StackViewDelegate {
@@ -491,28 +492,28 @@ Item {
     /*! Pushes an item onto the stack. The function takes a property list as argument, which
         should contain one or more of the following properties:
         \list
-        \li \c item: This property is required, and holds the item you want to push.
-        \li \c properties: You can set a property list of QML properties that should be assigned
-            to the item upon push. These properties will be copied into the item at the
-            time the item is loaded (in case of a component or URL), or else the first time it
-            becomes the current item (normally upon push).
-        \li \c immediate: Set this property to \c true to skip transition effects. When pushing
+        \li \c item: this property is required, and holds the item you want to push.
+        \li \c properties: a list of QML properties that should be assigned
+            to the item upon push. These properties will be copied into the item when it is
+            loaded (in case of a component or URL), or when it becomes the current item for the
+            first time (normally upon push).
+        \li \c immediate: set this property to \c true to skip transition effects. When pushing
             an array, you only need to set this property on the first element to make the
             whole operation immediate.
-        \li \c replace: Set this property to replace the current item on the stack. When pushing
+        \li \c replace: set this property to replace the current item on the stack. When pushing
             an array, you only need to set this property on the first element to replace
             as many elements on the stack as inside the array.
-        \li \c destroyOnPop: Set this property to be explicit to whether or not StackView should
-            destroy the item when its popped off the stack. By default (if \a destroyOnPop is
-            not specified), StackView will destroy items pushed as components or URLs. Items
-            not destroyed will be reparented back to the original parents they had before being
+        \li \c destroyOnPop: set this property to specify if the item needs to be destroyed
+            when its popped off the stack. By default (if \a destroyOnPop is not specified),
+            StackView will destroy items pushed as components or URLs. Items
+            not destroyed will be re-parented to the original parents they had before being
             pushed onto the stack, and hidden. If you need to set this property, do it with
             care, so that items are not leaked.
         \endlist
 
         You can also push an array of items (property lists) if you need to push several items
         in one go. A transition will then only occur between the current item and the last
-        item in the list. The other items will be deferred loaded until needed.
+        item in the list. Loading the other items will be deferred until needed.
 
         Examples:
         \list
@@ -524,8 +525,8 @@ Item {
         \li stackView.push([{item:anitem, immediate:true}, {item:aURL}])
         \endlist
 
-        Note: If the only argument needed is "item", you can also, as a short-hand
-        notation, do: \c{stackView.push(anItem)}.
+        \note Note: if the only argument needed is "item", you can apply the following short-
+        hand notation: \c{stackView.push(anItem)}.
 
         Returns the item that became current.
 
@@ -581,11 +582,11 @@ Item {
     /*! Pops one or more items off the stack. The function takes a property list as argument
         which can contain one or more of the following properties:
         \list
-        \li \c item: If specified, all items down to (but not including) \a item will be
-            popped off. if \a item is \c null, all items down to (but not including) the
+        \li \c item: if specified, all items down to (but not including) \a item will be
+            popped off. If \a item is \c null, all items down to (but not including) the
             first item will be popped. If not specified, only the current item will be
             popped.
-        \li \c immediate: Set this property to \c true to skip transition effects.
+        \li \c immediate: set this property to \c true to skip transition effects.
         \endlist
 
         Examples:
@@ -596,8 +597,8 @@ Item {
         \li stackView.pop(null)
         \endlist
 
-        Note: If the only argument needed is "item", you can also, as a short-hand
-        notation, do: \c{stackView.pop(anItem)}.
+        \note Note: If the only argument needed is "item", you can apply the following short-
+        hand notation: \c{stackView.pop(anItem)}.
 
         Returns the item that was popped off
         \sa clear()
@@ -668,7 +669,8 @@ Item {
 
     /*! Search for a specific item inside the stack. \a func will
         be called for each item in the stack (with the item as argument)
-        until the function returns true. Return value will be the item found. E.g:
+        until the function returns true. Return value will be the item found. For
+        example:
         find(function(item, index) { return item.isTheOne })
         Set \a onlySearchLoadedItems to \c true to not load items that are
         not loaded into memory */
@@ -794,7 +796,7 @@ Item {
                     element.destroyOnPop = true
             }
         } else {
-            // comp is already an Item, so just reparent it into the StackView:
+            // comp is already an Item, so just re-parent it into the StackView:
             element.item = comp
             element.originalParent = parent
             element.item.parent = root
@@ -844,7 +846,7 @@ Item {
     /*! \internal */
     function __cleanup(element) {
         // INVARIANT: element has been removed from JSArray. Destroy its
-        // item, or reparent it back to the parent it had before it was pushed:
+        // item, or re-parent it back to the parent it had before it was pushed:
         var item = element.item
         if (element.destroyOnPop) {
             item.destroy()
@@ -871,7 +873,7 @@ Item {
         // Animate item in "outElement" out, and item in "inElement" in. Set a guard to protect
         // the user from pushing new items on signals that will fire while preparing for the transition
         // (e.g Stack.onCompleted, Stack.onStatusChanged, Stack.onIndexChanged etc). Otherwise, we will enter
-        // this function several times, which causes the items to be half-way updated.
+        // this function several times, which causes the items to be updated half-way.
         if (__currentTransition)
             __currentTransition.animation.complete()
         __loadElement(transition.inElement)
diff --git a/src/controls/TableView.qml b/src/controls/TableView.qml
index 17b2b186338bab927b68d2f7ffdd881de3423019..6f05d605b7561d161dae6efe1cb486c362fe3c59 100644
--- a/src/controls/TableView.qml
+++ b/src/controls/TableView.qml
@@ -239,10 +239,30 @@ ScrollView {
     /*! \internal */
     property alias __currentRowItem: listView.currentItem
 
-    /*! \qmlsignal TableView::activated()
-        Emitted when the user activates an item by single or double-clicking (depending on the platform).
+    /*! \qmlsignal TableView::activated(int row)
+
+        Emitted when the user activates an item by mouse or keyboard interaction.
+        Mouse activation is triggered by single- or double-clicking, depending on the platform.
+
+        \a row int provides access to the activated row index.
+    */
+    signal activated(int row)
+
+    /*! \qmlsignal TableView::clicked(int row)
+
+        Emitted when the user clicks a valid row by single clicking
+
+        \a row int provides access to the clicked row index.
+    */
+    signal clicked(int row)
+
+    /*! \qmlsignal TableView::doubleClicked(int row)
+
+        Emitted when the user double clicks a valid row.
+
+        \a row int provides access to the clicked row index.
     */
-    signal activated
+    signal doubleClicked(int row)
 
     /*!
         \qmlmethod TableView::positionViewAtRow( int row, PositionMode mode )
@@ -274,7 +294,7 @@ ScrollView {
     */
 
     function positionViewAtRow(row, mode) {
-        listView.positionViewAtRow(row, mode)
+        listView.positionViewAtIndex(row, mode)
     }
 
     /*!
@@ -447,28 +467,39 @@ ScrollView {
                     autoincrement = false;
                     autodecrement = false;
                 }
-                var y = Math.min(listView.contentY + listView.height - 5, Math.max(mouseY + listView.contentY, listView.contentY));
-                var newIndex = listView.indexAt(0, y);
-                if (newIndex >= 0)
-                    listView.currentIndex = listView.indexAt(0, y);
+
+                if (pressed) {
+                    var newIndex = listView.indexAt(0, mouseY + listView.contentY)
+                    if (newIndex >= 0)
+                        listView.currentIndex = newIndex;
+                }
             }
 
             onClicked: {
-                if (root.__activateItemOnSingleClick)
-                    root.activated()
+                var clickIndex = listView.indexAt(0, mouseY + listView.contentY)
+                if (clickIndex > -1) {
+                    if (root.__activateItemOnSingleClick)
+                        root.activated(clickIndex)
+                    root.clicked(clickIndex)
+                }
                 mouse.accepted = false
             }
 
             onPressed: {
+                var newIndex = listView.indexAt(0, mouseY + listView.contentY)
                 listView.forceActiveFocus()
-                var x = Math.min(listView.contentWidth - 5, Math.max(mouseX + listView.contentX, 0))
-                var y = Math.min(listView.contentHeight - 5, Math.max(mouseY + listView.contentY, 0))
-                listView.currentIndex = listView.indexAt(x, y)
+                if (newIndex > -1) {
+                    listView.currentIndex = newIndex
+                }
             }
 
             onDoubleClicked: {
-                if (!root.__activateItemOnSingleClick)
-                    root.activated()
+                var clickIndex = listView.indexAt(0, mouseY + listView.contentY)
+                if (clickIndex > -1) {
+                    if (!root.__activateItemOnSingleClick)
+                        root.activated(clickIndex)
+                    root.doubleClicked(clickIndex)
+                }
             }
 
             // Note:  with boolean preventStealing we are keeping the flickable from
@@ -511,8 +542,15 @@ ScrollView {
         highlightFollowsCurrentItem: true
         model: root.model
 
-        Keys.onUpPressed: root.__decrementCurrentIndex()
-        Keys.onDownPressed: root.__incrementCurrentIndex()
+        Keys.onUpPressed: {
+            event.accepted = false
+            root.__decrementCurrentIndex()
+        }
+
+        Keys.onDownPressed: {
+            event.accepted = false
+            root.__incrementCurrentIndex()
+        }
 
         Keys.onPressed: {
             if (event.key === Qt.Key_PageUp) {
@@ -521,7 +559,11 @@ ScrollView {
                 verticalScrollBar.value = __verticalScrollBar.value + listView.height
         }
 
-        Keys.onReturnPressed: root.activated();
+        Keys.onReturnPressed: {
+            event.accepted = false
+            if (currentRow > -1)
+                root.activated(currentRow);
+        }
 
         delegate: Item {
             id: rowitem
diff --git a/src/layouts/doc/images/rowlayout-minimum.png b/src/layouts/doc/images/rowlayout-minimum.png
new file mode 100644
index 0000000000000000000000000000000000000000..5875325c5435686b8a7854bc3f5efe0799ed87f6
Binary files /dev/null and b/src/layouts/doc/images/rowlayout-minimum.png differ
diff --git a/src/layouts/doc/qtquicklayouts.qdocconf b/src/layouts/doc/qtquicklayouts.qdocconf
index ad33416f8c53a3673bc77f4ce7f43f291dcdd7cc..a13066b889c0a433ed191ab7a227f7473ab45696 100644
--- a/src/layouts/doc/qtquicklayouts.qdocconf
+++ b/src/layouts/doc/qtquicklayouts.qdocconf
@@ -26,6 +26,8 @@ qhp.QtQuickLayouts.subprojects.qtquicklayoutsqmltypes.type = manual
 
 depends = qtqml qtquick qtwidgets qtdoc qtquickcontrols
 
+exampledirs += src/snippets
+
 headerdirs += ..
 
 sourcedirs += ..
diff --git a/src/layouts/doc/src/qtquicklayouts-index.qdoc b/src/layouts/doc/src/qtquicklayouts-index.qdoc
index c2280f5df638710f21747bc8053f7e1a077f3152..fb9c3898c01c7d1111e72b0160ac2918c70f52b6 100644
--- a/src/layouts/doc/src/qtquicklayouts-index.qdoc
+++ b/src/layouts/doc/src/qtquicklayouts-index.qdoc
@@ -52,6 +52,16 @@
 
     \section1 Related information
 
+    \section2 Guides
+     \list
+      \li \l{Qt Quick Layouts Overview}
+     \endlist
+
+    \section2 Examples
+     \list
+      \li \l{Qt Quick Controls - Basic Layouts Example}
+     \endlist
+
     \section2 Reference
      \list
       \li \l{Qt Quick Layouts QML Types}{Qt Quick Layouts QML Types}
diff --git a/src/layouts/doc/src/qtquicklayouts-overview.qdoc b/src/layouts/doc/src/qtquicklayouts-overview.qdoc
new file mode 100644
index 0000000000000000000000000000000000000000..b7302dad10d4dde83bf71b34acba41c184fdd2d4
--- /dev/null
+++ b/src/layouts/doc/src/qtquicklayouts-overview.qdoc
@@ -0,0 +1,128 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:FDL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia.  For licensing terms and
+** conditions see http://qt.digia.com/licensing.  For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Free Documentation License Usage
+** Alternatively, this file may be used under the terms of the GNU Free
+** Documentation License version 1.3 as published by the Free Software
+** Foundation and appearing in the file included in the packaging of
+** this file.  Please review the following information to ensure
+** the GNU Free Documentation License version 1.3 requirements
+** will be met: http://www.gnu.org/copyleft/fdl.html.
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+/*!
+    \page qtquicklayouts-overview.html
+    \title Qt Quick Layouts Overview
+    \brief A set of APIs for arranging QML items in a user interface.
+
+    Qt Quick Layouts are items that are used to arrange items in a user interface. Since Qt Quick
+    Layouts also resize their items, they are well suited for resizable user interfaces.
+
+
+    \section1 Key Features
+
+
+    Some of the key features are:
+
+    \list
+        \li \l{Layout::alignment}{Alignment} of items can be specified with the
+            \l{Layout::alignment}{Layout.alignment} property
+        \li \l{Layout::fillWidth}{Resizable items} can be specified with the
+            \l{Layout::fillWidth}{Layout.fillWidth} and \l{Layout::fillHeight}{Layout.fillHeight}
+            properties.
+        \li \l{Size constraints} can be specified with
+            \l{Layout::minimumWidth}{Layout.minimumWidth},
+            \l{Layout::preferredWidth}{Layout.preferredWidth}, and
+            \l{Layout::maximumWidth}{Layout.maximumWidth}  properties ("Width" can be replaced
+            with "Height" for specifying similar constraints to the height).
+        \li \l{RowLayout::spacing}{Spacings} can be specified with \l{RowLayout::spacing}{spacing},
+            \l{GridLayout::rowSpacing}{rowSpacing} or \l{GridLayout::columnSpacing}{columnSpacing}
+    \endlist
+
+    In addition to the above features, GridLayout adds these features:
+    \list
+        \li \l{Layout::row}{Grid coordinates} can be specified with the \l{Layout::row}{Layout.row} and
+            \l{Layout::column}{Layout.column}.
+        \li \l{GridLayout::flow}{Automatic grid coordinates} used together with the
+            \l{GridLayout::flow}{flow}, \l{GridLayout::rows}{rows}, and
+            \l{GridLayout::columns}{columns} properties.
+        \li \l{Layout::columnSpan}{Spans} across rows or columns can be specified with the
+            \l{Layout::rowSpan}{Layout.rowSpan} and \l{Layout::columnSpan}{Layout.columnSpan}
+            properties.
+    \endlist
+
+
+
+    \section1 Size Constraints
+    Since an item can be resized by its layout, the layout needs to know the
+    \l{Layout::minimumWidth}{minimum}, \l{Layout::preferredWidth}{preferred},
+    and \l{Layout::maximumWidth}{maximum} sizes of all items where \l{Layout::fillWidth}{Layout.fillWidth} or
+    \l{Layout::fillHeight}{Layout.fillHeight} is set to \c true.
+    For instance, the following will produce a layout with two rectangles lying side-by-side that
+    stretches horizontally. The azure rectangle can be resized from 50x150 to 300x150, and the plum
+    rectangle can be resized from 100x100 to ∞x100.
+
+    \snippet windowconstraints.qml rowlayout
+
+    \image rowlayout-minimum.png "RowLayout at its minimum"
+
+    Combining each item's constraints will give these implicit constraints to the layout element:
+
+    \table
+    \header
+        \li
+        \li minimum
+        \li preferred
+        \li maximum
+    \row
+        \li implicit constraints (width)
+        \li 156
+        \li 306
+        \li ∞ (\c Number.POSITIVE_INFINITY)
+    \row
+        \li implicit constraints (heights)
+        \li 150
+        \li 150
+        \li 150
+    \endtable
+
+    Thus, the layout cannot be narrower than 156 or be taller or shorter than 150 without breaking
+    any of the constraints of its child items.
+
+    \section1 Connecting windows and layouts
+    You can just use normal anchoring concepts to ensure that the layout will follow the window
+    resizing.
+
+    \snippet windowconstraints.qml anchoring
+
+    The size constraints of layouts can be used to ensure that the window cannot be resized beyond
+    the layout constraints. You can take the size constraints from the layout and set these
+    constraints on the minimumWidth, minimumHeight, maximumWidth, and maximumHeight of the Window
+    element. The following code ensures that the window cannot be resized beyond the constraints of
+    the layout:
+
+    \snippet windowconstraints.qml bindconstraints
+
+    \note Since layout.Layout.maximumWidth is infinite in this case, we cannot bind that to the
+    maximumWidth property of Window, since that is an integer number. We therefore set a fixed
+    maximum width to 1000.
+
+    Finally, you usually want the initial size of the window to be the layout's implicit size:
+
+    \snippet windowconstraints.qml binddefaultsize
+*/
diff --git a/src/layouts/doc/src/snippets/windowconstraints.qml b/src/layouts/doc/src/snippets/windowconstraints.qml
new file mode 100644
index 0000000000000000000000000000000000000000..673169a3a85f805d2b39b3f3b25d1798c4a8e1e6
--- /dev/null
+++ b/src/layouts/doc/src/snippets/windowconstraints.qml
@@ -0,0 +1,89 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the documentation of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtQuick.Controls 1.0
+import QtQuick.Layouts 1.0
+
+ApplicationWindow {
+    //! [binddefaultsize]
+    width: layout.implicitWidth
+    height: layout.implicitHeight
+    //! [binddefaultsize]
+    //! [bindconstraints]
+    minimumWidth: layout.Layout.minimumWidth
+    minimumHeight: layout.Layout.minimumHeight
+    maximumWidth: 1000
+    maximumHeight: layout.Layout.maximumHeight
+    //! [bindconstraints]
+
+    //! [rowlayout]
+    //! [anchoring]
+    RowLayout {
+        id: layout
+        anchors.fill: parent
+    //! [anchoring]
+        spacing: 6
+        Rectangle {
+            color: 'azure'
+            Layout.fillWidth: true
+            Layout.minimumWidth: 50
+            Layout.preferredWidth: 100
+            Layout.maximumWidth: 300
+            Layout.minimumHeight: 150
+            Text {
+                anchors.centerIn: parent
+                text: parent.width + 'x' + parent.height
+            }
+        }
+        Rectangle {
+            color: 'plum'
+            Layout.fillWidth: true
+            Layout.minimumWidth: 100
+            Layout.preferredWidth: 200
+            Layout.preferredHeight: 100
+            Text {
+                anchors.centerIn: parent
+                text: parent.width + 'x' + parent.height
+            }
+        }
+    }
+    //! [rowlayout]
+}
diff --git a/src/private/TabBar.qml b/src/private/TabBar.qml
index 6bcf795cc96ad39b21d378069efeec8ecf9b8f9a..f51d60b2de7a236f77b21dce23ba67a4a9f57bae 100644
--- a/src/private/TabBar.qml
+++ b/src/private/TabBar.qml
@@ -183,8 +183,6 @@ FocusScope {
                 var next = tabbar.nextItemInFocusChain(true);
                 if (__isAncestorOf(tabView.getTab(currentIndex), next))
                     next.forceActiveFocus();
-                else
-                    tabitem.forceActiveFocus();
             }
 
             Loader {
diff --git a/tests/auto/controls/data/tableview/table_activated.qml b/tests/auto/controls/data/tableview/table_activated.qml
index 52d420c499da83511c1b6c0bdc272493ee549ca4..227fbd885eb98449f8d2bdfc22cb46a1607cbec5 100644
--- a/tests/auto/controls/data/tableview/table_activated.qml
+++ b/tests/auto/controls/data/tableview/table_activated.qml
@@ -42,11 +42,22 @@ import QtQuick 2.1
 import QtQuick.Controls 1.0
 
 TableView {
-    height: 70
+    height: 120
     model: 10
 
-    property bool test: false
-    onActivated: test = true
+    headerVisible: false
+    frameVisible: false
+    rowDelegate: Rectangle {
+        width: parent.width
+        height: 20
+    }
+
+    property int test: -1
+    property int testClick: -1
+    property int testDoubleClick: -1
+    onActivated: test = row
+    onClicked: testClick = row
+    onDoubleClicked: testDoubleClick = row
 
     TableViewColumn {
         width: 100
diff --git a/tests/auto/controls/data/tst_tableview.qml b/tests/auto/controls/data/tst_tableview.qml
index 8763900eff22ad510359f3eb6ae1f816c083cd2c..a54bbdcb333359cdb91c421dc8bce754f2eb942d 100644
--- a/tests/auto/controls/data/tst_tableview.qml
+++ b/tests/auto/controls/data/tst_tableview.qml
@@ -198,12 +198,27 @@ TestCase {
         var table = component.createObject(container);
         verify(table !== null, "table created is null")
         table.forceActiveFocus();
-        compare(table.test, false)
+        compare(table.test, -1)
+        compare(table.testClick, table.currentRow)
+
+        if (!table.__activateItemOnSingleClick)
+            mouseDoubleClick(table, 15 , 45, Qt.LeftButton)
+        else
+            mouseClick(table, 15, 45, Qt.LeftButton)
+
+        compare(table.testDoubleClick, table.currentRow)
+        compare(table.test, table.currentRow)
+        compare(table.testClick, table.currentRow)
+
         if (!table.__activateItemOnSingleClick)
             mouseDoubleClick(table, 15 , 15, Qt.LeftButton)
         else
             mouseClick(table, 15, 15, Qt.LeftButton)
-        compare(table.test, true)
+
+        compare(table.testDoubleClick, table.currentRow)
+        compare(table.testClick, table.currentRow)
+        compare(table.test, table.currentRow)
+
         table.destroy()
     }
 
@@ -214,6 +229,7 @@ TestCase {
         verify(table !== null, "table created is null")
         table.forceActiveFocus();
         compare(table.activatedTest, false)
+        waitForRendering(table)
         if (!table.__activateItemOnSingleClick)
             mouseDoubleClick(table, 15 , 50, Qt.LeftButton)
         else
@@ -379,6 +395,39 @@ TestCase {
         tableView.destroy()
     }
 
+    function test_positionViewAtRow() {
+        var test_instanceStr =
+           'import QtQuick 2.1;             \
+            import QtQuick.Controls 1.0;    \
+            TableView {                     \
+                TableViewColumn {           \
+                }                           \
+                model: 1000;                \
+                headerVisible: false;       \
+            }'
+
+        var table = Qt.createQmlObject(test_instanceStr, testCase, '')
+        waitForRendering(table)
+
+        var beginPos = table.mapFromItem(table.viewport, 0, 0)
+
+        table.positionViewAtRow(0, ListView.Beginning)
+        compare(table.rowAt(beginPos.x, beginPos.y), 0)
+
+        table.positionViewAtRow(100, ListView.Beginning)
+        compare(table.rowAt(beginPos.x, beginPos.y), 100)
+
+        var endPos = table.mapFromItem(table.viewport, 0, table.viewport.height - 1)
+
+        table.positionViewAtRow(900, ListView.End)
+        compare(table.rowAt(endPos.x, endPos.y), 900)
+
+        table.positionViewAtRow(999, ListView.End)
+        compare(table.rowAt(endPos.x, endPos.y), 999)
+
+        table.destroy()
+    }
+
     // In TableView, drawn text = table.__currentRowItem.children[1].children[1].itemAt(0).children[0].children[0].text
 
     function findAChild(item, name)
diff --git a/tests/auto/controls/data/tst_tabview.qml b/tests/auto/controls/data/tst_tabview.qml
index 85ad4346b670f9b4ae4010e51e862c0448d536c6..8093ebc3746b3c15e8689889e357f1f02f68c886 100644
--- a/tests/auto/controls/data/tst_tabview.qml
+++ b/tests/auto/controls/data/tst_tabview.qml
@@ -365,7 +365,7 @@ TestCase {
 
         waitForRendering(tab3)
         mouseClick(tab3, tab3.width/2, tab3.height/2)
-        verify(tab3.activeFocus)
+        verify(!tab3.activeFocus)
         verify(!textField.activeFocus)
 
         tabView.destroy()