Skip to content

Conversation

@HertzDevil
Copy link
Contributor

This PR adds support for two kinds of aliases:

  • Aliased names inside template type arguments, e.g. QVector<QRgb> now resolves properly to QVector<unsigned int>. Both C++ types will use the same wrapper, so the former container is no longer instantiated separately, as required by Generic pseudo-instantiation macro for container wrapper types #102.
  • Aliases to container instantiations, e.g. QObjectList now resolves properly to QList<QObject *>. Consequently, the wrapper for QObject::children() will no longer return a raw pointer to the container after this PR, as long as the appropriate alias is defined in the config file:
    types:
      QObjectList: { alias_for: "QList<QObject *>" }

Due to recent changes, the type database now has separate rule entries for actual C++ containers (e.g. QList<QWindow *>) and their template-less aliases (e.g. Container_QList_QWindow_X_). This shouldn't affect any existing bindings; in particular, typedefs in the C++ wrappers are unaffected because they are populated by Graph::Alias instead.

@Papierkorb Papierkorb merged commit 6b94540 into Papierkorb:master Nov 14, 2020
@Papierkorb
Copy link
Owner

Thanks!

@HertzDevil HertzDevil deleted the aliased-templates branch November 14, 2020 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants