Commit Graph

19 Commits

Author SHA1 Message Date
Masoud Jami 573e557ae6 document viewer example: document the translation approach
This patch adds the documentation for the translation approach of
the document viewer example.

Pick-to: 6.10
Change-Id: Iae31d9c6278630347f331631c107259a470257dc
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2025-08-05 10:34:33 +02:00
Kai Köhne c30e70c7e9 documentviewer: Fix outdated API documentation
Pick-to: 6.10
Change-Id: I6b55c66a07cea28374f492819790ff0d4ace2a29
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-07-10 14:20:43 +02:00
Kai Köhne f7bda9f2fa documentviewer: Remove search functionality for JSON
The toolbar was broken in that the pixmap path to magnifier.png was
wrong. With the path enabled, the magnifier looked alien between the
other icons that are retrieved from the system style.

While this could be fixed easily, the acutal search functionality
would've required much more work. As is, the search via
QTV::keybardSearch() is quite limited:
* Only the first columns with the JSON keys are searched
* The text is matched only to the beginning of the column
  text, you cannot search for texts in between or at the end of the
  key.
* Only expanded rows are searched.

All in all, this makes the search appear rather broken. Let's just
remove it.

Pick-to: 6.10
Change-Id: Ie58b88e2ff6327d703094f108eab94b083012e16
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-07-09 14:29:47 +02:00
Friedemann Kleint 09bc4a6861 documentviewer: Add simple image viewer
Since qtbase/b8f588bea74aae0a890e1af18b936b0bfbf8c237
removed the QtWidgets image viewer example, there
is no way to exercise the image plugins.
Re-add the code as documentviewer plugin.

Pick-to: 6.9
Change-Id: I0eb26d02a9c11cdb0fce315ffc6f7c662e98c924
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2025-01-24 17:29:41 +01:00
Jaishree Vyas d741f3d9cb Doc: Create separate Graphics Multimedia example categories
Fixes: QTBUG-117884
Pick-to: 6.6 6.7
Change-Id: I52b36360e4967efc6da74972218b7496c7830291
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-01-16 14:40:08 +01:00
Topi Reinio f39470f7cd Doc: Add missing \image command to Text Viewer Plugin Example
Fixes documentation warning:

(qdoc) warning: demos/documentviewer/plugins/txtviewer:
    Example documentation should have at least one '\image'

Pick-to: 6.6
Change-Id: I6ceee59e42358c7fb67c332529d184d99e103513
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-08-29 14:31:45 +00:00
Topi Reinio d9561a5e6e Doc: Fix documentation issues
Fix link targets for section titles that are incorrect or were changed
elsewhere in the documentation.

Also,

doc/src/howtos/installer-cli.qdoc:

* Style double-dash in the section title with \tt. Without \tt, QDoc
  interprets -- as 'en dash'; the output is incorrect and the special
  character also prevents linking to the section title.

examples/demos/documentviewer/doc/src/txtviewer.qdoc:

* Add missing end delimiter for the comment block, and fix linking to
  the parent example (Document Viewer).

Pick-to: 6.6
Change-Id: Ic660fa66e6ce87046664771349e3720f51c90352
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-08-29 12:38:38 +00:00
Inkamari Harjula aa5a3ae5d6 Doc: Add example categories to qtdoc examples
Added categories to qtdoc examples.

Task-number: QTBUG-116430
Pick-to: 6.5 6.6
Change-Id: I91adf8b2d4af083181b2203da8dec44d6b17f606
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-08-28 10:47:07 +03:00
Friedemann Kleint 9c7d96e376 DocumentViewer demo: Remove OpenMode from class RecentFiles
A document viewer typically uses read-only.

Pick-to: 6.6
Change-Id: Ic5a601c0b5af9d0e97a47368d71e8daa9e5e0244
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-07-03 16:10:36 +02:00
Axel Spoerl c56673c241 Replace Application example by documentviewer's TxtViewer plugin
This patch adds a snippet based documentation of TxtViewer's code with
the target to replace the Application example in widgets.

Pick-to: 6.6
Change-Id: I25045c8f710ae110398e71099c276571cb32ecf3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-06-26 16:06:31 +02:00
Topi Reinio dc659775c4 Doc: Fix file quoting in Document Viewer demo
Adapt the file quoting command in the documentation to match changes
in the source code.

Pick-to: 6.6
Change-Id: I6f3a93b4efff8df8d7cd6f8244b610b1ad93e4ba
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-06-21 11:34:19 +00:00
Kai Köhne e1220042e6 Doc: Add more examples to Application Examples category
Add following examples to Application Examples category:

* Robot Arm Example
* Qt Quick Demo - RESTful Color Palette API client
* Media Player Example
* Document Viewer

Pick-to: 6.5 6.6
Change-Id: Ie36bb9a09d7fe868db07e02edcb1778f214494e9
Reviewed-by: Kimmo Leppälä <kimmo.leppala@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2023-06-15 11:07:40 +02:00
Topi Reinio 8f66cabc1d Doc: Update documentation for Document Viewer demo
The source code has seen multiple revisions and the documentation
was referring to types and implementation details that no longer
exist or hold true.

Reorganize the content, simplify the language, and fix the source
file quoting.

Change-Id: If22c052460b4dc2f1e321eb423c6f2a415cd26f5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-05-10 07:44:05 +00:00
Kai Köhne f6f1ee3913 Drop: 'Qt Demo' from Document Viewer example name
Follow the naming style of the other examples, and just name the example
page 'Document Viewer'.

Also remove the page from the group mainwindow-classes, at is - quite
evidently - not a class. Instead, add it to the list of widgets examples.

Pick-to: 6.5
Change-Id: Ic54640a2da4e549e389056e6c504238040d24985
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-05-05 13:16:33 +02:00
Axel Spoerl 76393bd903 Update documentviewer demo's documentation
This patch updates the documentation with regard to the plugin
architecture implementation and new helper classes.

Task-number: QTBUG-111925
Change-Id: I776470c84c492eeff973d6ac535374de679c03e5
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
2023-05-04 13:11:57 +02:00
Kai Köhne 3705d584d7 Doc: Add new Document Viewer example to Application Examples
Pick-to: 6.5
Change-Id: Iad807bff4323c0ffaf924565ae67d49ebca786be
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-05-02 12:03:25 +00:00
Axel Spoerl ba61af0bf3 Migrate documentviewer example into plugin based architecture
This patch changes the document viewer example to a plugin based
architecture.
It adapts the documentation accordingly.

Change-Id: Ia24028aa27e21fb8ab36f5ef3a9953be60858b19
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2023-05-02 10:11:06 +02:00
Axel Spoerl 7c46fa7745 Remove unused variables in document viewer demo
This patch removes two unused data members and fixes
a documentation typo.

Pick-to: 6.5 6.5.0
Change-Id: I79fd66c727f2af54f1e13a33f8da2895b587663b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-03-09 16:39:46 +01:00
Axel Spoerl 9bba48e1ca Add Json, text and pdf document viewer demo
Add a demo with a combined viewer for Json, pdf and text documents.
The example demonstrates how to create an application, utilizing
a main window with static and dynamic toolbars, menus and actions.

Type specific viewers inherit from an abstract viewer class.
The Json viewer implements an abstract tree model for QJsonDocument.

The example demonstrates a few useful application features, implemented
with QtWidgets and QSettings, to (re)store properties:
- Detecting file content types with QMimeDatabase
- Changing and restoring override cursor when hovering over a widget.
- Basic printing support.

Pick-to: 6.5 6.5.0
Change-Id: Ie411669cfdbc41ac399cd1aed87e60722195c42c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-03-09 11:55:22 +01:00