ITADN
mappu/miqt/Issues

How to override a method on a native widget class

#318Opendjmattyg007 创建于 2026-02-21
D
djmattyg007commented
I'm trying to create a custom button widget (that extends from `QPushButton`) with some small custom functionality that overrides the return values for the `Icon()` and `ToolTip()` methods based on other logic. I'm not sure how to achieve this though. If I create an object from a struct like so: ```go type MyButton struct { qt6.QPushButton } ... myBtn := &MyButton{} ``` Then none of the C binding code is called, and the program segfaults. I can see that there's a "subclass" program in the examples folder, but it doesn't look like any actual subclassing is happening I'm not really sure what to make of it, because there's no accompanying explanation of what the example is meant to be doing.
4 条评论