Commit Graph

4 Commits

Author SHA1 Message Date
Alexandru Croitor 9cbf4d2cc8 CMake: qmake: Fix chapter6-plugins example to build in more configs
Before this change, I tested the following configurations / scenarios

 (1) shared Qt + qmake + macOS bundle -> works
 (2) shared Qt + CMake + macOS bundle -> broken
 (3) static Qt + qmake + macOS bundle -> broken
 (4) static Qt + CMake + macOS bundle -> works

 (2) was broken because the shared qml plugin is not located in the
 expected location (see below)
 (3) was broken because qmake needs a lot of error-prone boilerplate
 to ensure static qml plugin building and linking works.

The change fixes the example to build and run successfully in case
(2).

Tested the following scenarios on macOS with the change

  shared Qt + qmake + macOS bundle -> works
  shared Qt + CMake + macOS bundle -> works
  shared Qt + qmake + no bundle    -> works
  shared Qt + CMake + no bundle    -> works
  static Qt + qmake                -> still broken
  static Qt + CMake                -> works

To make shared qml plugins be found in a macOS bundle, we need to copy
the qmldir and plugin under the bundle's PlugIns subfolder, because
the application adds that as the expected qml import path for macOS.
This basically mimics what the qmake project does with
QMAKE_BUNDLE_DATA.

The change also cleans up the CMake projects a bit so they don't link
PUBLIC-ly against dependencies, install the plugin under a more
sensible location and don't needlessly setup package finding and other
boilerplate that's done in the parent project.

The change also cleans up the qmake projects to adjust to not pollute
the macos bundle dir with static plugin files.

Amends 9e1d2a0eb1

Pick-to: 6.2
Change-Id: I45bb699a67adf598587350a03f778291fad3f850
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-08-31 14:51:25 +10:00
Oswald Buddenhagen ee874f7e0a actually build and install the qml tutorials
Change-Id: Idf81981140e210b29239e91ff5b6b7c40e2f36de
Reviewed-by: Topi Reiniö <topi.reinio@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2016-05-13 04:35:27 +00:00
Topi Reinio 35e2f29cde QML extensions tutorial: Add import plugin to app. bundle on OS X
The application in chapter 6 of this tutorial failed to import
the custom extension plugin on OS X, as it could not see it's
import path outside the application bundle.

Change-Id: Icdca1f0553020e0460e4efabc5461a3447b32086
Task-number: QTBUG-47003
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-04-16 02:25:23 +00:00
Topi Reinio fccf0e2912 Doc: Combine the extending QML tutorial chapters into a single example
Combine the six examples associated with each tutorial chapter
into a single, top-level example project 'extending-qml', with
subprojects for each of the tutorial chapters.

Clean up the docs, add links, and a note about a warning that
the user may see when running the code in the first chapter.

Task-number: QTBUG-32947
Change-Id: Idba4e2153817ab29f1afaf1947d1f2e25964e7b3
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2014-09-30 12:33:22 +02:00