Source

Target

Commits (26)
Showing with 423 additions and 356 deletions
...@@ -180,6 +180,14 @@ Item { ...@@ -180,6 +180,14 @@ Item {
height: parent.height - group1.height - group2.height - 2 * parent.spacing height: parent.height - group1.height - group2.height - 2 * parent.spacing
anchors { right: parent.right } anchors { right: parent.right }
} }
MouseArea {
id: contextMenu
parent: area.viewport
anchors.fill: parent
acceptedButtons: Qt.RightButton
onPressed: editmenu.popup()
}
} }
} }
} }
...@@ -76,7 +76,6 @@ Item { ...@@ -76,7 +76,6 @@ Item {
GridLayout { GridLayout {
id: gridLayout id: gridLayout
anchors.fill: parent anchors.fill: parent
anchors.margins: 4
rows: 3 rows: 3
flow: GridLayout.TopToBottom flow: GridLayout.TopToBottom
......
...@@ -45,127 +45,132 @@ ...@@ -45,127 +45,132 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Controls.Styles 1.0 import QtQuick.Controls.Styles 1.0
import QtQuick.Dialogs 1.0 import QtQuick.Layouts 1.0
Item { Item {
id: root id: root
width: 300 width: 300
height: 200 height: 200
ColorDialog { property int columnWidth: 120
id: colorDialog GridLayout {
color: "#afe" rowSpacing: 12
property color last: "#afe" columnSpacing: 30
onRejected: color = last
onVisibleChanged: if (visible) last = color
}
Column {
anchors.margins: 20
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
spacing: 20 anchors.horizontalCenter: parent.horizontalCenter
anchors.margins: 30
Row { Button {
spacing: 8 text: "Push me"
Button { style: ButtonStyle { }
text: "Set color…" onClicked: colorDialog.open()
style: ButtonStyle { } implicitWidth: columnWidth
onClicked: colorDialog.open()
}
Button {
text: "Push me"
style: ButtonStyle { }
}
Button {
text: "Push me"
style: buttonStyle
}
} }
Row { Button {
spacing: 8 text: "Push me"
TextField { style: ButtonStyle { }
style: TextFieldStyle { } implicitWidth: columnWidth
} }
TextField { Button {
style: TextFieldStyle { } text: "Push me"
} style: buttonStyle
TextField { implicitWidth: columnWidth
style: textfieldStyle
}
} }
Row { TextField {
spacing: 8 Layout.row: 1
Slider { style: TextFieldStyle { }
value: 50 implicitWidth: columnWidth
maximumValue: 100 }
width: 100 TextField {
style: SliderStyle { } style: TextFieldStyle { }
} implicitWidth: columnWidth
Slider { }
value: 50 TextField {
maximumValue: 100 style: textfieldStyle
width: 100 implicitWidth: columnWidth
style: SliderStyle { }
}
Slider {
value: 50
maximumValue: 100
width: 100
style: sliderStyle
}
} }
Row { Slider {
spacing: 8 Layout.row: 2
ProgressBar { value: 50
value: 50 maximumValue: 100
maximumValue: 100 implicitWidth: columnWidth
width: 100 style: SliderStyle { }
style: ProgressBarStyle{ } }
} Slider {
ProgressBar { value: 50
value: 50 maximumValue: 100
maximumValue: 100 implicitWidth: columnWidth
width: 100 style: SliderStyle { }
style: ProgressBarStyle{ } }
} Slider {
ProgressBar { value: 50
value: 50 maximumValue: 100
maximumValue: 100 implicitWidth: columnWidth
width: 100 style: sliderStyle
style: progressbarStyle
}
} }
Row { ProgressBar {
spacing: 8 Layout.row: 3
CheckBox { value: 50
text: "CheckBox" maximumValue: 100
style: CheckBoxStyle{} implicitWidth: columnWidth
} style: ProgressBarStyle{ }
RadioButton { }
style: RadioButtonStyle{} ProgressBar {
text: "RadioButton" value: 50
} maximumValue: 100
implicitWidth: columnWidth
style: ProgressBarStyle{ }
}
ProgressBar {
value: 50
maximumValue: 100
implicitWidth: columnWidth
style: progressbarStyle
}
ComboBox { CheckBox {
model: ["Paris", "Oslo", "New York"] text: "CheckBox"
style: ComboBoxStyle{} style: CheckBoxStyle{}
} Layout.row: 4
implicitWidth: columnWidth
}
RadioButton {
style: RadioButtonStyle{}
text: "RadioButton"
implicitWidth: columnWidth
} }
Row { ComboBox {
TabView { model: ["Paris", "Oslo", "New York"]
width: 400 style: ComboBoxStyle{}
height: 30 implicitWidth: columnWidth
Tab { title: "One" ; Item {}} }
Tab { title: "Two" ; Item {}}
Tab { title: "Three" ; Item {}} TabView {
Tab { title: "Four" ; Item {}} Layout.row: 5
style: tabViewStyle Layout.columnSpan: 3
} Layout.fillWidth: true
implicitHeight: 30
Tab { title: "One" ; Item {}}
Tab { title: "Two" ; Item {}}
Tab { title: "Three" ; Item {}}
Tab { title: "Four" ; Item {}}
style: TabViewStyle {}
}
TabView {
Layout.row: 6
Layout.columnSpan: 3
Layout.fillWidth: true
implicitHeight: 30
Tab { title: "One" ; Item {}}
Tab { title: "Two" ; Item {}}
Tab { title: "Three" ; Item {}}
Tab { title: "Four" ; Item {}}
style: tabViewStyle
} }
} }
...@@ -174,7 +179,7 @@ Item { ...@@ -174,7 +179,7 @@ Item {
property Component buttonStyle: ButtonStyle { property Component buttonStyle: ButtonStyle {
background: Rectangle { background: Rectangle {
implicitHeight: 20 implicitHeight: 20
implicitWidth: 100 implicitWidth: columnWidth
color: control.pressed ? "darkGray" : "lightGray" color: control.pressed ? "darkGray" : "lightGray"
antialiasing: true antialiasing: true
border.color: "gray" border.color: "gray"
...@@ -184,7 +189,7 @@ Item { ...@@ -184,7 +189,7 @@ Item {
property Component textfieldStyle: TextFieldStyle { property Component textfieldStyle: TextFieldStyle {
background: Rectangle { background: Rectangle {
implicitWidth: 100 implicitWidth: columnWidth
implicitHeight: 20 implicitHeight: 20
color: "#f0f0f0" color: "#f0f0f0"
antialiasing: true antialiasing: true
...@@ -205,7 +210,7 @@ Item { ...@@ -205,7 +210,7 @@ Item {
groove: Rectangle { groove: Rectangle {
height: 8 height: 8
implicitWidth: 100 implicitWidth: columnWidth
implicitHeight: 20 implicitHeight: 20
antialiasing: true antialiasing: true
...@@ -217,7 +222,7 @@ Item { ...@@ -217,7 +222,7 @@ Item {
property Component progressbarStyle: ProgressBarStyle { property Component progressbarStyle: ProgressBarStyle {
background: Rectangle { background: Rectangle {
implicitWidth: 100 implicitWidth: columnWidth
implicitHeight: 20 implicitHeight: 20
color: "#f0f0f0" color: "#f0f0f0"
border.color: "gray" border.color: "gray"
...@@ -225,7 +230,7 @@ Item { ...@@ -225,7 +230,7 @@ Item {
radius: height/2 radius: height/2
} }
progress: Rectangle { progress: Rectangle {
implicitWidth: 100 implicitWidth: columnWidth
implicitHeight: 20 implicitHeight: 20
color: "#c0c0c0" color: "#c0c0c0"
border.color: "gray" border.color: "gray"
...@@ -246,18 +251,18 @@ Item { ...@@ -246,18 +251,18 @@ Item {
} }
border.color: "#898989" border.color: "#898989"
Rectangle { anchors.fill: parent ; anchors.margins: 1 ; border.color: "white" ; color: "transparent" } Rectangle { anchors.fill: parent ; anchors.margins: 1 ; border.color: "white" ; color: "transparent" }
} }
tab: Item { tab: Item {
implicitWidth: image.sourceSize.width property int totalOverlap: tabOverlap * (control.count - 1)
implicitWidth: Math.min ((styleData.availableWidth + totalOverlap)/control.count - 4, image.sourceSize.width)
implicitHeight: image.sourceSize.height implicitHeight: image.sourceSize.height
BorderImage { BorderImage {
id: image id: image
anchors.fill: parent anchors.fill: parent
source: styleData.selected ? "../images/tab_selected.png" : "../images/tab.png" source: styleData.selected ? "../images/tab_selected.png" : "../images/tab.png"
border.left: 50 border.left: 30
smooth: false smooth: false
border.right: 50 border.right: 30
} }
Text { Text {
text: styleData.title text: styleData.title
......
...@@ -51,10 +51,11 @@ import "content" ...@@ -51,10 +51,11 @@ import "content"
ApplicationWindow { ApplicationWindow {
title: "Component Gallery" title: "Component Gallery"
width: 580 width: 600
height: 400 height: 400
minimumHeight: 400 minimumHeight: 400
minimumWidth: 340 minimumWidth: 570
property string loremIpsum: property string loremIpsum:
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+ "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor "+
...@@ -69,150 +70,112 @@ ApplicationWindow { ...@@ -69,150 +70,112 @@ ApplicationWindow {
onAccepted: imageViewer.open(fileUrl) onAccepted: imageViewer.open(fileUrl)
} }
toolBar: ToolBar { Action {
id: toolbar id: openAction
RowLayout { text: "&Open"
spacing: 2 shortcut: "Ctrl+O"
anchors.verticalCenter: parent.verticalCenter iconSource: "images/document-open.png"
ToolButton { onTriggered: fileDialog.open()
iconSource: "images/window-new.png" tooltip: "open an image"
anchors.verticalCenter: parent.verticalCenter }
onClicked: window1.visible = !window1.visible
Accessible.name: "New window"
tooltip: "Toggle visibility of the second window"
}
ToolButton {
action: openAction
}
ToolButton {
iconSource: "images/document-save-as.png"
anchors.verticalCenter: parent.verticalCenter
tooltip: "(Pretend to) save as..."
}
}
ChildWindow { id: window1 } Action {
id: copyAction
text: "&Copy"
shortcut: "Ctrl+C"
iconName: "edit-copy"
enabled: (!!activeFocusItem && !!activeFocusItem["copy"])
onTriggered: activeFocusItem.copy()
}
Action { Action {
id: openAction id: cutAction
text: "&Open" text: "Cu&t"
shortcut: "Ctrl+O" shortcut: "Ctrl+X"
iconSource: "images/document-open.png" iconName: "edit-cut"
onTriggered: fileDialog.open() enabled: (!!activeFocusItem && !!activeFocusItem["cut"])
tooltip: "open an image" onTriggered: activeFocusItem.cut()
} }
Action {
id: pasteAction
text: "&Paste"
shortcut: "Ctrl+V"
iconName: "edit-paste"
enabled: (!!activeFocusItem && !!activeFocusItem["paste"])
onTriggered: activeFocusItem.paste()
}
ExclusiveGroup {
id: textFormatGroup
Action { Action {
id: copyAction id: a1
text: "&Copy" text: "Align Left"
shortcut: "Ctrl+C" checkable: true
iconName: "edit-copy" Component.onCompleted: checked = true
enabled: (!!activeFocusItem && !!activeFocusItem["copy"])
onTriggered: activeFocusItem.copy()
} }
Action { Action {
id: cutAction id: a2
text: "Cu&t" text: "Center"
shortcut: "Ctrl+X" checkable: true
iconName: "edit-cut"
enabled: (!!activeFocusItem && !!activeFocusItem["cut"])
onTriggered: activeFocusItem.cut()
} }
Action { Action {
id: pasteAction id: a3
text: "&Paste" text: "Align Right"
shortcut: "Ctrl+V" checkable: true
iconName: "edit-paste"
enabled: (!!activeFocusItem && !!activeFocusItem["paste"])
onTriggered: activeFocusItem.paste()
} }
}
ExclusiveGroup { ChildWindow { id: window1 }
id: textFormatGroup
Action {
id: a1
text: "Align Left"
checkable: true
Component.onCompleted: checked = true
}
Action {
id: a2
text: "Center"
checkable: true
}
Action {
id: a3
text: "Align Right"
checkable: true
}
}
Menu {
id: editmenu
MenuItem { action: cutAction }
MenuItem { action: copyAction }
MenuItem { action: pasteAction }
MenuSeparator {}
Menu { Menu {
id: editmenu title: "Text Format"
MenuItem { action: cutAction } MenuItem { action: a1 }
MenuItem { action: copyAction } MenuItem { action: a2 }
MenuItem { action: pasteAction } MenuItem { action: a3 }
MenuSeparator {} MenuSeparator { }
Menu { MenuItem { text: "Allow Hyphenation"; checkable: true }
title: "Text Format"
MenuItem { action: a1 }
MenuItem { action: a2 }
MenuItem { action: a3 }
MenuSeparator { }
MenuItem { text: "Allow Hyphenation"; checkable: true }
MenuSeparator { }
Menu {
title: "More Stuff"
MenuItem { action: cutAction }
MenuItem { action: copyAction }
MenuItem { action: pasteAction }
MenuSeparator { }
Menu {
title: "More Stuff"
MenuItem { action: cutAction }
MenuItem { action: copyAction }
MenuItem { action: pasteAction }
MenuSeparator { }
Menu {
title: "More Stuff"
MenuItem { action: cutAction }
MenuItem { action: copyAction }
MenuItem { action: pasteAction }
MenuSeparator { }
Menu {
title: "More Stuff"
MenuItem { action: cutAction }
MenuItem { action: copyAction }
MenuItem { action: pasteAction }
}
}
}
}
}
Menu {
title: "Font Style"
MenuItem { text: "Bold"; checkable: true }
MenuItem { text: "Italic"; checkable: true }
MenuItem { text: "Underline"; checkable: true }
}
} }
MouseArea { Menu {
anchors.fill: parent title: "Font Style"
acceptedButtons: Qt.RightButton MenuItem { text: "Bold"; checkable: true }
onPressed: editmenu.popup() MenuItem { text: "Italic"; checkable: true }
MenuItem { text: "Underline"; checkable: true }
} }
}
CheckBox { toolBar: ToolBar {
id: enabledCheck id: toolbar
text: "Enabled" RowLayout {
checked: true id: toolbarLayout
anchors.right: parent.right spacing: 0
anchors.verticalCenter: parent.verticalCenter width: parent.width
ToolButton {
iconSource: "images/window-new.png"
onClicked: window1.visible = !window1.visible
Accessible.name: "New window"
tooltip: "Toggle visibility of the second window"
}
ToolButton { action: openAction }
ToolButton {
iconSource: "images/document-save-as.png"
tooltip: "(Pretend to) save as..."
}
Item { Layout.fillWidth: true }
CheckBox {
id: enabledCheck
text: "Enabled"
checked: true
}
} }
} }
......
...@@ -61,14 +61,6 @@ ApplicationWindow { ...@@ -61,14 +61,6 @@ ApplicationWindow {
color: "lightsteelblue" color: "lightsteelblue"
} }
Rectangle {
id: column1
width: 200
Layout.minimumWidth: 100
Layout.maximumWidth: 300
color: "lightsteelblue"
}
SplitView { SplitView {
orientation: Qt.Vertical orientation: Qt.Vertical
Layout.fillWidth: true Layout.fillWidth: true
......
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the Qt Quick Controls module 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.1
Item {
width: 8
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.margins: 6
Rectangle {
width: 1
height: parent.height
anchors.horizontalCenter: parent.horizontalCenter
color: "#22000000"
}
Rectangle {
width: 1
height: parent.height
anchors.horizontalCenterOffset: 1
anchors.horizontalCenter: parent.horizontalCenter
color: "#33ffffff"
}
}
...@@ -42,6 +42,7 @@ import QtQuick 2.1 ...@@ -42,6 +42,7 @@ import QtQuick 2.1
import QtQuick.Controls 1.0 import QtQuick.Controls 1.0
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import QtQuick.Dialogs 1.0 import QtQuick.Dialogs 1.0
import QtQuick.Window 2.1
import org.qtproject.example 1.0 import org.qtproject.example 1.0
ApplicationWindow { ApplicationWindow {
...@@ -52,6 +53,37 @@ ApplicationWindow { ...@@ -52,6 +53,37 @@ ApplicationWindow {
title: document.documentTitle + " - Text Editor Example" title: document.documentTitle + " - Text Editor Example"
ApplicationWindow {
id: aboutBox
width: 280
height: 120
title: "About Text"
ColumnLayout {
anchors.fill: parent
anchors.margins: 8
Item {
Layout.fillWidth: true
Layout.fillHeight: true
Label {
anchors.centerIn: parent
horizontalAlignment: Text.AlignHCenter
text: "This is a basic text editor \nwritten with Qt Quick Controls"
}
}
Button {
text: "Ok"
isDefault: true
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
onClicked: aboutBox.close()
}
Keys.onReturnPressed: aboutBox.close()
focus: true
}
}
Action { Action {
id: cut id: cut
text: "Cut" text: "Cut"
...@@ -142,12 +174,6 @@ ApplicationWindow { ...@@ -142,12 +174,6 @@ ApplicationWindow {
checkable: true checkable: true
checked: document.underline checked: document.underline
} }
Action {
id: color
text: "&Color ..."
iconSource: "images/textcolor.png"
iconName: "format-text-color"
}
FileDialog { FileDialog {
id: file id: file
...@@ -185,13 +211,10 @@ ApplicationWindow { ...@@ -185,13 +211,10 @@ ApplicationWindow {
MenuItem { action: alignCenter } MenuItem { action: alignCenter }
MenuItem { action: alignRight } MenuItem { action: alignRight }
MenuItem { action: alignJustify } MenuItem { action: alignJustify }
MenuSeparator {}
MenuItem { action: color }
} }
Menu { Menu {
title: "&Help" title: "&Help"
MenuItem { text: "About..." } MenuItem { text: "About..." ; onTriggered: aboutBox.show() }
MenuItem { text: "About Qt" }
} }
} }
...@@ -200,19 +223,23 @@ ApplicationWindow { ...@@ -200,19 +223,23 @@ ApplicationWindow {
width: parent.width width: parent.width
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
spacing: 1 spacing: 0
ToolButton { action: fileOpen } ToolButton { action: fileOpen }
Item { width: 4 } ToolBarSeparator {}
ToolButton { action: copy } ToolButton { action: copy }
ToolButton { action: cut } ToolButton { action: cut }
ToolButton { action: paste } ToolButton { action: paste }
Item { width: 4 }
ToolBarSeparator {}
ToolButton { action: bold } ToolButton { action: bold }
ToolButton { action: italic } ToolButton { action: italic }
ToolButton { action: underline } ToolButton { action: underline }
Item { width: 4 } ToolBarSeparator {}
ToolButton { action: alignLeft } ToolButton { action: alignLeft }
ToolButton { action: alignCenter } ToolButton { action: alignCenter }
ToolButton { action: alignRight } ToolButton { action: alignRight }
...@@ -220,28 +247,13 @@ ApplicationWindow { ...@@ -220,28 +247,13 @@ ApplicationWindow {
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
} }
} }
ToolBar {
id: secondaryToolBar
width: parent.width
RowLayout {
anchors.fill: parent
anchors.margins: 4
ComboBox {
model: document.defaultFontSizes
onCurrentTextChanged: document.fontSize = currentText
currentIndex: document.defaultFontSizes.indexOf(document.fontSize + "")
}
TextField { id: fontEdit; enabled: false }
Item { Layout.fillWidth: true }
}
}
TextArea { TextArea {
Accessible.name: "document" Accessible.name: "document"
id: textArea id: textArea
frameVisible: false
width: parent.width width: parent.width
anchors.top: secondaryToolBar.bottom anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
text: document.text text: document.text
textFormat: Qt.RichText textFormat: Qt.RichText
...@@ -254,8 +266,5 @@ ApplicationWindow { ...@@ -254,8 +266,5 @@ ApplicationWindow {
cursorPosition: textArea.cursorPosition cursorPosition: textArea.cursorPosition
selectionStart: textArea.selectionStart selectionStart: textArea.selectionStart
selectionEnd: textArea.selectionEnd selectionEnd: textArea.selectionEnd
onCurrentFontChanged: {
fontEdit.text = currentFont.family
}
} }
} }
<!DOCTYPE RCC><RCC version="1.0"> <!DOCTYPE RCC><RCC version="1.0">
<qresource prefix="/"> <qresource prefix="/">
<file>qml/main.qml</file> <file>qml/main.qml</file>
<file>qml/ToolBarSeparator.qml</file>
<file>qml/images/logo32.png</file> <file>qml/images/logo32.png</file>
<file>qml/images/editcopy.png</file> <file>qml/images/editcopy.png</file>
<file>qml/images/editcut.png</file> <file>qml/images/editcut.png</file>
......
...@@ -166,13 +166,11 @@ void DocumentHandler::mergeFormatOnWordOrSelection(const QTextCharFormat &format ...@@ -166,13 +166,11 @@ void DocumentHandler::mergeFormatOnWordOrSelection(const QTextCharFormat &format
void DocumentHandler::setSelectionStart(int position) void DocumentHandler::setSelectionStart(int position)
{ {
m_selectionStart = position; m_selectionStart = position;
// emit selectionStartChanged();
} }
void DocumentHandler::setSelectionEnd(int position) void DocumentHandler::setSelectionEnd(int position)
{ {
m_selectionEnd = position; m_selectionEnd = position;
// emit selectionEndChanged();
} }
void DocumentHandler::setAlignment(Qt::Alignment a) void DocumentHandler::setAlignment(Qt::Alignment a)
...@@ -188,10 +186,8 @@ void DocumentHandler::setAlignment(Qt::Alignment a) ...@@ -188,10 +186,8 @@ void DocumentHandler::setAlignment(Qt::Alignment a)
Qt::Alignment DocumentHandler::alignment() const Qt::Alignment DocumentHandler::alignment() const
{ {
// if (!m_doc || m_doc->isEmpty() || m_cursorPosition < 0)
// return Qt::AlignLeft;
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (cursor.isNull() || cursor.blockNumber() == 0) if (cursor.isNull())
return Qt::AlignLeft; return Qt::AlignLeft;
return textCursor().blockFormat().alignment(); return textCursor().blockFormat().alignment();
} }
...@@ -199,7 +195,7 @@ Qt::Alignment DocumentHandler::alignment() const ...@@ -199,7 +195,7 @@ Qt::Alignment DocumentHandler::alignment() const
bool DocumentHandler::bold() const bool DocumentHandler::bold() const
{ {
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (cursor.isNull() || cursor.blockNumber() == 0) if (cursor.isNull())
return false; return false;
return textCursor().charFormat().fontWeight() == QFont::Bold; return textCursor().charFormat().fontWeight() == QFont::Bold;
} }
...@@ -207,7 +203,7 @@ bool DocumentHandler::bold() const ...@@ -207,7 +203,7 @@ bool DocumentHandler::bold() const
bool DocumentHandler::italic() const bool DocumentHandler::italic() const
{ {
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (cursor.isNull() || cursor.blockNumber() == 0) if (cursor.isNull())
return false; return false;
return textCursor().charFormat().fontItalic(); return textCursor().charFormat().fontItalic();
} }
...@@ -215,7 +211,7 @@ bool DocumentHandler::italic() const ...@@ -215,7 +211,7 @@ bool DocumentHandler::italic() const
bool DocumentHandler::underline() const bool DocumentHandler::underline() const
{ {
QTextCursor cursor = textCursor(); QTextCursor cursor = textCursor();
if (cursor.isNull() || cursor.blockNumber() == 0) if (cursor.isNull())
return false; return false;
return textCursor().charFormat().fontUnderline(); return textCursor().charFormat().fontUnderline();
} }
......
...@@ -7,7 +7,8 @@ qtHaveModule(widgets) { ...@@ -7,7 +7,8 @@ qtHaveModule(widgets) {
include(src/src.pri) include(src/src.pri)
OTHER_FILES += \ OTHER_FILES += \
qml/main.qml qml/main.qml \
qml/ToolBarSeparator.qml
RESOURCES += \ RESOURCES += \
resources.qrc resources.qrc
...@@ -86,7 +86,7 @@ Item { ...@@ -86,7 +86,7 @@ Item {
anchors.margins: 20 anchors.margins: 20
style: touchStyle style: touchStyle
text: "Dont press me" text: "Dont press me"
onClicked: if (pageStack) pageStack.pop() onClicked: if (stackView) stackView.pop()
} }
} }
......
...@@ -54,8 +54,8 @@ ApplicationWindow { ...@@ -54,8 +54,8 @@ ApplicationWindow {
// Implements back key navigation // Implements back key navigation
Keys.onReleased: { Keys.onReleased: {
if (event.key === Qt.Key_Back) { if (event.key === Qt.Key_Back) {
if (pageStack.depth > 1) { if (stackView.depth > 1) {
pageStack.pop(); stackView.pop();
event.accepted = true; event.accepted = true;
} else { Qt.quit(); } } else { Qt.quit(); }
} }
...@@ -72,7 +72,7 @@ ApplicationWindow { ...@@ -72,7 +72,7 @@ ApplicationWindow {
width: opacity ? 60 : 0 width: opacity ? 60 : 0
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 20 anchors.leftMargin: 20
opacity: pageStack.depth > 1 ? 1 : 0 opacity: stackView.depth > 1 ? 1 : 0
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
antialiasing: true antialiasing: true
height: 60 height: 60
...@@ -87,7 +87,7 @@ ApplicationWindow { ...@@ -87,7 +87,7 @@ ApplicationWindow {
id: backmouse id: backmouse
anchors.fill: parent anchors.fill: parent
anchors.margins: -10 anchors.margins: -10
onClicked: pageStack.pop() onClicked: stackView.pop()
} }
} }
...@@ -126,7 +126,7 @@ ApplicationWindow { ...@@ -126,7 +126,7 @@ ApplicationWindow {
} }
StackView { StackView {
id: pageStack id: stackView
anchors.fill: parent anchors.fill: parent
initialItem: Item { initialItem: Item {
...@@ -137,7 +137,7 @@ ApplicationWindow { ...@@ -137,7 +137,7 @@ ApplicationWindow {
anchors.fill: parent anchors.fill: parent
delegate: AndroidDelegate { delegate: AndroidDelegate {
text: title text: title
onClicked: pageStack.push(Qt.resolvedUrl(page)) onClicked: stackView.push(Qt.resolvedUrl(page))
} }
} }
} }
......
...@@ -80,13 +80,19 @@ import QtQuick.Controls.Private 1.0 ...@@ -80,13 +80,19 @@ import QtQuick.Controls.Private 1.0
Control { Control {
id: comboBox id: comboBox
/*! The model to populate the ComboBox from. */ /*! \qmlproperty model ComboBox::model
The model to populate the ComboBox from. */
property alias model: popupItems.model property alias model: popupItems.model
/*! The model role used for populating the ComboBox. */
property string textRole: "" property string textRole: ""
/*! The index of the currently selected item in the ComboBox. */ /*! \qmlproperty int ComboBox::currentIndex
The index of the currently selected item in the ComboBox. */
property alias currentIndex: popup.__selectedIndex property alias currentIndex: popup.__selectedIndex
/*! The text of the currently selected item in the ComboBox. */
/*! \qmlproperty string ComboBox::currentText
The text of the currently selected item in the ComboBox. */
readonly property alias currentText: popup.selectedText readonly property alias currentText: popup.selectedText
/*! This property specifies whether the combobox should gain active focus when pressed. /*! This property specifies whether the combobox should gain active focus when pressed.
......
...@@ -159,7 +159,8 @@ Item { ...@@ -159,7 +159,8 @@ Item {
/*! \internal */ /*! \internal */
property alias __style: styleLoader.item property alias __style: styleLoader.item
implicitWidth: (!anchors.fill ? container.calcWidth() : 0) + loader.leftMargin + loader.rightMargin implicitWidth: Math.max((!anchors.fill ? container.calcWidth() : 0) + loader.leftMargin + loader.rightMargin,
sizeHint.implicitWidth + (checkable ? 24 : 6))
implicitHeight: (!anchors.fill ? container.calcHeight() : 0) + loader.topMargin + loader.bottomMargin implicitHeight: (!anchors.fill ? container.calcHeight() : 0) + loader.topMargin + loader.bottomMargin
Layout.minimumWidth: implicitWidth Layout.minimumWidth: implicitWidth
...@@ -181,6 +182,7 @@ Item { ...@@ -181,6 +182,7 @@ Item {
property int rightMargin: __style ? __style.padding.right : 0 property int rightMargin: __style ? __style.padding.right : 0
sourceComponent: styleLoader.item ? styleLoader.item.panel : null sourceComponent: styleLoader.item ? styleLoader.item.panel : null
onLoaded: item.z = -1 onLoaded: item.z = -1
Text { id: sizeHint ; visible: false ; text: title }
Loader { Loader {
id: styleLoader id: styleLoader
property alias __control: groupbox property alias __control: groupbox
......
...@@ -123,7 +123,7 @@ Control { ...@@ -123,7 +123,7 @@ Control {
implicitWidth:(__panel ? __panel.implicitWidth : 0) implicitWidth:(__panel ? __panel.implicitWidth : 0)
implicitHeight: (__panel ? __panel.implicitHeight: 0) implicitHeight: (__panel ? __panel.implicitHeight: 0)
/* \internal */ /*! \internal */
function setValue(v) { function setValue(v) {
var newval = parseFloat(v) var newval = parseFloat(v)
if (!isNaN(newval)) { if (!isNaN(newval)) {
......
...@@ -146,8 +146,8 @@ FocusScope { ...@@ -146,8 +146,8 @@ FocusScope {
/*! \internal */ /*! \internal */
property Component style: Qt.createComponent(Settings.style + "/ScrollViewStyle.qml", root) property Component style: Qt.createComponent(Settings.style + "/ScrollViewStyle.qml", root)
/* \internal */ /*! \internal */
property PaddedStyle __style: styleLoader.item property Style __style: styleLoader.item
activeFocusOnTab: true activeFocusOnTab: true
......
...@@ -174,19 +174,6 @@ Control { ...@@ -174,19 +174,6 @@ Control {
Accessible.role: Accessible.Slider Accessible.role: Accessible.Slider
Accessible.name: value Accessible.name: value
/*!
\qmlmethod Slider::formatValue
This method returns the current slider value in a way that is more suitable
for user display, such as the \l value rounded to only two decimal places.
By default this function returns the nearest \c int value.
*/
function formatValue(v) {
return Math.round(v);
}
style: Qt.createComponent(Settings.style + "/SliderStyle.qml", slider) style: Qt.createComponent(Settings.style + "/SliderStyle.qml", slider)
Keys.onRightPressed: value += (maximumValue - minimumValue)/10.0 Keys.onRightPressed: value += (maximumValue - minimumValue)/10.0
......
...@@ -75,6 +75,8 @@ Control { ...@@ -75,6 +75,8 @@ Control {
id: spinbox id: spinbox
/*! /*!
\qmlproperty real SpinBox::value
The value of this SpinBox, clamped to \l minimumValue and \l maximumValue. The value of this SpinBox, clamped to \l minimumValue and \l maximumValue.
The default value is \c{0.0}. The default value is \c{0.0}.
...@@ -82,6 +84,8 @@ Control { ...@@ -82,6 +84,8 @@ Control {
property alias value: validator.value property alias value: validator.value
/*! /*!
\qmlproperty real SpinBox::minimumValue
The minimum value of the SpinBox range. The minimum value of the SpinBox range.
The \l value is clamped to this value. The \l value is clamped to this value.
...@@ -90,6 +94,8 @@ Control { ...@@ -90,6 +94,8 @@ Control {
property alias minimumValue: validator.minimumValue property alias minimumValue: validator.minimumValue
/*! /*!
\qmlproperty real SpinBox::maximumValue
The maximum value of the SpinBox range. The maximum value of the SpinBox range.
The \l value is clamped to this value. If maximumValue is smaller than The \l value is clamped to this value. If maximumValue is smaller than
\l minimumValue, \l minimumValue will be enforced. \l minimumValue, \l minimumValue will be enforced.
...@@ -98,7 +104,7 @@ Control { ...@@ -98,7 +104,7 @@ Control {
*/ */
property alias maximumValue: validator.maximumValue property alias maximumValue: validator.maximumValue
/*! /*! \qmlproperty real SpinBox::stepSize
The amount by which the \l value is incremented/decremented when a The amount by which the \l value is incremented/decremented when a
spin button is pressed. spin button is pressed.
...@@ -106,13 +112,16 @@ Control { ...@@ -106,13 +112,16 @@ Control {
*/ */
property alias stepSize: validator.stepSize property alias stepSize: validator.stepSize
/*! The suffix for the value. I.e "cm" */ /*! \qmlproperty string SpinBox::suffix
The suffix for the value. I.e "cm" */
property alias suffix: validator.suffix property alias suffix: validator.suffix
/*! The prefix for the value. I.e "$" */ /*! \qmlproperty string SpinBox::prefix
The prefix for the value. I.e "$" */
property alias prefix: validator.prefix property alias prefix: validator.prefix
/*! This property indicates the amount of decimals. /*! \qmlproperty int SpinBox::decimals
This property indicates the amount of decimals.
Note that if you enter more decimals than specified, they will Note that if you enter more decimals than specified, they will
be truncated to the specified amount of decimal places. be truncated to the specified amount of decimal places.
The default value is \c{0}. The default value is \c{0}.
...@@ -157,7 +166,7 @@ Control { ...@@ -157,7 +166,7 @@ Control {
readonly property alias downPressed: mouseDown.pressed readonly property alias downPressed: mouseDown.pressed
readonly property alias downHovered: mouseDown.containsMouse readonly property alias downHovered: mouseDown.containsMouse
readonly property alias containsMouse: mouseArea.containsMouse readonly property alias hovered: mouseArea.containsMouse
readonly property int contentHeight: Math.max(input.implicitHeight, 16) readonly property int contentHeight: Math.max(input.implicitHeight, 16)
readonly property int contentWidth: Math.max(maxSizeHint.implicitWidth, minSizeHint.implicitWidth) readonly property int contentWidth: Math.max(maxSizeHint.implicitWidth, minSizeHint.implicitWidth)
......
...@@ -53,13 +53,14 @@ import QtQuick.Controls.Private 1.0 as Private ...@@ -53,13 +53,14 @@ import QtQuick.Controls.Private 1.0 as Private
SplitView is a control that lays out items horizontally or SplitView is a control that lays out items horizontally or
vertically with a draggable splitter between each item. vertically with a draggable splitter between each item.
There will always be one (and only one) item in the SplitView that has \l {Layout}{Layout.fillWidth} There will always be one (and only one) item in the SplitView that has \l{Layout::fillWidth}{Layout.fillWidth}
set to \c true (or Layout.fillHeight, if orientation is Qt.Vertical). This means that the set to \c true (or \l{Layout::fillHeight}{Layout.fillHeight}, if orientation is Qt.Vertical). This means that the
item will get all leftover space when other items have been laid out. item will get all leftover space when other items have been laid out.
By default, the last visible child of the SplitView will have this set, but By default, the last visible child of the SplitView will have this set, but
it can be changed by explicitly setting fillWidth to \c true on another item. it can be changed by explicitly setting fillWidth to \c true on another item.
As the fillWidth item will automatically be resized to fit the extra space, explicit assignments As the fillWidth item will automatically be resized to fit the extra space, explicit assignments
to width and height will be ignored (but Layout.minimumWidth and Layout.maximumWidth will still be respected). to width and height will be ignored (but \l{Layout::minimumWidth}{Layout.minimumWidth} and
\l{Layout::maximumWidth}{Layout.maximumWidth} will still be respected).
A handle can belong to the item either on the left or top side, or on the right or bottom side: A handle can belong to the item either on the left or top side, or on the right or bottom side:
\list \list
...@@ -69,9 +70,19 @@ import QtQuick.Controls.Private 1.0 as Private ...@@ -69,9 +70,19 @@ import QtQuick.Controls.Private 1.0 as Private
This will again control which item gets resized when the user drags a handle, This will again control which item gets resized when the user drags a handle,
and which handle gets hidden when an item is told to hide. and which handle gets hidden when an item is told to hide.
SplitView supports setting attached \l Layout properties on child items, which means that you
can control minimumWidth, minimumHeight, maximumWidth and maximumHeight (in addition SplitView supports setting attached Layout properties on child items, which
to fillWidth/fillHeight) for each child. means that you can set the following attached properties for each child:
\list
\li \l{Layout::minimumWidth}{Layout.minimumWidth}
\li \l{Layout::minimumHeight}{Layout.minimumHeight}
\li \l{Layout::preferredWidth}{Layout.preferredWidth}
\li \l{Layout::preferredHeight}{Layout.preferredHeight}
\li \l{Layout::maximumWidth}{Layout.maximumWidth}
\li \l{Layout::maximumHeight}{Layout.maximumHeight}
\li \l{Layout::fillWidth}{Layout.fillWidth} (\c true for only one child)
\li \l{Layout::fillHeight}{Layout.fillHeight} (\c true for only one child)
\endlist
Example: Example:
...@@ -117,14 +128,17 @@ Item { ...@@ -117,14 +128,17 @@ Item {
/*! /*!
This property holds the delegate that will be instantiated between each This property holds the delegate that will be instantiated between each
child item. Inside the delegate the following properties are available: child item. Inside the delegate the following properties are available:
\list
\li int \c handleIndex - specifies the index of the splitter handle. The handle \table
between the first and the second item will get index 0, \li readonly property bool styleData.index - Specifies the index of the splitter handle. The handle
the next handle index 1 etc. between the first and the second item will get index 0,
\li bool \c pressed: the handle is being pressed. the next handle index 1 etc.
\li bool \c resizing: the handle is being dragged. \li readonly property bool styleData.hovered - The handle is being hovered.
\endlist \li readonly property bool styleData.pressed - The handle is being pressed.
*/ \li readonly property bool styleData.resizing - The handle is being dragged.
\endtable
*/
property Component handleDelegate: Rectangle { property Component handleDelegate: Rectangle {
width: 1 width: 1
height: 1 height: 1
...@@ -176,7 +190,7 @@ Item { ...@@ -176,7 +190,7 @@ Item {
continue continue
if (splitterItems.children.length > 0) if (splitterItems.children.length > 0)
handleLoader.createObject(splitterHandles, {"handleIndex":splitterItems.children.length - 1}) handleLoader.createObject(splitterHandles, {"__handleIndex":splitterItems.children.length - 1})
item.parent = splitterItems item.parent = splitterItems
i-- // item was removed from list i-- // item was removed from list
item.widthChanged.connect(d.updateLayout) item.widthChanged.connect(d.updateLayout)
...@@ -319,18 +333,21 @@ Item { ...@@ -319,18 +333,21 @@ Item {
id: handleLoader id: handleLoader
Loader { Loader {
id: itemHandle id: itemHandle
property int handleIndex: -1
property alias containsMouse: mouseArea.containsMouse
property alias pressed: mouseArea.pressed
property bool resizing: mouseArea.drag.active
visible: __items[handleIndex + ((d.fillIndex >= handleIndex) ? 0 : 1)].visible property int __handleIndex: -1
property QtObject styleData: QtObject {
readonly property int index: __handleIndex
readonly property alias hovered: mouseArea.containsMouse
readonly property alias pressed: mouseArea.pressed
readonly property bool resizing: mouseArea.drag.active
onResizingChanged: root.resizing = resizing
}
visible: __items[__handleIndex + ((d.fillIndex >= __handleIndex) ? 0 : 1)].visible
sourceComponent: handleDelegate sourceComponent: handleDelegate
onWidthChanged: d.updateLayout() onWidthChanged: d.updateLayout()
onHeightChanged: d.updateLayout() onHeightChanged: d.updateLayout()
onXChanged: moveHandle() onXChanged: moveHandle()
onYChanged: moveHandle() onYChanged: moveHandle()
onResizingChanged: root.resizing = resizing
MouseArea { MouseArea {
id: mouseArea id: mouseArea
...@@ -357,12 +374,12 @@ Item { ...@@ -357,12 +374,12 @@ Item {
var leftEdge, rightEdge, newWidth, leftStopX, rightStopX var leftEdge, rightEdge, newWidth, leftStopX, rightStopX
var i var i
if (d.fillIndex > handleIndex) { if (d.fillIndex > __handleIndex) {
// Resize item to the left. // Resize item to the left.
// Ensure that the handle is not crossing other handles. So // Ensure that the handle is not crossing other handles. So
// find the first visible handle to the left to determine the left edge: // find the first visible handle to the left to determine the left edge:
leftEdge = 0 leftEdge = 0
for (i=handleIndex-1; i>=0; --i) { for (i=__handleIndex-1; i>=0; --i) {
leftHandle = __handles[i] leftHandle = __handles[i]
if (leftHandle.visible) { if (leftHandle.visible) {
leftEdge = leftHandle[d.offset] + leftHandle[d.size] leftEdge = leftHandle[d.offset] + leftHandle[d.size]
...@@ -371,13 +388,13 @@ Item { ...@@ -371,13 +388,13 @@ Item {
} }
// Ensure: leftStopX >= itemHandle[d.offset] >= rightStopX // Ensure: leftStopX >= itemHandle[d.offset] >= rightStopX
var min = d.accumulatedSize(handleIndex+1, __items.length, true) var min = d.accumulatedSize(__handleIndex+1, __items.length, true)
rightStopX = root[d.size] - min - itemHandle[d.size] rightStopX = root[d.size] - min - itemHandle[d.size]
leftStopX = Math.max(leftEdge, itemHandle[d.offset]) leftStopX = Math.max(leftEdge, itemHandle[d.offset])
itemHandle[d.offset] = Math.min(rightStopX, Math.max(leftStopX, itemHandle[d.offset])) itemHandle[d.offset] = Math.min(rightStopX, Math.max(leftStopX, itemHandle[d.offset]))
newWidth = itemHandle[d.offset] - leftEdge newWidth = itemHandle[d.offset] - leftEdge
leftItem = __items[handleIndex] leftItem = __items[__handleIndex]
// The next line will trigger 'updateLayout': // The next line will trigger 'updateLayout':
leftItem[d.size] = newWidth leftItem[d.size] = newWidth
} else { } else {
...@@ -385,7 +402,7 @@ Item { ...@@ -385,7 +402,7 @@ Item {
// Ensure that the handle is not crossing other handles. So // Ensure that the handle is not crossing other handles. So
// find the first visible handle to the right to determine the right edge: // find the first visible handle to the right to determine the right edge:
rightEdge = root[d.size] rightEdge = root[d.size]
for (i=handleIndex+1; i<__handles.length; ++i) { for (i=__handleIndex+1; i<__handles.length; ++i) {
rightHandle = __handles[i] rightHandle = __handles[i]
if (rightHandle.visible) { if (rightHandle.visible) {
rightEdge = rightHandle[d.offset] rightEdge = rightHandle[d.offset]
...@@ -394,13 +411,13 @@ Item { ...@@ -394,13 +411,13 @@ Item {
} }
// Ensure: leftStopX <= itemHandle[d.offset] <= rightStopX // Ensure: leftStopX <= itemHandle[d.offset] <= rightStopX
min = d.accumulatedSize(0, handleIndex+1, true) min = d.accumulatedSize(0, __handleIndex+1, true)
leftStopX = min - itemHandle[d.size] leftStopX = min - itemHandle[d.size]
rightStopX = Math.min((rightEdge - itemHandle[d.size]), itemHandle[d.offset]) rightStopX = Math.min((rightEdge - itemHandle[d.size]), itemHandle[d.offset])
itemHandle[d.offset] = Math.max(leftStopX, Math.min(itemHandle[d.offset], rightStopX)) itemHandle[d.offset] = Math.max(leftStopX, Math.min(itemHandle[d.offset], rightStopX))
newWidth = rightEdge - (itemHandle[d.offset] + itemHandle[d.size]) newWidth = rightEdge - (itemHandle[d.offset] + itemHandle[d.size])
rightItem = __items[handleIndex+1] rightItem = __items[__handleIndex+1]
// The next line will trigger 'updateLayout': // The next line will trigger 'updateLayout':
rightItem[d.size] = newWidth rightItem[d.size] = newWidth
} }
......
...@@ -65,6 +65,8 @@ import "Private/StackView.js" as JSArray ...@@ -65,6 +65,8 @@ import "Private/StackView.js" as JSArray
The stack can then be used by invoking its navigation methods. The first item 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. 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 \section1 Basic Navigation
There are three primary navigation operations in StackView: push(), pop() and There are three primary navigation operations in StackView: push(), pop() and
replace (you replace by specifying argument \c replace to push()). replace (you replace by specifying argument \c replace to push()).
...@@ -435,6 +437,15 @@ import "Private/StackView.js" as JSArray ...@@ -435,6 +437,15 @@ import "Private/StackView.js" as JSArray
} }
} }
\endqml \endqml
\section1 Supported Attached Properties
Items in a StackView support these attached properties:
\list
\li \l{Stack::index}{Stack.index} - Contains the index of the item inside the StackView
\li \l{Stack::view}{Stack.view} - Contains the StackView the item is in
\li \l{Stack::status}{Stack.status} - Contains the status of the item
\endlist
*/ */
Item { Item {
...@@ -797,7 +808,7 @@ Item { ...@@ -797,7 +808,7 @@ Item {
} }
element.item.Stack.__index = element.index element.item.Stack.__index = element.index
element.item.Stack.__stackView = root element.item.Stack.__view = root
// Let item fill all available space by default: // Let item fill all available space by default:
element.item.width = Qt.binding(function() { return root.width }) element.item.width = Qt.binding(function() { return root.width })
element.item.height = Qt.binding(function() { return root.height }) element.item.height = Qt.binding(function() { return root.height })
...@@ -842,7 +853,7 @@ Item { ...@@ -842,7 +853,7 @@ Item {
// might reenter on pop if pushed several times: // might reenter on pop if pushed several times:
item.visible = false item.visible = false
__setStatus(item, Stack.Inactive) __setStatus(item, Stack.Inactive)
item.Stack.__stackView = null item.Stack.__view = null
item.Stack.__index = -1 item.Stack.__index = -1
if (element.originalParent) if (element.originalParent)
item.parent = element.originalParent item.parent = element.originalParent
...@@ -871,7 +882,7 @@ Item { ...@@ -871,7 +882,7 @@ Item {
// Since an item can be pushed several times, we need to update its properties: // Since an item can be pushed several times, we need to update its properties:
enterItem.parent = root enterItem.parent = root
enterItem.Stack.__stackView = root enterItem.Stack.__view = root
enterItem.Stack.__index = transition.inElement.index enterItem.Stack.__index = transition.inElement.index
__currentItem = enterItem __currentItem = enterItem
......