Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2715

pyside6-project: make it customizable and general improvements

    XMLWordPrintable

Details

    • User Story
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • Tooling
    • None
    • All

    Description

      Based on feedback from Solution Engineering:

      The biggest issue with this tool is the lack of customizability. The .pyproject file used to store project data provides no options for altering the behavior of sub-tools like pyside6-uic. For instance, if I wanted to provide the --no-autoconnection option when compiling .ui files, I can no longer use pyside6-project. The build command also assumes that all resources should be compiled and saved in the to the same directory as the source file (e.g. “/data/qrc/icons.qrc” >>> “/data/qrc/rc_icons.py”). There is no ability to specify an output file path for any compiled resources so if don’t want to store .ui files and .qrc files within my Python modules, I can no longer use just pyside6-project. The only customization option that I am aware of is the ability to define input paths for sources in the .pyproject file. Even in this case however, the user experience isn’t great since every file needs to be explicitly defined. Since I tend to keep all of my .ui files under a single directory (plus some subdirectories for larger projects), it would be far, far more pleasant if I could just specify a glob pattern (e.g. “/data/ui/*/.ui” instead of “/data/ui/main_window.ui”, “/data/ui/docks/dock_widget_1.ui”, “/data/ui/docks/dock_widget_2.ui”, …). 

      To resolve these shortcomings, I had previously come up with some ideas on how to provide the kind of customization I’m looking for in a configuration file. The attached example.pyproject file represents my attempt to adapt those customization features into a proposal for what an updated .pyproject file format might look like and how it could be used. 

      Additional Minor Issues

      • The new-ui command could benefit from including a .qrc file that the .ui file includes as a resourceo   Currently I don’t believe there are any examples that show how to use the Qt resource systemo   It took me a long time to realize how I could leverage .qrc files in Qt Designer and I wish I could’ve discovered this sooner
      • The --dry-run option does not work when running the new-ui, new-widget, or new-quick commando   The project files are always generated
      • --help option is misleading when creating a new projecto   The usage prompt implies that you should provide a path to a .pyproject file when creating a new projecto   The new project commands actually expect a path to a directory that should contain the new .pyproject file
      • The --qml-module option’s purpose is unclear.  The help text says that it is used to “Perform check for QML module”o   Running `pyside6-project --qml-module` simply errors out with the message “error: the following arguments are required: mode”

      Attachments

        Issue Links

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

          Activity

            People

              shpremna Shyamnath Premnadh
              shpremna Shyamnath Premnadh
              Cristian Maureira-Fredes Cristian Maureira-Fredes
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes