Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-3974

Allow adding "directory imports" in QDS

    XMLWordPrintable

Details

    • Task
    • Resolution: Done
    • P1: Critical
    • QDS 2.1 Beta2
    • QDS 2.0 Beta
    • Component Library
    • None
    • 1
    • c11f5ebd4205ff66559ed625adb620420bb3bea7 (qt-creator/qt-creator/4.15)
    • QDS 3D - 11/12

    Description

      In QDS 2.0 it is possible to add so-called directory imports:

      In this case "CP 2Horizotnal Layout" is an import that "imports" a sub folder.

      This import will make all types in the subfolder available.

      In QDS 2.1 this kind of import cannot be added using the UI.

      Directory imports are crucial for large projects and the standard Qt Bridge workflow.

      As far as I can see direcotry imports were not handled explictly in QDS 2.0:

      m_addImportComboBox->addItem(possibleImport.toString(true), QVariant::fromValue(possibleImport));
      

      https://github.com/qt-creator/qt-creator/blob/4.14/src/plugins/qmldesigner/components/importmanager/importswidget.cpp

      The distinction is built in into QmlDesigner::Import:

       bool isFileImport() const { return m_url.isEmpty() && !m_file.isEmpty(); }
       bool isLibraryImport() const { return !m_url.isEmpty() && m_file.isEmpty(); }
      

      Most likely the issue is in the frontend and the new code relies on an existing url, while directory imports only have file.

      Attachments

        1. screenshot-1.png
          screenshot-1.png
          21 kB
        2. screenshot-2.png
          screenshot-2.png
          24 kB
        3. screenshot-3.png
          screenshot-3.png
          105 kB
        4. screenshot-4.png
          screenshot-4.png
          78 kB

        Issue Links

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

          Activity

            People

              mabadri Mahmoud Badri
              thohartm Thomas Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes