From 4724dfff627f3cd3754f5d4a827c6b6790a89955 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 19 Feb 2020 11:26:57 +0100 Subject: Remove references to QTextDocumentPrivate from public API The private object of QTextDocument has been exposed through public APIs marked internal, which we should avoid as much as possible, since it clutters the headers. For accessing private data without adding friends, we have a nice pattern of adding a static get() function to the private class itself. Fixes: QTBUG-55059 Change-Id: I03e949a677e03487e95f24e3608a06aa0a3511ab Reviewed-by: Konstantin Ritt Reviewed-by: Simon Hausmann --- src/gui/text/qabstracttextdocumentlayout_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/gui/text/qabstracttextdocumentlayout_p.h') diff --git a/src/gui/text/qabstracttextdocumentlayout_p.h b/src/gui/text/qabstracttextdocumentlayout_p.h index d631ce3197..88035eb66d 100644 --- a/src/gui/text/qabstracttextdocumentlayout_p.h +++ b/src/gui/text/qabstracttextdocumentlayout_p.h @@ -53,6 +53,7 @@ #include #include "private/qobject_p.h" +#include "qtextdocument_p.h" #include "QtCore/qhash.h" QT_BEGIN_NAMESPACE @@ -78,7 +79,7 @@ public: document = doc; docPrivate = nullptr; if (doc) - docPrivate = doc->docHandle(); + docPrivate = QTextDocumentPrivate::get(doc); } inline int _q_dynamicPageCountSlot() const -- cgit v1.2.3