Doc: Revise document viewer example

Restructure content to follow the application examples template.

Fixes: QTBUG-137896
Pick-to: 6.10
Change-Id: Id94e8e6cc753d4267b3e75bb4f1c136cbd4d699d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Jerome Pasion <jerome.pasion@qt.io>
This commit is contained in:
Safiyyah Moosa 2025-09-02 23:36:23 +02:00
parent 5feeae9108
commit 9a926e5574
1 changed files with 5 additions and 7 deletions

View File

@ -9,6 +9,8 @@
\meta {tag} {demo,widgets,mainwindow} \meta {tag} {demo,widgets,mainwindow}
\brief A Widgets application to display and print JSON, text, and PDF files. \brief A Widgets application to display and print JSON, text, and PDF files.
\image documentviewer_open.png
{Document viewer UI showing a 'Select Open Mode' pop-up}
\e{Document Viewer} demonstrates how to use a QMainWindow with static \e{Document Viewer} demonstrates how to use a QMainWindow with static
and dynamic toolbars, menus, and actions. Additionally, it demonstrates and dynamic toolbars, menus, and actions. Additionally, it demonstrates
@ -22,8 +24,7 @@
\li Localizing the UI to different languages. \li Localizing the UI to different languages.
\endlist \endlist
\image documentviewer_open.png \include examples-run.qdocinc
\section1 Creating an application and the main window \section1 Creating an application and the main window
@ -38,7 +39,6 @@
\printuntil exec \printuntil exec
\printline } \printline }
\section1 MainWindow class \section1 MainWindow class
The \c MainWindow class provides an application screen with menus, The \c MainWindow class provides an application screen with menus,
@ -53,7 +53,6 @@
showing bookmarks and thumbnails. On the right, there is a QScrollArea for showing bookmarks and thumbnails. On the right, there is a QScrollArea for
viewing file content. viewing file content.
\section1 ViewerFactory class \section1 ViewerFactory class
The \c ViewerFactory class manages viewers for known file types. These viewers The \c ViewerFactory class manages viewers for known file types. These viewers
@ -95,7 +94,6 @@
\skipto m_viewer->initViewer \skipto m_viewer->initViewer
\printuntil } \printuntil }
\section1 AbstractViewer class \section1 AbstractViewer class
\c AbstractViewer provides a generalized API to view, save, and print a \c AbstractViewer provides a generalized API to view, save, and print a
@ -135,7 +133,6 @@
This signal notifies the application that a document was successfully This signal notifies the application that a document was successfully
loaded. loaded.
\section1 TxtViewer class \section1 TxtViewer class
\c TxtViewer is a simple text viewer, inheriting from AbstractViewer. \c TxtViewer is a simple text viewer, inheriting from AbstractViewer.
@ -181,7 +178,6 @@
Widget Example}. It demonstrates the use of QScroller to smoothly Widget Example}. It demonstrates the use of QScroller to smoothly
flick through a document. flick through a document.
\section1 Other relevant classes \section1 Other relevant classes
\section2 HoverWatcher class \section2 HoverWatcher class
@ -427,5 +423,7 @@
\printuntil } \printuntil }
\endlist \endlist
\section1 Source files
\sa {All Qt examples}
*/ */