Closed knoxfighter closed 2 months ago
RTFM: Don't drop the return value of the on_clicked
function.
#[must_use]
should be added to the QMetaObjectConnectionGuard
to prevent this in the future.
Also have a look at https://github.com/KDAB/cxx-qt/pull/622/ we've been building as an example for widgets.
Ah hmm, we used to have #[must_use]
but it must have been lost in the refactor to having QMetaObjectConnectionGuard
as it's own type.
Let change this issue to track adding back #[must_use]
to the connection calls.
So #932 adds must_use back in the right place for the changes in main
I mapped quite a few Widgets for my project. Now i want to use callbacks on a QPushButton. Unfortunately i am unable to make the
clicked
(on_clicked
) signal to work. It seems like the function is never called.Example code:
Definition of the signal:
I pushed the full example to my fork of this project: https://github.com/binja-tools/cxx-qt/tree/test-button/examples/cargo_without_cmake_2
Am i doing something wrong or is this not implemented for C++Qt classes?