Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix multi-length string substitution.
Multi-length string eliding was provided by QFontMetrics::elidedText() which is no longer used for layouts. So we instead have to do the string substitution ourselves if the text doesn't fit before finally eliding. Change-Id: Iab2e54b332390290d656299a5be148f39f78df9d Reviewed-by: Martin Jones <martin.jones@nokia.com>
- Loading branch information
Andrew den Exter
authored and
Qt by Nokia
committed
Feb 16, 2012
1 parent
990a95f
commit 7127120
Showing
5 changed files
with
123 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
tests/auto/qtquick2/qquicktext/data/multilengthStrings.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import QtQuick 2.0 | ||
|
||
Item { | ||
width: 300 | ||
height: 200 | ||
|
||
Text { | ||
id: myText | ||
objectName: "myText" | ||
width: 100 | ||
font.pixelSize: 15 | ||
font.family: "Helvetica" | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
tests/auto/qtquick2/qquicktext/data/multilengthStringsWrapped.qml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import QtQuick 2.0 | ||
|
||
Item { | ||
width: 300 | ||
height: 200 | ||
|
||
Text { | ||
id: myText | ||
objectName: "myText" | ||
width: 100 | ||
height: 36 | ||
font.pixelSize: 15 | ||
font.family: "Helvetica" | ||
wrapMode: Text.Wrap | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters