summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/widgets/widgets/qtextbrowser/main.cpp
blob: 7375e5b41437220f5e2450d658f27d64ac2efb3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0

#include <QDebug>
#include <QTextBrowser>
#include <qtest.h>

class tst_QTextBrowser : public QObject
{
    Q_OBJECT
private slots:
    void largeDocumentsLazyLayout();
};

void tst_QTextBrowser::largeDocumentsLazyLayout()
{
    QString sl;
    for (int i = 0; i < 150000; ++i) {
        sl.append("long long text\n");
    }

    QBENCHMARK {
        QTextBrowser browser;
        browser.setPlainText(sl);
        browser.show();
    }
}

QTEST_MAIN(tst_QTextBrowser)

#include "main.moc"