Adapt the logic to install and detect especially the
plugins libs:
* Do not just compile them into the app build folder, but
keep the libs separate under the 'plugins' direcory
* At installation time, follow the logic of *deployqt
for Qt plugins, and store them in CMAKE_INSTALL_PREFIX/plugins
(Linux, Windows) or Document Viewer.app/Contents/Plugins
(macOS).
Unfortunately, this all requires different look ups at runtime for
all operating systems. For macOS and Windows, we furthermore need
to check both for valid paths with an installed build, and an
un-installed build.
While at it, move the install logic to app/CMakeLists.txt, so that
there is less repetition.
An alternative approach would be to calculate the relative paths
at configure time, and either pass on command line or in a created
header file. Anyhow, the current approach is more compact.
Pick-to: 6.10
Fixes: QTBUG-138476
Change-Id: I467d3bd4e14ef6b8b747bceb7177837e2edd3b8c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This patch extends the documentviewer demo to use
text based translation for English and German, as follows:
- Add AbstractView::addTranslation(fileName) for inheriting
plugin classes to optionally load own translations.
- Implement runtime translation switching. Provide option for
plugins to benefit, if they implement their own runtime
switching functionality.
Task-number: QTBUG-71856
Change-Id: Ic7782b7fa38d1121b140351f5eaa88ac027a6bcd
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Apply a couple of fixes to load icons correctly and preventing seg fault
in loading txt files in the documentviewer demo.
Change-Id: I5c3e8694abe37140d73da8b40204bc05aaf37e9c
Pick-to: 6.9 6.8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The documentviewer demo assumed, that Quick3D always comes with
AssetUtils installed. It attempted to create a RuntimeLoader instance
and asserted the result. This lead to a crash, when case AssetUtils were
not installed.
Don't assert, when no RuntimeLoader object can be instantiated. Return
an empty list of MIME types instead. Ignore plugins that don't support
any MIME types.
Fixes: QTBUG-128673
Pick-to: 6.8 6.8.0 6.7
Change-Id: Ib4771ba93dac2e0aab3a89b7e3cd7e64c97e4e5d
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Update code snippets to use JsonViewer as an example.
Add a section about loading plugins.
Task-number: QTBUG-119981
Pick-to: 6.7
Change-Id: Ied3dcba02ad275d16535ab015c49ce03ec0a0e30
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Remove definitions of onActionOpenTriggered() and
onActionQuitTriggered(), the implementation of which has been removed.
Change the required binary directory from "macOS" to "MacOS", to find
plugins correctly.
Fixes: QTBUG-117694
Pick-to: 6.6
Change-Id: Iba7d7c07e2881d2e8c4dce4b58f34a6441e8b467
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The plugin dlls are located in the "app" subdirectory of the
executable's path.
Search there.
Fixes: QTBUG-117691
Pick-to: 6.6 6.6.0
Change-Id: I467e90344e0a85384e8e06393fe41a98f1904bfc
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
This unearthes that JSON should convert from UTF-8.
Pick-to: 6.6
Change-Id: If155b745cac0579232b927a3988588204c31d207
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
When a file is opened and its mime type is not supported, the demo
falls back to TxtViewer.
This patch adds a warning popup to notify the user in that case.
Fixes: QTBUG-114614
Pick-to: 6.6
Change-Id: I5794d0013ecaac37934ac56c4a642998baa65e0a
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
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>