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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Won't Do
    • Affects Version/s: 6.1.0
    • Fix Version/s: 6.1.1
    • Component/s: PySide
    • Labels:
      None

      Description

      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

       

       

        Attachments

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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes