Doc: Fix documentation warnings for Qt GUI

- Remove obsolete dependencies and references.
- Restore previously deleted snippet code referenced in
  richtext.qdoc.
- Add widgets snippets path to exampledirs; some  classes
  were moved from QtWidgets to QtGUI and related \snippet
  commands were broken.
- Mark internal functions under QNativeInterface::Private
  as \internal.

Task-number: QTBUG-86295
Change-Id: I9c165c860c7191dac65972d702698a1745bff77f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This commit is contained in:
Topi Reinio 2020-11-18 13:58:40 +01:00
parent 3c525f2a21
commit 5669351bdf
15 changed files with 105 additions and 27 deletions

View File

@ -36,8 +36,6 @@ tagfile = ../../../doc/qtgui/qtgui.tags
depends += \
qtcore \
qtimageformats \
qtmacextras \
qtmultimedia \
qtnetwork \
qtopengl \
qtprintsupport \
@ -59,6 +57,7 @@ sourcedirs += .. \
exampledirs += ../../../examples/gui \
../../../examples/vulkan \
../../widgets/doc/snippets \
snippets
imagedirs += images \

View File

@ -65,6 +65,12 @@ MainWindow::MainWindow()
menuBar()->addMenu(fileMenu);
editor = new QTextEdit;
//! [rootframe]
QTextDocument *editorDocument = editor->document();
QTextFrame *root = editorDocument->rootFrame();
//! [rootframe]
processFrame(root);
QTextCursor cursor(editor->textCursor());
cursor.movePosition(QTextCursor::Start);
@ -151,3 +157,23 @@ void MainWindow::saveFile()
}
}
void MainWindow::processBlock(QTextBlock)
{
}
void MainWindow::processFrame(QTextFrame *frame)
{
//! [4]
QTextFrame::iterator it;
for (it = frame->begin(); !(it.atEnd()); ++it) {
QTextFrame *childFrame = it.currentFrame();
QTextBlock childBlock = it.currentBlock();
if (childFrame)
processFrame(childFrame);
else if (childBlock.isValid())
processBlock(childBlock);
}
//! [4]
}

View File

@ -54,6 +54,8 @@
#include <QMainWindow>
class QTextEdit;
class QTextFrame;
class QTextBlock;
class MainWindow : public QMainWindow
{
@ -67,6 +69,8 @@ public slots:
private:
bool writeXml(const QString &fileName);
void processBlock(QTextBlock);
void processFrame(QTextFrame *frame);
QTextEdit *editor = nullptr;
};

View File

@ -193,3 +193,35 @@ void MainWindow::showTable()
tableWidget->show();
}
void MainWindow::processFrame(QTextFrame *)
{
}
void MainWindow::processBlock(QTextBlock)
{
}
void MainWindow::processTable(QTextTable *table)
{
QTextFrame *frame = qobject_cast<QTextFrame *>(table);
//! [13]
QTextFrame::iterator it;
for (it = frame->begin(); !(it.atEnd()); ++it) {
QTextFrame *childFrame = it.currentFrame();
QTextBlock childBlock = it.currentBlock();
if (childFrame) {
QTextTable *childTable = qobject_cast<QTextTable*>(childFrame);
if (childTable)
processTable(childTable);
else
processFrame(childFrame);
} else if (childBlock.isValid()) {
processBlock(childBlock);
}
}
//! [13]
}

View File

@ -53,6 +53,9 @@
#include <QMainWindow>
class QTextEdit;
class QTextFrame;
class QTextBlock;
class QTextTable;
class MainWindow : public QMainWindow
{
@ -67,6 +70,9 @@ public slots:
private:
bool writeXml(const QString &fileName);
void processFrame(QTextFrame *);
void processBlock(QTextBlock);
void processTable(QTextTable *table);
QTextEdit *editor = nullptr;
};

View File

@ -179,8 +179,7 @@
We obtain the root frame in the following manner:
\snippet textdocument-frames/xmlwriter.h 0
\snippet textdocument-frames/xmlwriter.cpp 0
\snippet textdocument-frames/mainwindow.cpp rootframe
When navigating the document structure, it is useful to begin at the
root frame because it provides access to the entire document structure.
@ -266,8 +265,7 @@
child frames. We can inspect the contents of a frame by using a
QTextFrame::iterator to traverse the frame's child elements:
\snippet textdocument-frames/xmlwriter.cpp 1
\snippet textdocument-frames/xmlwriter.cpp 2
\snippet textdocument-frames/mainwindow.cpp 4
Note that the iterator selects both frames and blocks, so it is necessary
to check which it is referring to. This allows us to navigate the document
@ -291,8 +289,7 @@
document, we can test whether it represents a table, and deal with it in a
different way:
\snippet textdocument-tables/xmlwriter.cpp 0
\snippet textdocument-tables/xmlwriter.cpp 1
\snippet textdocument-tables/mainwindow.cpp 13
The cells within an existing table can be examined by iterating through
the rows and columns.

View File

@ -94,8 +94,6 @@ QT_BEGIN_NAMESPACE
The CGImageRef color space is set to the sRGB color space.
\ingroup platform-type-conversions
\sa QtMac::toNSImage()
*/
CGImageRef QImage::toCGImage() const
{

View File

@ -45,9 +45,7 @@
\brief The QMovie class is a convenience class for playing movies
with QImageReader.
This class is used to show simple animations without sound. If you want
to display video and media content, use the \l{Qt Multimedia}
multimedia framework instead.
This class is used to show simple animations without sound.
First, create a QMovie object by passing either the name of a file or a
pointer to a QIODevice containing an animated image format to QMovie's

View File

@ -206,7 +206,7 @@ QObject *QActionPrivate::menu() const
menu and toolbar, then connected to the slot which will perform
the action. For example:
\snippet mainwindows/application/mainwindow.cpp 19
\snippet ../widgets/mainwindows/application/mainwindow.cpp 19
Actions are added to widgets using QWidget::addAction() or
QGraphicsWidget::addAction(). Note that an action must be added to a

View File

@ -99,9 +99,8 @@ QT_BEGIN_NAMESPACE
\l{QWidget::mouseMoveEvent()}{mouseMoveEvent()} to check whether a QDrag is
required.
\sa {Drag and Drop}, QClipboard, QMimeData, QMacPasteboardMime,
{Draggable Icons Example}, {Draggable Text Example}, {Drop Site Example},
{Fridge Magnets Example}
\sa {Drag and Drop}, QClipboard, QMimeData, {Draggable Icons Example},
{Draggable Text Example}, {Drop Site Example}, {Fridge Magnets Example}
*/
/*!

View File

@ -1187,7 +1187,7 @@ QRegion QWindow::mask() const
/*!
Requests the window to be activated, i.e. receive keyboard focus.
\sa isActive(), QGuiApplication::focusWindow(), QWindowsWindowFunctions::setWindowActivationBehavior()
\sa isActive(), QGuiApplication::focusWindow()
*/
void QWindow::requestActivate()
{

View File

@ -177,8 +177,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\fn template<int NN, int M1, int M2, typename TT> QGenericMatrix<M1, M2, TT> operator*(const QGenericMatrix<NN, M2, TT>& m1, const QGenericMatrix<M1, NN, TT>& m2)
\relates QGenericMatrix
\fn template <int N, int M, typename T> template<int NN, int M1, int M2, typename TT> QGenericMatrix<M1, M2, TT> QGenericMatrix<N, M, T>::operator*(const QGenericMatrix<NN, M2, TT>& m1, const QGenericMatrix<M1, NN, TT>& m2)
Returns the product of the NNxM2 matrix \a m1 and the M1xNN matrix \a m2
to produce a M1xM2 matrix result.

View File

@ -94,7 +94,8 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QCocoaMenuBar);
\brief Adopts an NSOpenGLContext.
The adopted NSOpenGLContext is retained. Ownership of the created QOpenGLContext is transferred to the caller.
The adopted NSOpenGLContext \a context is retained. Ownership of the
created QOpenGLContext \a shareContext is transferred to the caller.
*/
/*!

View File

@ -72,11 +72,11 @@ using namespace QNativeInterface::Private;
/*!
\fn QOpenGLContext *QNativeInterface::QGLXContext::fromNative(GLXContext configBasedContext, QOpenGLContext *shareContext = nullptr)
\brief Adopts a GLXContext created from an FBConfig.
\brief Adopts a GLXContext \a configBasedContext created from an FBConfig.
The context must be created from a framebuffer configuration, using the \c glXCreateNewContext function.
Ownership of the created QOpenGLContext is transferred to the caller.
Ownership of the created QOpenGLContext \a shareContext is transferred to the caller.
*/
/*!
@ -129,11 +129,12 @@ QOpenGLContext *QNativeInterface::QGLXContext::fromNative(GLXContext visualBased
/*!
\fn QOpenGLContext *QNativeInterface::QEGLContext::fromNative(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext = nullptr)
\brief Adopts an EGLContext.
\brief Adopts an EGLContext \a context.
The same \c EGLDisplay passed to \c eglCreateContext must be passed as the \a display argument.
Ownership of the created QOpenGLContext is transferred to the caller.
Ownership of the created QOpenGLContext \a shareContext is transferred
to the caller.
*/
/*!

View File

@ -66,7 +66,7 @@ using namespace QNativeInterface::Private;
/*!
\fn QOpenGLContext *QNativeInterface::QWGLContext::fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext = nullptr)
\brief Adopts an WGL context handle.
\brief Adopts an WGL \a context handle.
The \a window is needed because the its pixel format will be queried. When the
adoption is successful, QOpenGLContext::format() will return a QSurfaceFormat
@ -76,7 +76,8 @@ using namespace QNativeInterface::Private;
format compatible with the context's. If no SetPixelFormat() call was made on
any device context belonging to the window, adopting the context will fail.
Ownership of the created QOpenGLContext is transferred to the caller.
Ownership of the created QOpenGLContext \a shareContext is transferred to the
caller.
*/
/*!
@ -133,12 +134,14 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication);
/*!
\fn void QNativeInterface::Private::QWindowsApplication::setTouchWindowTouchType(QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes type)
\internal
Sets the touch window type for all windows to \a type.
*/
/*!
\fn QNativeInterface::Private::QWindowsApplication::TouchWindowTouchTypes QNativeInterface::Private::QWindowsApplication::touchWindowTouchType() const
\internal
Returns the currently set the touch window type.
*/
@ -161,6 +164,7 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication);
/*!
\fn void QNativeInterface::Private::QWindowsApplication::setWindowActivationBehavior(QNativeInterface::Private::QWindowsApplication::WindowActivationBehavior behavior)
\internal
Sets the window activation behavior to \a behavior.
@ -169,12 +173,14 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication);
/*!
\fn QNativeInterface::Private::QWindowsApplication::WindowActivationBehavior QNativeInterface::Private::QWindowsApplication::windowActivationBehavior() const
\internal
Returns the currently set the window activation behavior.
*/
/*!
\fn bool QNativeInterface::Private::QWindowsApplication::isTabletMode() const
\internal
Returns \c true if Windows 10 operates in \e{Tablet Mode}.
In this mode, Windows forces all application main windows to open in maximized
@ -199,6 +205,7 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication);
/*!
\fn bool QNativeInterface::Private::QWindowsApplication::isDarkMode() const = 0
\internal
Returns \c true if Windows 10 is configured to use dark mode for
applications.
@ -206,24 +213,28 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication);
/*!
\fn void QNativeInterface::Private::QWindowsApplication::setDarkModeHandling(DarkModeHandling handling) = 0
\internal
Sets the dark mode handling to \a handling.
*/
/*!
\fn QNativeInterface::Private::QWindowsApplication::DarkModeHandling QNativeInterface::Private::QWindowsApplication::darkModeHandling() const
\internal
Returns the currently set dark mode handling.
*/
/*!
\fn bool QNativeInterface::Private::QWindowsApplication::isWinTabEnabled() const = 0
\internal
Returns whether the \e{Tablet WinTab Driver} (\c Wintab32.dll) is used.
*/
/*!
\fn bool QNativeInterface::Private::QWindowsApplication::setWinTabEnabled(bool enabled)
\internal
Sets whether the \e{Tablet WinTab Driver} (\c Wintab32.dll) should be used to \a enabled.
@ -232,6 +243,7 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication);
/*!
\fn bool QNativeInterface::Private::QWindowsApplication::registerMime(QWindowsMime *mime)
\internal
Registers the converter \a mime to the system.
@ -240,6 +252,7 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication);
/*!
\fn void QNativeInterface::Private::QWindowsApplication::unregisterMime(QWindowsMime *mime)
\internal
Unregisters the converter \a mime from the system.
@ -248,6 +261,7 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsApplication);
/*!
\fn int QNativeInterface::Private::QWindowsApplication::registerMimeType(const QString &mime)
\internal
Registers the MIME type \a mime, and returns an ID number
identifying the format on Windows.
@ -291,6 +305,7 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsWindow);
/*!
\fn void QNativeInterface::Private::QWindowsWindow::setHasBorderInFullScreen(bool border)
\internal
Sets whether the WS_BORDER flag will be set for the window in full screen mode
to \a border.
@ -300,6 +315,7 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsWindow);
/*!
\fn bool QNativeInterface::Private::QWindowsWindow::hasBorderInFullScreen() const
\internal
Returns whether the WS_BORDER flag will be set for the window in full screen
mode.
@ -307,12 +323,14 @@ QT_DEFINE_PRIVATE_NATIVE_INTERFACE(QWindowsWindow);
/*!
\fn QMargins QNativeInterface::Private::QWindowsWindow::customMargins() const
\internal
Returns the margin to be used when handling the \c WM_NCCALCSIZE message.
*/
/*!
\fn void QNativeInterface::Private::QWindowsWindow::setCustomMargins(const QMargins &margins)
\internal
Sets the\a margins to be used when handling the \c WM_NCCALCSIZE message. It is
possible to remove a frame border by specifying a negative value.