diff options
-rw-r--r-- | src/corelib/global/qnamespace.h | 10 | ||||
-rw-r--r-- | src/corelib/global/qnamespace.qdoc | 34 | ||||
-rw-r--r-- | src/gui/text/qtextdocument.cpp | 28 | ||||
-rw-r--r-- | src/gui/text/qtextdocument.h | 4 |
4 files changed, 29 insertions, 47 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 7dd8ac19a8..288c966eec 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1863,16 +1863,6 @@ public: static bool activateCallbacks(Callback, void **); }; -#if defined(Q_CLANG_QDOC) -// Declared here for qdoc; actual declarations in qtextdocument.h -namespace Qt -{ - bool mightBeRichText(const QString&); - QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode = WhiteSpacePre); - QTextCodec *codecForHtml(const QByteArray &ba); -} -#endif // Q_CLANG_QDOC - QT_END_NAMESPACE #endif // QNAMESPACE_H diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 2fcc744092..de0c6feeb6 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -3228,37 +3228,3 @@ \value ChecksumItuV41 Checksum calculation based on ITU-V.41. */ - -/*! - \fn bool Qt::mightBeRichText(const QString& text) - - Returns \c true if the string \a text is likely to be rich text; - otherwise returns \c false. - - This function uses a fast and therefore simple heuristic. It - mainly checks whether there is something that looks like a tag - before the first line break. Although the result may be correct - for common cases, there is no guarantee. - - This function is defined in the \c <QTextDocument> header file. -*/ - -/*! - \fn QString Qt::convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode) - - Converts the plain text string \a plain to an HTML-formatted - paragraph while preserving most of its look. - - \a mode defines how whitespace is handled. - - This function is defined in the \c <QTextDocument> header file. - - \sa escape(), mightBeRichText() -*/ - -/*! - \fn QTextCodec *Qt::codecForHtml(const QByteArray &ba) - \internal - - This function is defined in the \c <QTextDocument> header file. -*/ diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 129a326ba2..5d8eed409e 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -75,6 +75,18 @@ QT_BEGIN_NAMESPACE Q_CORE_EXPORT Q_DECL_CONST_FUNCTION unsigned int qt_int_sqrt(unsigned int n); + +/*! + Returns \c true if the string \a text is likely to be rich text; + otherwise returns \c false. + + This function uses a fast and therefore simple heuristic. It + mainly checks whether there is something that looks like a tag + before the first line break. Although the result may be correct + for common cases, there is no guarantee. + + This function is defined in the \c <QTextDocument> header file. +*/ bool Qt::mightBeRichText(const QString& text) { if (text.isEmpty()) @@ -133,6 +145,16 @@ bool Qt::mightBeRichText(const QString& text) return false; } +/*! + Converts the plain text string \a plain to an HTML-formatted + paragraph while preserving most of its look. + + \a mode defines how whitespace is handled. + + This function is defined in the \c <QTextDocument> header file. + + \sa escape(), mightBeRichText() +*/ QString Qt::convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode) { int col = 0; @@ -181,6 +203,12 @@ QString Qt::convertFromPlainText(const QString &plain, Qt::WhiteSpaceMode mode) return rich; } +/*! + \fn QTextCodec *Qt::codecForHtml(const QByteArray &ba) + \internal + + This function is defined in the \c <QTextDocument> header file. +*/ #ifndef QT_NO_TEXTCODEC QTextCodec *Qt::codecForHtml(const QByteArray &ba) { diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h index 64e39d4648..33c0b48683 100644 --- a/src/gui/text/qtextdocument.h +++ b/src/gui/text/qtextdocument.h @@ -70,17 +70,15 @@ class QTextCursor; template<typename T> class QVector; -#ifndef Q_CLANG_QDOC namespace Qt { Q_GUI_EXPORT bool mightBeRichText(const QString&); Q_GUI_EXPORT QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode = WhiteSpacePre); -#ifndef QT_NO_TEXTCODEC +#if !defined(QT_NO_TEXTCODEC) || defined(Q_CLANG_QDOC) Q_GUI_EXPORT QTextCodec *codecForHtml(const QByteArray &ba); #endif } -#endif class Q_GUI_EXPORT QAbstractUndoItem { |