Commit Graph

9 Commits

Author SHA1 Message Date
Kai Köhne cdf4314acc lightningviewer: Clear font handling
While 'SF Pro Display' is the macOS default font, it is not accessible
under this name even on macOS:

    qt.qpa.fonts: Populating font family aliases took 111 ms. Replace uses of missing font family "SF Pro Display" with one that exists to avoid this cost.

Remove the font, and rely on the default system font. While at it,
also remove other font properties that are in the default range.

Pick-to: 6.10
Fixes: QTBUG-138174
Change-Id: Ie1a75aee7c74386ae5db982e3ef878496e521e8c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2025-07-29 08:22:53 +02:00
Kai Köhne ed39f939d1 lightingviewer: Improve build system
Call the executable "lightingviewer", except on macOS, where
it is "Lightning Viewer". Call the top-level project
LightingViewer.

Remove the project setup in the included CMakeLists.txt
files; they are not separate projects on their own in a
meaningful way.

Pick-to: 6.10
Change-Id: I05db4a318f2667a8ed41c943594310a49000cc11
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2025-07-08 16:28:20 +02:00
Alexandru Croitor 4fc0afc2b4 CMake: Alternative fix of deployment for lightningviewer example
qmlimportscanner is used to scan the qml files, to decide which
plugins and libraries to deploy. Because none of the qml files
explicitly reference the LightningViewer or LightningViewerStyle
imports, it never deploys the qml modules, nor their dependencies.

This change adds a Deployment.qml file to the sources, which is not
actually used at runtime, but because qmlimportscanner sees it, due to
scanning the whole project directory, it will deploy the necessary
files.

Pick-to: 6.7 6.8
Fixes: QTBUG-127835
Task-number: QTBUG-128225
Change-Id: Ic5185d723d3a1f65427af1ee7799fa49ea414cfd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: MohammadHossein Qanbari <mohammad.qanbari@qt.io>
2024-08-20 13:28:51 +00:00
MohammadHossein Qanbari 84e962eae5 LightningViewer Example: add 'import QtQuick.Control.impl'
There was a missing import. The 'QtQuick.Controls.impl' is required to
be imported when instantiating IconLabel.
Missing this import makes the example fail to run as the IconLabel type
is not known.

Change-Id: I1bc2baa150678d7398fdff5f9a5d867c73113277
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Even Oscar Andersen <even.oscar.andersen@qt.io>
2024-05-14 08:57:46 +00:00
Alexandru Croitor cde9cfb96c CMake: Add deployment API to our examples
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>
2024-05-13 09:44:04 +02:00
Lucie Gérard 8b36425fab Correct build system file license under example
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>
2024-03-19 08:20:16 +01:00
MohammadHossein Qanbari c5fe729e0c Lightning Viewer Example: Remove Qt5Compat Dependency
The ColorOverlay is replaced with IconLabel to remove the dependency on
Qt5Compat.GraphicalEffects.

Fixes: QTBUG-121929
Pick-to: 6.7
Change-Id: I7dc6fd6538a2a1dd3c1e20a4dd401137a9e1030a
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-07 11:15:31 +01:00
MohammadHossein Qanbari 6cc0edc108 Lightning Viewer Example: Support LocationPermission
If the permission is granted, the user location will be visible and the
map view can be recentered.
Otherwise, if the user has already denied the permission and triggers
any action that needs the permission, a message dialog will notify the
user that the application needs the location permission, and the
permission is needed to be granted and the application needs to be
restarted.

Additionally, the PositionSource is not active when the permission is
not granted, and the distance and time layer is not able to show the
information until the user allows the application to use the location.

The user's location will be set from QML by PositionSource, then there
is no need to keep the QGeoPositionInfoSource object.

Task-number: QTBUG-121412
Task-number: QTBUG-121123
Pick-to: 6.7
Change-Id: I78856f8cc8d182aa7b02c1ffaba01a8871e0a0c6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-01 14:15:21 +01:00
MohammadHossein Qanbari 0f8bf79538 Lightning Viewer Example: Use QML Module and Restructure Project Files
Restructure resource file management by relocating QML and asset files
from the resource files (qrc) to their respective modules within the
application. Moreover, the project has been divided into two distinct
submodules: LightningViewer and LightningViewerStyle.

The LightningViewer module includes the project's sources, QML files,
and assets, used for the model, view, and controller aspects.

On the other hand, the LightningViewerStyle module is dedicated to
defining a custom style generated by a tool. The purpose of separating
style-related files from LightningViewer is to simplify updates by
allowing the style generator tool to only modify contents within the
style subdirectory.

Task-number: QTBUG-121123
Pick-to: 6.7
Change-Id: Ib04fb156bd47b4033526c8eb9b33ccab76ab50e9
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-01-26 14:21:19 +01:00