summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtextpiecetable
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qtextpiecetable')
-rw-r--r--tests/auto/qtextpiecetable/qtextpiecetable.pro1
-rw-r--r--tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp5
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/auto/qtextpiecetable/qtextpiecetable.pro b/tests/auto/qtextpiecetable/qtextpiecetable.pro
index edcb0a091c..cfbbe2bca5 100644
--- a/tests/auto/qtextpiecetable/qtextpiecetable.pro
+++ b/tests/auto/qtextpiecetable/qtextpiecetable.pro
@@ -1,4 +1,5 @@
load(qttest_p4)
+QT += widgets widgets-private
QT += core-private gui-private
SOURCES += tst_qtextpiecetable.cpp
HEADERS += ../qtextdocument/common.h
diff --git a/tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp b/tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp
index 12f17a890b..1fb5c301ed 100644
--- a/tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp
+++ b/tests/auto/qtextpiecetable/tst_qtextpiecetable.cpp
@@ -42,9 +42,10 @@
#include <QtTest/QtTest>
-#define private public
+#define protected public
#include <qtextdocument.h>
+#undef protected
#include <private/qtextdocument_p.h>
#include <qabstracttextdocumentlayout.h>
#include <qtextobject.h>
@@ -124,7 +125,7 @@ tst_QTextPieceTable::tst_QTextPieceTable()
void tst_QTextPieceTable::init()
{
doc = new QTextDocument(0);
- table = doc->d_func();
+ table = doc->docHandle();
blockFormatIndex = table->formatCollection()->indexForFormat(QTextBlockFormat());
charFormatIndex = table->formatCollection()->indexForFormat(QTextCharFormat());
}