summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-10-26 17:31:18 -0700
committerThiago Macieira <thiago.macieira@intel.com>2016-01-22 03:36:16 +0000
commitd921a9bd157b04242722ab4326c5f2ea8e88cbea (patch)
tree9e9583e6aefa16a80a1390d755a11b347f5da3ab /tests/auto/gui
parenta44e4a6cfe37482b3b4b1527eabc807c585d0500 (diff)
Hide better the private API QTextCursor constructors
Both constructors were taking a pointer, so they participated in overload resolution along with QTextDocument and QTextFrame pointers. Instead, make them take references and move them to the private section of QTextCursor. That necessitated adding a method to QTextCursorPrivate to access that private constructor from non-friend classes. Change-Id: I7e6338336dd6468ead24ffff1410e3bc534d77dd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/text/qtextcursor/qtextcursor.pro2
-rw-r--r--tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp5
2 files changed, 4 insertions, 3 deletions
diff --git a/tests/auto/gui/text/qtextcursor/qtextcursor.pro b/tests/auto/gui/text/qtextcursor/qtextcursor.pro
index 5e045404f1..d984b30fbb 100644
--- a/tests/auto/gui/text/qtextcursor/qtextcursor.pro
+++ b/tests/auto/gui/text/qtextcursor/qtextcursor.pro
@@ -2,4 +2,4 @@ CONFIG += testcase
CONFIG += parallel_test
TARGET = tst_qtextcursor
SOURCES += tst_qtextcursor.cpp
-QT += testlib
+QT += core-private gui-private testlib
diff --git a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
index 9396cd678b..423d87591a 100644
--- a/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
+++ b/tests/auto/gui/text/qtextcursor/tst_qtextcursor.cpp
@@ -34,7 +34,6 @@
#include <QtTest/QtTest>
-
#include <qtextdocument.h>
#include <qtexttable.h>
#include <qvariant.h>
@@ -45,6 +44,8 @@
#include <qtextobject.h>
#include <qdebug.h>
+#include <private/qtextcursor_p.h>
+
QT_FORWARD_DECLARE_CLASS(QTextDocument)
class tst_QTextCursor : public QObject
@@ -1292,7 +1293,7 @@ void tst_QTextCursor::anchorInitialized1()
void tst_QTextCursor::anchorInitialized2()
{
cursor.insertBlock();
- cursor = QTextCursor(cursor.block().docHandle(), 1);
+ cursor = QTextCursorPrivate::fromPosition(cursor.block().docHandle(), 1);
QCOMPARE(cursor.position(), 1);
QCOMPARE(cursor.anchor(), 1);
QCOMPARE(cursor.selectionStart(), 1);