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>
The toplevel CMakeLists.txt file already states we need Qt 6.8 minimum.
Pick-to: 6.10
Change-Id: Ic02179847c72c9d4ee967e4b9b4e9135a223163f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The included CMakeLists.txt files are _not_ standalone projects,
so remove any project() as well as duplicated find_package() calls.
Pick-to: 6.10
Change-Id: Ia56128e19588d38eb3c91fac7e9a188f82146515
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This is a cleaner approach then manually tweaking the dependent targets
include directories.
Pick-to: 6.10
Change-Id: I8382f5556c950398e8a553a77f380922ed14ae9b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
* Do not use the QT_ prefix, as that is reserved for Qt itself,
not client code (which an example is).
* Do not define the define on a global level, but as a PUBLIC
target definition for the abstractviewer library.
Pick-to: 6.10
Change-Id: I01a001b0c0706e9f951118472fe1a62ff68a2e4e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Remove redundant translations for <number>% and use QLocale::percent()
instead.
Pick-to: 6.10
Change-Id: I6ddeceda6f723aae0c2a7f8338ce2d436ea434e2
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Adding a tooltip to only one of the action looks weird. As the
tooltip is not much better than the default text just remove.
Pick-to: 6.10
Change-Id: I26d76aa8c6ecdf9b8d9fadd8efa2afe4b898adac
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Previously, only the imageviewer plugin had a retranslate() method,
which meant that when switching languages, UI texts in other plugins
(jsonviewer, txtviewer, pdfviewer) would not be updated.
This change adds retranslate() methods to all plugins that contain
translatable UI text:
- jsonviewer: Updates menu titles, toolbar titles, actions, tab titles,
and bookmark tooltips
- txtviewer: Updates menu titles, toolbar titles, and action texts/tooltips
- pdfviewer: Updates toolbar title, action texts/tooltips, and tab titles
Each plugin now stores references to UI elements that need retranslation
and implements the retranslate() method to update all translatable text
when the language is changed.
Fixes: QTBUG-138344
Pick-to: 6.10
Change-Id: I9d294694a42c2c48e03b72e28e9c0f4015cd5c80
Reviewed-by: Masoud Jami <masoud.jami@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This patch replaces the SVG icons with Qt minimalistic icons and
resolves the warnings about the non-supported SVG properties.
Fixes: QTBUG-138169
Pick-to: 6.10 6.9 6.8
Change-Id: Ib290c15d1498945149ba4425062268619bfe2a33
Reviewed-by: Joerg Bornemann <joerg.bornemann@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>
Use modern theme icons. Add standard shortcuts to the PDF
viewer actions. Remove duplicated adding to the toolbar.
Pick-to: 6.8
Change-Id: I4cfe33c7b8fcc3c070f5c0542b821dd9393bfe2d
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Projects were modified using the tool at:
https://git.qt.io/alcroito/cmake_refactor
Some examples had to be adapted manually, mostly those that build
additional qml modules / plugins.
documentviewer did not get the deployment api, because it's trickier.
Pick-to: 6.7
Task-number: QTBUG-101340
Task-number: QTBUG-102056
Task-number: QTBUG-102057
Change-Id: I76322185fc824c112d77e077ee39e7ccbc193a4c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
According to QUIP-18 [1] all files under examples
should be licensed
LicenseRef-Qt-Commercial OR BSD-3-Clause
[1]: https://contribute.qt-project.org/quips/18
Pick-to: 6.7 6.7.0
Task-number: QTBUG-121787
Change-Id: Ia2e8f62af64a384196a9b0c02ac5b2fbf5404a8b
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Projects need install instructions to be usable on embedded platforms.
Fix existing instructions to put files into correct places.
Fixes: QTBUG-112024
Pick-to: 6.7
Change-Id: I6a3d84edc1c67281d5497e99144c159faf0f783c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Viewer plugins may connect to the central back/forward buttons.
If they disconnect those explicitly in their cleanup methods, the
buttons are nullptr when the application is closed. This lead to a
warning.
Save the QMetaObject::Connection object in a list in Abstractviewer
and directly disconnect it from AbstractViewer::cleanup. That way,
QObject::disconnect is never called with a nullptr argument.
Amends 1f6505a0cf.
Pick-to: 6.6
Change-Id: I4fee76d507f3329fef31e6c9171694ea82914239
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@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>
QPdfPageSelector changed from being a QSpinBox to just a QWidget that
has-a QSpinBox. This code shows why that was a good idea: users are
supposed to call setDocument(), not manipulate QSpinBox::maxiumum()
manually.
Pick-to: 6.6 6.6.0
Fixes: QTBUG-116987
Change-Id: I35ed7786b7e257c8c9aba70671d739db02d7589d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Apply a few fixes that were already done for the other plugins.
Pick-to: 6.6
Change-Id: I3b94547023f77952a670cb7c0385b15e7ddd03ce
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Apparently, QPdfViewer needs an open file.
Pick-to: 6.6
Change-Id: I891f6eeb5a96344bdfce483e77c67b80b1666676
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The DocumentViewer demo was originally developed as a self-contained
application. Its dependency to PdfWidgets has lead to splitting it up
into plugins: ba61af0bf3
The new architecture re-uses the viewer objects, but it doesn't reset
them properly. This is why viewer-specific UI-assets (menus, toolbars
and buttons) get duplicated.
This patch adds cleanup functionality and removes duplications.
Fixes: QTBUG-114615
Fixes: QTBUG-114617
Pick-to: 6.6
Change-Id: I4f123f8a69be978f992531603b15de71069d5a66
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
abstractviewer.cpp is compiled 3 times, once for each plugin.
That leads to duplicate symbol compiler warnings on macOS and makes
the demo unusable on macOS.
This patch turns the class in to a static library and links it into
the plugins.
Fixes: QTBUG-114370
Fixes: QTBUG-114618
Pick-to: 6.6
Change-Id: I7c785e4d463bc908c8df707f1a45301731c4da35
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Sprinkle some QT_BEGIN_NAMESPACE in the right places to avoid build
failures.
Pick-to: 6.5 6.6
Change-Id: I9cbfadb414881ef32405f0ad99c1009e89466490
Reviewed-by: Alexey Edelev <alexey.edelev@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>