Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63024

Examples requiring shared sources do break Qt Creator workflow

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.9.1
    • Examples and Demos, Other
    • 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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              docteam Qt Documentation Team
              kkohne Kai Köhne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes