font.pixelSize: 18
}
+ Text {
+ id: txtlines
+ property string styledtextvalue: "Line 1<br>Line 2<br>Line 3"
+ text: "Line 1\nLine 2\nLine 3"
+ textFormat: Text.PlainText
+ }
+
TestCase {
name: "Text"
txtlinecount.width = 50;
compare(txtlinecount.lineCount, 3)
}
+ function test_linecounts() {
+ compare(txtlines.lineCount, 3)
+ txtlines.text = txtlines.styledtextvalue;
+ compare(txtlines.text, "Line 1<br>Line 2<br>Line 3")
+ tryCompare(txtlines, 'lineCount', 1)
+ txtlines.textFormat = Text.StyledText;
+ tryCompare(txtlines, 'lineCount', 3)
+ txtlines.textFormat = Text.RichText;
+ tryCompare(txtlines, 'lineCount', 3)
+ }
}
}
id: txtlines
property string styledtextvalue: "Line 1<br>Line 2<br>Line 3"
text: "Line 1\nLine 2\nLine 3"
- textFormat: Text.PlainText
+ textFormat: TextEdit.PlainText
}
TestCase {
txtlines.text = txtlines.styledtextvalue;
compare(txtlines.text, "Line 1<br>Line 2<br>Line 3")
tryCompare(txtlines, 'lineCount', 1)
- txtlines.textFormat = Text.StyledText;
- expectFail("", "QTBUG-31191")
- tryCompare(txtlines, 'lineCount', 3)
- txtlines.textFormat = Text.RichText;
+ txtlines.textFormat = TextEdit.RichText;
tryCompare(txtlines, 'lineCount', 3)
}
}