The example is currently in a state where qmllint produces no warning,
and should generally be kept in such a state.
Thus, add a configuration file that sets the warning limit to "0", such
that running the all_qmllint target for the example will fail if any
warning is produced, with the additional strictness hopefully helping
keeping the example warnings-free.
Pick-to: 6.10
Fixes: QTBUG-138175
Change-Id: If9adb0f4929fdb99272883ceccca9479bf640204
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
The `MediaPlayerApp` example has has a `MediaPlayer` QML module whose
`Main.qml` file defines a function, `openFile`, in the scope of the root
element, that is later used by a child element in a binding.
qmllint produces an [unqualified] access warning for this usage.
To avoid the warning being produced, the usage of the `openFile`
function in the child element was qualified with the id of the root
element.
Task-number: QTBUG-138175
Pick-to: 6.10
Change-Id: I11f8c02fb2c45c178f42770cb06badb3fb73c3e1
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
`MediaPlayerApp` depends on some additional custom QML modules that are
positioned such that they are siblings to each other.
By default they would not appear under the normal QML search path, such
that qmllint was failing to find them producing a series of [import]
warnings.
Add a direct dependency, based on CMake targets, to the custom
`Config` and `MediaControls` QWL modules to ensure that qmllint finds
them, thus fixing the warnings.
The `add_subdirectory` calls in the main `CmakeLists.txt` file of the
project were re-ordered to ensure that the dependencies targets are
known at the time we add them as a dependency.
Task-number: QTBUG-138175
Pick-to: 6.10
Change-Id: I5ce43606ae0458a572b97b6afb218aafa8ef87b8
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
The `MediaControls` QML module that is part of the `MediaPlayerApp`
example, imports a custom QML module, `Config`, that is defined in a
sibling directory.
The `Config` module exports a singleton and, when the singleton is
accessed, qmllint produces a series of [unqualified] access warnings.
Add a direct dependency to the custom `Config` QWL module to
ensure that qmllint recognizes the singleton, thus fixing the warnings.
To allow for the use of the modern, `TARGET` based, dependency
declaration method, introduced in 6.8, the `find_package` and
`qt_standard_project_setup` calls for the project were modified to
search and setup for the 6.8 version.
The `add_subdirectory` calls in the main `CmakeLists.txt` file of the
project were re-ordered to ensure that the `Config` target is known at
the time we add it as a dependency.
Task-number: QTBUG-138175
Pick-to: 6.10
Change-Id: I33cbbdd179d701a36bb5c4f38deca1102aa47a90
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
The project name is used in Qt Creator as root name for the project.
Using the same name as the documentation/example name makes it
clearer which example is actually open. Only drop prefixes like
'Qt Quick Demo - '.
Pick-to: 6.10
Change-Id: I863a23e26307a973bb04ce879d0c95c3731cdc53
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Updated the MediaPlayer example to use compile-time QML registration via
the QML_ELEMENT macros instead of qmlRegisterSingletonType. This aligns
the example with modern Qt 6 best practices and improves startup
performance and tooling integration.
Pick-to: 6.9 6.8
Task-number: QTBUG-136712
Change-Id: Id34670f4d45200b9a1424612f5a05bebead0a60e
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
This patch allows the user to change the audio device while a video or
audio file is being played in the media player app.
Before this change, audio would start playing on operating system's
default audio device, but it would not switch to another audio device
even if the user selected another device while the media was playing.
This patch uses a MediaDevices QML element to listen to audio device
changes from the operating system, and will automatically switch to the
device that is set as default at any time.
Fixes: QTBUG-119282
Pick-to: 6.8
Change-Id: Id1acfe9e9025a81c4cc3fa0e4593292f287f7b9a
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Qt Multimedia's media player, and QtScXml's media player used the same
mediaplayer.png filename on their respective application screenshot,
which caused the QtScXml example image to incorrectly be used with the
Qt Multimedia example.
Renaming the media player image from mediaplayer.png to
mediaplayerapp.png. This way the filename matches the CMake target name
for the application.
Fixes: QTBUG-129444
Pick-to: 6.8 6.7
Change-Id: Ie4d93d2cc5100a42faeec7828775b62a56d3ff23
Reviewed-by: Paul Wicking <paul.wicking@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>
There is an issue on Android where QFileDialog does not return real
filenames. Instead, it returns content URIs that do not seem appropriete
for displaying in playlist.
To ensure that filenames are displayed correctly, we need to use
QFileInfo. Since there is no QML type for QFileInfo, additional
FileNameProvider singleton type has been registered for QML use.
Fixes: QTBUG-122273
Pick-to: 6.7 6.5
Change-Id: Ib6bd152856a6979788bcbb203d58a38810ea0682
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The URL input field had a validation that limited the possible protocols
to only http, https, rtp, rtsp and udp.
This patch modifies the validation regular expression to allow for more
protocols supported by FFmpeg.
Pick-to: 6.7
Change-Id: I84861673a78d4317592f96b4a92d8e676b05660f
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Add return type annotation to validateUrl() function to get rid of a
warning when running the MediaPlayer demo.
Pick-to: 6.7
Change-Id: I2e0ac48f111e90d37d46dc8cd39adb3bcd228ca5
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
MediaPlayer demo was using themed text colors but native base colors in
the File menu. This caused issues with visibility if the contrast
between the colors was too low, at least on Gnome.
This patch updates the demo to use themed colors in the File menu, as
well as using the highlight color more appropriately for better
visibility in both dark and light themes.
Additionally, the highlight color is added to the theming singleton.
Pick-to: 6.7
Change-Id: I7baf0ce217e24112c8daabfdeec76e069c867062
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
If we have only 1 file and trying to shuffle, we enter an infinite
loop, while trying to find an index not equal to the current one.
We need an additional check to avoid this.
Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-122178
Change-Id: I299ef0f66adc271be5921a6f16eabde9b2021499
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Mikko Hallamaa <mikko.hallamaa@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
The MediaPlayer demo had an issue in the track options list where nested
scrolling caused some options to be difficult to access.
This is fixed by positioning all track options in a Column instead of a
ListView.
Additionally modified the TracksOptions implicit height binding to size
the component based on the amount of options.
Fixes: QTBUG-119285
Pick-to: 6.7 6.6
Change-Id: Iaa1ed2c370118a5c0119b233a59c7f4d8c0c70eb
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Lars Sutterud <lars.sutterud@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@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>
Add metadata about build time / runtime dependencies in the form
of Qt documentation modules. This should allow Qt Creator to hide
examples where needed Qt modules are not installed (because they
are optional in the Qt Online Installer).
Pick-to: 6.7
Task-number: QTBUG-120759
Change-Id: I03d8d75b273fe497803b9af9783b90e397b0638d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
There is no need to keep the example in the title, see also
https://wiki.qt.io/Qt6/Example-Guideline .
Pick-to: 6.7
Change-Id: If173285c2e0f0ef7d21a113e4e0713aef84511dc
Reviewed-by: Pranta Ghosh Dastider <pranta.dastider@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
In the Media player demo, when an audio file was played, the audio track
reverted to "No track". This was because the audio track index was set
to follow the selected video track index. This is now fixed.
Additionally fixed some warning spam caused by a missing function return
type.
Fixes: QTBUG-117647
Pick-to: 6.6 6.5
Change-Id: I3b8f331f23ff6a677785bc7456ee1cbc64f27842
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Playback control panel of Mediaplayer example did not fit to smaller
screen. It happened that playlist button goes outside of screen on
Android devices.
To make it fit, two icons (Rate_Icon and Mute_Icon) will be hidden on
smaller screens. Also some spacing will be smaller for portrait mode.
Pick-to: 6.6 6.5
Fixes: QTBUG-118043
Change-Id: Ic562ae7349f0b5d6b39b031dad9c4a4108027f7e
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Explicitly link to MediaPlayer module so it gets packaged to the APK.
* Allow the example to user nameFilters after the fix
0f4181919663e85ddc142456b357dcde3d0a4a7f.
Pick-to: 6.6
Change-Id: I16c2feccb90ce7448ae24d03868fbedf3c449e66
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Move all icons in an "icon" folder of the respective module.
Rename Config.iconSource() to Config.iconName() and change it to just
return the icon name according to theme without any path.
Add 2 singletons to each module providing iconSource() functions
doing the lookup relative to their locations.
Pick-to: 6.6
Task-number: PYSIDE-2206
Change-Id: I8e74ce633400ae170f0fdb467a2ae65f172319b8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Remove links to examples that no longer exist, and fix linking to
page/section titles that have changed.
Fix other minor issues in passing.
Pick-to: 6.5 6.6
Change-Id: I6420fd7319e021f8a31f1776b31fabd05631c145
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Establish a common file layout allowing
Python and C++ to use loadFromModule().
Add a manually created qmldir file for usage by Python and the qml tool
(note CMake will still generate its own).
Pick-to: 6.6
Task-number: PYSIDE-2206
Change-Id: Idf2564ed84bd6c95e76dacdfbc0a9691c64e5f15
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Make it a required property which is always set with a check.
Pick-to: 6.6
Change-Id: I7771bcbe7b3ccc798b885682135d501e2d4d60ee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
In addition to Application Example Media, Player is added to Mobile
category
Pick-to: 6.5.2 6.5 6.6
Change-Id: If4ba1813006fae626c6ea4a16f19bee34fc08f43
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
The same example exists in qtmultimedia, and it is using a similar
target name as well, which can breaks the top-level build, so we need a
new name for it. I thought since this is a demo project, and it's an
app, we can name it like the ToDoListApp.
Pick-to: 6.5 6.6
Change-Id: Ia91786f7a32e1263157091b10683cd5294c292a2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
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>
* Add missing */ in external-resources.qdoc
* Remove linking to 3rd party attribution pages that no longer exist
* Fix Media Player Example documentation
* Remove duplicate \example command
* Fix \image file name
Pick-to: 6.6 6.5
Change-Id: Ie26e4cc9105a5c728de2ec18b514b5d5ba3d61b9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Design of MultimediaPlayer example was refreshed.
New icons, colors, application structure were provided.
Some new functionalities were introduced to the sample:
playlist, shuffle, loop, dark mode.
Tested on Windows, Android Emulator, macOs, iOS emulator.
Change-Id: I38a8e203021edc97b70a4ab8f0d8d83c6d5ae45b
Pick-to: 6.5 6.6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>