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

shiboken: Refactor code handling C++ types

    Details

    • Type: Task
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.9
    • Fix Version/s: 5.12
    • Component/s: Shiboken
    • Labels:
      None
    • Environment:

      All

    • Technical Risk:
      Normal

      Description

      The implementation of C++ types in shiboken has some issues that block adding more advanced types:

      Complexity, duplicated types

      • Several types represent a C++ type: TypeInfo (Codemodel), TypeParser::Info (done. removed), AddedFunction::TypeInfo. In addition, the code-model related types are eventually used to populate AbstractMetaType
      • Parsing of type code snippets happens in several places
        • abstractmetabuilder.cpp:64 parseTemplateType() for AddedFunction
        • AbstractMetaBuilder::translateType (reparses TypeInfo::toString() back into TypeInfo to normalize signatures, apparently)
        • AddedFunction::TypeInfo::fromSignature() for reading XML, handles only limited subset
        • ShibokenGenerator::buildAbstractMetaTypeFromString()

      Representation of const

      TypeInfo, AbstractMetaType only have isConstant(), which is true for const int *
      which technically (and in Clang representation) is not const, (the pointee is). It is thus not possible to differentiate from const int *const or int *const which is truly const. This causes subtle issues:

      • Some signatures for querying the function documentation do not match (doc generator)
      • No setters are generated for field types like const QWidget * (QStyleOptionViewItem)
      • Patterns for matching rejections and modifications are a bit strange ( bool volatile* instead of volatile bool *)

      Plans

      A lot of needed information is readily available from Clang. So, introducing a type which represents all the information from Clang would be useful

      One issue to consider is that doc-generation (namely the creation of XQueries for the WebXML doc extraction from function signatures) requires using unresolved typedefs (GLEnum instead of unsigned).

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                kleint Friedemann Kleint
                Reporter:
                kleint Friedemann Kleint
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Gerrit Reviews Side Panel

                  Error rendering 'com.meetme.plugins.jira.gerrit-plugin:gerrit-reviews-side-panel'. Please contact your Jira administrators.