qt-light/examples/custom-widgets/README.md
Jaidyn Ann 1704d392e8 Add “custom-widgets” example
This small example demonstrates defining and
binding to your own subclass of a QT widget.
2024-02-04 15:10:37 -06:00

658 B
Raw Blame History

“Goodbye” example

This is a bare-minimum example egg that shows how one can define their own custom QT widgets and bind to their methods in a way compatible with qt-light.

It defines an OurButton C++ class that is derived from QPushButton with one change:
It adds a SayGoodbye() method that changes the buttons label to “Goodbye”.

We write a wrapper C-function gb_saygoodbye() and bind this function into our goodbye-widgets module under the name gb:saygoodbye. It is run on the button (originally labelled “Quit” in the goodbye.ui file), so changing its text to “Goodbye”.