Skip to content

Using "Object" in a slot? #77

Closed Answered by omix
tcrane20 asked this question in Q&A
Sep 4, 2022 · 1 comments · 6 replies
Discussion options

You must be logged in to vote

Actually, your connection is never initialized and connect() returns null. That is because the signal-slot connection is created natively, i.e. by Qt. Qt cannot connect signal parameter int to slot parameter QVariant (=Object). Initialize the connection with lambda expression instead:

spinner.valueChanged.connect(v->foo.onChanged(v));

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@omix
Comment options

omix Sep 5, 2022
Maintainer

@tcrane20
Comment options

@omix
Comment options

omix Sep 6, 2022
Maintainer

@omix
Comment options

omix Sep 6, 2022
Maintainer

@tcrane20
Comment options

Answer selected by omix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants