From 279562172d2e998e910d82599255cb04b54df823 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Tue, 15 May 2012 20:02:53 +0300 Subject: enable the text layout's cache where it is seems to be missed e.g. in QStaticText, the data is used just to get the line's y-position and re-calculates just after the loop to determine the bounding rect and to draw the text; in QWidgetLineControl, the data re-calculated over and over while the result is seems to remain the same; probably the caching is needed here too Change-Id: I0f7eb291532f63eccb9c5f749daebb73ff90632f Reviewed-by: Eskil Abrahamsen Blomfeldt --- tests/auto/other/qcomplextext/tst_qcomplextext.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/auto/other') diff --git a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp index 6b418d7c46..764c75f137 100644 --- a/tests/auto/other/qcomplextext/tst_qcomplextext.cpp +++ b/tests/auto/other/qcomplextext/tst_qcomplextext.cpp @@ -168,6 +168,7 @@ void tst_QComplexText::bidiCursor_qtbug2795() QTextLayout l1(str); l1.beginLayout(); + l1.setCacheEnabled(true); QTextLine line1 = l1.createLine(); l1.endLayout(); @@ -175,6 +176,7 @@ void tst_QComplexText::bidiCursor_qtbug2795() str.append("1"); QTextLayout l2(str); + l2.setCacheEnabled(true); l2.beginLayout(); QTextLine line2 = l2.createLine(); l2.endLayout(); @@ -206,6 +208,7 @@ void tst_QComplexText::bidiCursorMovement() QFETCH(int, basicDir); QTextLayout layout(logical); + layout.setCacheEnabled(true); QTextOption option = layout.textOption(); option.setTextDirection(basicDir == QChar::DirL ? Qt::LeftToRight : Qt::RightToLeft); @@ -273,6 +276,7 @@ void tst_QComplexText::bidiCursor_PDF() { QString str = QString::fromUtf8("\342\200\252hello\342\200\254"); QTextLayout layout(str); + layout.setCacheEnabled(true); layout.beginLayout(); QTextLine line = layout.createLine(); -- cgit v1.2.3