On Sun, 15 Jun 2014 11:53:07 -0500 "'Terry Brown' via leo-editor" <leo-editor@googlegroups.com> wrote:
Another instance of this trap: https://github.com/leo-editor/leo-editor/commit/ecca25af I think searching for all occurrences of clicked() and triggered() with both kinds of quotes would find these. In the above fix I didn't follow my own advice, "make the callbacks match the basic definition of the signals", hmmm. Cheers -Terry > Here's a trap though: > > - def setter(pri=pri): o.setPri(pri) > - self.connect(w, QtCore.SIGNAL("clicked()"), setter) > + def setter(pri=pri): > + o.setPri(pri) > + if isQt5: > + w.clicked.connect(setter) > + else: > + self.connect(w, QtCore.SIGNAL("clicked()"), > setter) > > The old form calls setter() with no parameters, the new form calls > setter with `bool is_checked`, seeing buttons can be checked or > unchecked when they're clicked. > > I think the best solution is to change setter() to be > def setter(checked, pri=pri): ... > which will work in both Qt4 and Qt5, basically the old > style .connect() let you select whether that parameter got passed or > not, but I think everything's cleaner if we just make the callbacks > match the basic definition of the signals. -- 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.