diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2015-10-26 17:31:18 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-01-22 03:36:16 +0000 |
commit | d921a9bd157b04242722ab4326c5f2ea8e88cbea (patch) | |
tree | 9e9583e6aefa16a80a1390d755a11b347f5da3ab /src/gui/text/qtextcursor.h | |
parent | a44e4a6cfe37482b3b4b1527eabc807c585d0500 (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 'src/gui/text/qtextcursor.h')
-rw-r--r-- | src/gui/text/qtextcursor.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qtextcursor.h b/src/gui/text/qtextcursor.h index 350f38cd02..c5462b2936 100644 --- a/src/gui/text/qtextcursor.h +++ b/src/gui/text/qtextcursor.h @@ -61,10 +61,8 @@ class Q_GUI_EXPORT QTextCursor public: QTextCursor(); explicit QTextCursor(QTextDocument *document); - QTextCursor(QTextDocumentPrivate *p, int pos); explicit QTextCursor(QTextFrame *frame); explicit QTextCursor(const QTextBlock &block); - explicit QTextCursor(QTextCursorPrivate *d); QTextCursor(const QTextCursor &cursor); #ifdef Q_COMPILER_RVALUE_REFS QTextCursor &operator=(QTextCursor &&other) Q_DECL_NOTHROW { swap(other); return *this; } @@ -221,8 +219,12 @@ public: QTextDocument *document() const; private: + QTextCursor(QTextDocumentPrivate &p, int pos); + explicit QTextCursor(QTextCursorPrivate *d); + QSharedDataPointer<QTextCursorPrivate> d; friend class QTextCursorPrivate; + friend class QTextDocumentPrivate; friend class QTextDocumentFragmentPrivate; friend class QTextCopyHelper; friend class QWidgetTextControlPrivate; |