aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-04-23 09:33:25 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-04-23 09:34:29 +0200
commit580fa7dc88aae23053e44ffa335a15f6af112a20 (patch)
tree5bc915d7c2e252739122d9441bd0d7fa7175d0c2 /tests/manual
parent6767114285db9d0e16dc278d08f231e8561546b4 (diff)
parentc00283bb3bb966bf60c307ec8283bd98c12318bf (diff)
Merge remote-tracking branch 'origin/dev' into wip/scenegraphng
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/scenegraph_lancelot/data/text/text_wrap_elide_maxlines.qml133
-rw-r--r--tests/manual/tableview/tablemodel/form/RowForm.qml36
-rw-r--r--tests/manual/tableview/tablemodel/form/main.qml60
3 files changed, 178 insertions, 51 deletions
diff --git a/tests/manual/scenegraph_lancelot/data/text/text_wrap_elide_maxlines.qml b/tests/manual/scenegraph_lancelot/data/text/text_wrap_elide_maxlines.qml
new file mode 100644
index 0000000000..927f2b3148
--- /dev/null
+++ b/tests/manual/scenegraph_lancelot/data/text/text_wrap_elide_maxlines.qml
@@ -0,0 +1,133 @@
+import QtQuick 2.0
+
+//test wrapping and elision when maximumLineCount is set
+
+Item {
+ width: 320
+ height: 480
+ Rectangle {
+ id: text_area
+ color: "light yellow"
+ x: 50
+ y: 0
+ height: parent.height
+ width: 150
+ }
+ Text {
+ id: text_0000
+ wrapMode: Text.WrapAnywhere
+ text: "The quick brown fox jumps over the lazy dog."
+ x: text_area.x
+ y: text_area.y
+ width: text_area.width
+ maximumLineCount: 2
+ elide: Text.ElideRight
+ color: "red"
+ font.family: "Arial"
+ font.pixelSize: 22
+ }
+ Text {
+ id: text_0001
+ wrapMode: Text.Wrap
+ text: text_0000.text
+ anchors.top: text_0000.bottom
+ anchors.left: text_0000.left
+ width: text_0000.width
+ maximumLineCount: text_0000.maximumLineCount
+ elide: Text.ElideRight
+ color: "blue"
+ font.family: text_0000.font.family
+ font.pixelSize: text_0000.font.pixelSize
+ }
+ Text {
+ id: text_0002
+ wrapMode: Text.WordWrap
+ text: text_0000.text
+ anchors.top: text_0001.bottom
+ anchors.left: text_0000.left
+ width: text_0000.width
+ maximumLineCount: text_0000.maximumLineCount
+ elide: Text.ElideRight
+ color: "green"
+ font.family: text_0000.font.family
+ font.pixelSize: text_0000.font.pixelSize
+ }
+ Text {
+ id: text_0003
+ wrapMode: Text.WrapAnywhere
+ text: "ABCDEFGHIJKL 1234567890123"
+ anchors.top: text_0002.bottom
+ anchors.left: text_0000.left
+ width: 150
+ maximumLineCount: 2
+ elide: Text.ElideRight
+ color: "red"
+ font.family: text_0000.font.family
+ font.pixelSize: text_0000.font.pixelSize
+ }
+ Text {
+ id: text_0004
+ wrapMode: Text.Wrap
+ text: text_0003.text
+ anchors.top: text_0003.bottom
+ anchors.left: text_0000.left
+ width: text_0000.width
+ maximumLineCount: text_0000.maximumLineCount
+ elide: Text.ElideRight
+ color: "blue"
+ font.family: text_0000.font.family
+ font.pixelSize: text_0000.font.pixelSize
+ }
+ Text {
+ id: text_0005
+ wrapMode: Text.WordWrap
+ text: text_0003.text
+ anchors.top: text_0004.bottom
+ anchors.left: text_0000.left
+ width: text_0000.width
+ maximumLineCount: text_0000.maximumLineCount
+ elide: Text.ElideRight
+ color: "green"
+ font.family: text_0000.font.family
+ font.pixelSize: text_0000.font.pixelSize
+ }
+ Text {
+ id: text_0006
+ wrapMode: Text.WrapAnywhere
+ text: "The quick brown 1234567890123"
+ anchors.top: text_0005.bottom
+ anchors.left: text_0000.left
+ width: 150
+ maximumLineCount: 2
+ elide: Text.ElideRight
+ color: "red"
+ font.family: text_0000.font.family
+ font.pixelSize: text_0000.font.pixelSize
+ }
+ Text {
+ id: text_0007
+ wrapMode: Text.Wrap
+ text: text_0006.text
+ anchors.top: text_0006.bottom
+ anchors.left: text_0000.left
+ width: text_0000.width
+ maximumLineCount: text_0000.maximumLineCount
+ elide: Text.ElideRight
+ color: "blue"
+ font.family: text_0000.font.family
+ font.pixelSize: text_0000.font.pixelSize
+ }
+ Text {
+ id: text_0008
+ wrapMode: Text.WordWrap
+ text: text_0006.text
+ anchors.top: text_0007.bottom
+ anchors.left: text_0000.left
+ width: text_0000.width
+ maximumLineCount: text_0000.maximumLineCount
+ elide: Text.ElideRight
+ color: "green"
+ font.family: text_0000.font.family
+ font.pixelSize: text_0000.font.pixelSize
+ }
+}
diff --git a/tests/manual/tableview/tablemodel/form/RowForm.qml b/tests/manual/tableview/tablemodel/form/RowForm.qml
index 428682008a..bb03e685c0 100644
--- a/tests/manual/tableview/tablemodel/form/RowForm.qml
+++ b/tests/manual/tableview/tablemodel/form/RowForm.qml
@@ -45,13 +45,13 @@ ScrollView {
clip: true
function inputAsRow() {
- return [
- { checkable: checkableCheckBox.checked, checked: checkedCheckBox.checked },
- { amount: amountSpinBox.value },
- { fruitType: fruitTypeTextField.text },
- { fruitName: fruitNameTextField.text },
- { fruitPrice: parseFloat(fruitPriceTextField.text) },
- ]
+ return {
+ checked: checkedCheckBox.checked,
+ amount: amountSpinBox.value,
+ fruitType: fruitTypeTextField.text,
+ fruitName: fruitNameTextField.text,
+ fruitPrice: parseFloat(fruitPriceTextField.text)
+ }
}
default property alias content: gridLayout.children
@@ -60,23 +60,11 @@ ScrollView {
id: gridLayout
columns: 2
- RowLayout {
- Layout.columnSpan: 2
-
- Label {
- text: "checkable"
- }
- CheckBox {
- id: checkableCheckBox
- checked: true
- }
-
- Label {
- text: "checked"
- }
- CheckBox {
- id: checkedCheckBox
- }
+ Label {
+ text: "checked"
+ }
+ CheckBox {
+ id: checkedCheckBox
}
Label {
diff --git a/tests/manual/tableview/tablemodel/form/main.qml b/tests/manual/tableview/tablemodel/form/main.qml
index 21ecd8edbb..6c6874fb4b 100644
--- a/tests/manual/tableview/tablemodel/form/main.qml
+++ b/tests/manual/tableview/tablemodel/form/main.qml
@@ -64,31 +64,37 @@ ApplicationWindow {
Layout.fillHeight: true
model: TableModel {
+ TableModelColumn { display: "checked" }
+ TableModelColumn { display: "amount" }
+ TableModelColumn { display: "fruitType" }
+ TableModelColumn { display: "fruitName" }
+ TableModelColumn { display: "fruitPrice" }
+
// One row = one type of fruit that can be ordered
rows: [
- [
- // Each object (line) is one cell/column,
- // and each property in that object is a role.
- { checked: false, checkable: true },
- { amount: 1 },
- { fruitType: "Apple" },
- { fruitName: "Granny Smith" },
- { fruitPrice: 1.50 }
- ],
- [
- { checked: true, checkable: true },
- { amount: 4 },
- { fruitType: "Orange" },
- { fruitName: "Navel" },
- { fruitPrice: 2.50 }
- ],
- [
- { checked: false, checkable: true },
- { amount: 1 },
- { fruitType: "Banana" },
- { fruitName: "Cavendish" },
- { fruitPrice: 3.50 }
- ]
+ {
+ // Each object (line) is one column,
+ // and each property in that object represents a role.
+ checked: false,
+ amount: 1,
+ fruitType: "Apple",
+ fruitName: "Granny Smith",
+ fruitPrice: 1.50
+ },
+ {
+ checked: true,
+ amount: 4,
+ fruitType: "Orange",
+ fruitName: "Navel",
+ fruitPrice: 2.50
+ },
+ {
+ checked: false,
+ amount: 1,
+ fruitType: "Banana",
+ fruitName: "Cavendish",
+ fruitPrice: 3.50
+ }
]
}
@@ -97,16 +103,16 @@ ApplicationWindow {
column: 0
delegate: CheckBox {
objectName: "tableViewCheckBoxDelegate"
- checked: model.checked
- onToggled: model.checked = checked
+ checked: model.display
+ onToggled: model.display = display
}
}
DelegateChoice {
column: 1
delegate: SpinBox {
objectName: "tableViewSpinBoxDelegate"
- value: model.amount
- onValueModified: model.amount = value
+ value: model.display
+ onValueModified: model.display = value
}
}
DelegateChoice {