mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
doc/README: add note regarding virtual subclassing
This commit is contained in:
parent
bbc75b8ef1
commit
1b577f86bd
@ -85,6 +85,8 @@ Where Qt returns a C++ object by value (e.g. `QSize`), the binding may have move
|
||||
|
||||
The `connect(sourceObject, sourceSignal, targetObject, targetSlot)` is projected as `targetObject.onSourceSignal(func()...)`.
|
||||
|
||||
- You can also override virtual methods like PaintEvent in the same way. Your callback `func()` receives `super()` as a first argument that can be used to call the base class implementation.
|
||||
|
||||
Qt class inherited types are projected as a Go embedded struct. For example, to pass a `var myLabel *qt.QLabel` to a function taking only the `*qt.QWidget` base class, write `myLabel.QWidget`.
|
||||
|
||||
- When a Qt subclass adds a method overload (e.g. `QMenu::addAction(QString)` vs `QWidget::addAction(QAction*)`), the base class version is shadowed and can only be called via `myQMenu.QWidget.AddAction(QAction*)`.
|
||||
|
Loading…
Reference in New Issue
Block a user