Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add subclassing support #78

Merged
merged 22 commits into from
Nov 19, 2024
Merged

Add subclassing support #78

merged 22 commits into from
Nov 19, 2024

Conversation

mappu
Copy link
Owner

@mappu mappu commented Nov 15, 2024

Fixes: #42

Fixes: #69

Fixes: #80

Subclass all Qt classes containing virtual methods, and add On() wrapper functions to implement the virtual override. This works for all virtual methods including paintEvent and overloaded operators.

C++ virtual subclasses have a different pointer value. Change CABI constructors to return every virtual subclass pointer so that Go types can be accurate.

Add support for calling super() in overloaded callbacks.


Remaining work:

  • Fix remaining compile issues
    • Fix defer free happening too early in miqt_exec_callback_QAccessibleWidget_Relations
  • Add super() helper to Go callback
  • Check if compile time is reasonable or if other mitigation is required (e.g. move every class into an optional Go subpackage)
    • Seems about 20% slower
  • Add example
  • Usage guide in the README

@mappu mappu marked this pull request as draft November 15, 2024 02:42
@mappu mappu force-pushed the miqt-subclass branch 2 times, most recently from 4cf9d12 to 536b2d6 Compare November 15, 2024 07:01
@mappu mappu marked this pull request as ready for review November 19, 2024 07:48
@mappu mappu changed the title WIP: Add subclassing support Add subclassing support Nov 19, 2024
@mappu mappu merged commit 7d59d56 into master Nov 19, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant