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

Automatically camelCase property, slot and signal names for QML when importing feature snake_case

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Not Evaluated Not Evaluated
    • 6.1.1
    • 6.1.0
    • PySide
    • None

      When importing `snake_case` from `__feature__` I would expect Qt properties defined in Python to be automatically converted to camelCase naming for QML.

      The property `some_value` in the example can't be accessed from within QML, I would expect to be able to access the property using `someValue` (marked [1]). Note that it still possible to access the property using Javascripts [ ] syntax and the snake_case name.

      Moreover, the same is true for Slots (marked [2]) and Signals (marked [3]). I know that the Slot decorator has an optional `name` argument, but an auto-conversion would be preferred.

      The code preview here is terrible, so I hosted the example on GitHub: https://github.com/machinekoder/pyside6_snake_case_example

       

       

        1. main_snake_prop.py
          2 kB
          Christian Tismer
        2. main_snake.py
          2 kB
          Christian Tismer
        3. main.py
          2 kB
          Christian Tismer
        4. main.qml
          0.8 kB
          Christian Tismer
        5. pyside1567.zip
          2 kB
          Friedemann Kleint
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ctismer Christian Tismer
            strahlex Alexander Rössler
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes