I've done some experiments and it seems that Qt can send its
triggered(checked) signal to callables that accept zero or more
arguments.

  foo.triggered.connect(lambda: do_something())
and
  foo.triggered.connect(lambda checked: do_something())

both work, it must either check or try/except the number of arguments
the slot will take, and include its checked bool if the slot takes
more than zero arguments.

Bottom line, you need to account for the checked argument unless your
slot accepts zero arguments, this is a bit inconsistent, which is why
I'm pointing it out, in particular an unexpected bool as the first
argument to a bound method gives you an invalid self value.  That in
itself seems odd, you usually can't displace the self on a bound
method, but these are SIP(?) bindings to the underlying C++ library, so
the rules are different.

The old style connect syntax allowed you to specify whether the checked
arg was included or not, that's why this needs case by case auditing
for the new style connections.

Background: checked refers to whether the thing that generated the
signal had an option checkbox checked when it was triggered, as menu
items and buttons may sometimes do.

Cheers -Terry

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at http://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to