Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.9.1
-
None
Description
When a user opens an example in Qt Creator, it does check whether the example directory is writable. If not, it asks for a new location, and copies over the directory containing the example .pro file.
However a lot of examples share code or resources outside of the example project folder. Some offenders are
- qtnetwork (network/shared)
- qtdeclarative (quick/shared, quick/scenegraph/shared, quick/tutorials/samegame/shared)
- qtwebchannel (webchannel/shared)
...
To mitigate this, we have several alternatives
Make all examples self-contained
No example should reference files outside of it's directory. This will lead to code duplication in the git sources.
List all shared files per example in the examples manifest file.
Then Qt Creator could try to copy all relevant files. This would require extending QtC and qdoc. Also, the current 'metadata' that qdoc parses is not bundled with the examples, but in a .qdocinc file, so this needs some extra care in maintenance.
Parse the .pro files for shared sources
Qt Creator could parse the .pro file to understand all the included files. This requires using a specific Qt version, which is decided only later on. Also, in some cases the shared resources are not actually sources (say an .html file), and is just copied by qmake 'magic'. This would probably mean Qt Creator would just look into some macros, and might still miss files.
Let Qt Creator copy a whole example tree.
The examples-manifest.xml file already defines a 'module' that the examples are grouped by. This module could be extended to contain the base directory. Qt Creator would then copy the whole directory tree.
This raises quite some questions though:
- Should we set up a common shadow build structure (taking the module version into account), instead of always asking the user for a target directory?
- What if the user opens another example out of the same module? Can the copied structure be reused? How should conflicts be resolved in case the user modified a shared file?
Attachments
Issue Links
- is required for
-
QTBUG-37969 Examples do not work in Qt creator when installed in /opt (rcc:-1: error: File does not exist '../../shared/shared.qrc')
- Closed
- mentioned in
-
Page Loading...