diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp | 5 | ||||
-rw-r--r-- | tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp | 37 |
2 files changed, 2 insertions, 40 deletions
diff --git a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp index 72d2cc7aa7..bc533df48a 100644 --- a/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp +++ b/tests/auto/widgets/widgets/qtextedit/tst_qtextedit.cpp @@ -1194,9 +1194,8 @@ void tst_QTextEdit::undoRedoShouldRepositionTextEditCursor() void tst_QTextEdit::lineWrapModes() { ed->setLineWrapMode(QTextEdit::NoWrap); - // NoWrap at the same time as having all lines that are all left aligned means we optimize to - // only layout once. The effect is that the width is always -1 - QCOMPARE(ed->document()->pageSize().width(), qreal(-1)); + // NoWrap at the same time as having all lines that are all left aligned means we optimize to only layout once. The effect is that the width is always 0 + QCOMPARE(ed->document()->pageSize().width(), qreal(0)); QTextCursor cursor = QTextCursor(ed->document()); cursor.insertText(QString("A simple line")); diff --git a/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp b/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp index b8684610a8..fd74a7b3b9 100644 --- a/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp +++ b/tests/benchmarks/widgets/graphicsview/qgraphicsitem/tst_qgraphicsitem.cpp @@ -5,7 +5,6 @@ #include <QGraphicsItem> #include <QGraphicsScene> #include <QGraphicsView> -#include <QTextDocument> class tst_QGraphicsItem : public QObject { @@ -34,8 +33,6 @@ private slots: void shear(); void translate(); void createTextItem(); - void createTextItemZeroWidth(); - void createTextItemNoLayouting(); }; tst_QGraphicsItem::tst_QGraphicsItem() @@ -219,39 +216,5 @@ void tst_QGraphicsItem::createTextItem() } } -void tst_QGraphicsItem::createTextItemZeroWidth() -{ - // Ensure QFontDatabase loaded the font beforehand - QFontInfo(qApp->font()).family(); - const QString text = "This is some text"; - QBENCHMARK { - QGraphicsTextItem item; - item.document()->setTextWidth(0); - // Prepare everything - item.setPlainText(text); - QTextOption option = item.document()->defaultTextOption(); - option.setAlignment(Qt::AlignHCenter); - item.document()->setDefaultTextOption(option); - // And (in a real app) set actual text width here - } -} - -void tst_QGraphicsItem::createTextItemNoLayouting() -{ - // Ensure QFontDatabase loaded the font beforehand - QFontInfo(qApp->font()).family(); - const QString text = "This is some text"; - QBENCHMARK { - QGraphicsTextItem item; - item.document()->setLayoutEnabled(false); - // Prepare everything - item.setPlainText(text); - QTextOption option = item.document()->defaultTextOption(); - option.setAlignment(Qt::AlignHCenter); - item.document()->setDefaultTextOption(option); - // And (in a real app) enable layouting here - } -} - QTEST_MAIN(tst_QGraphicsItem) #include "tst_qgraphicsitem.moc" |