From: Stefano Crocco Date: 2012-08-31T20:10:13+09:00 Subject: Re: Qt signals driving me crazy On Friday 31 August 2012 Damjan Rems wrote > Stefano Crocco wrote in post #1074007: > > On Friday 31 August 2012 Damjan Rems wrote > > > >> by > >> TheR > > > > The correct signature for the signal is > > > > 'itemActivated( QTreeWidgetItem*, int )' > > > > while you used > > > > 'itemActivated(TreeWidgetItem*, int )' > > > > without the leading Q. You have the same problem in a couple of other > > places. > > Generally speaking, when you have problems with a signal-slot > > connection, one > > of the first things to do is to look at the output on standard error and > > see > > if you see a warning saying 'not such a signal' or 'not such a slot' > > (this > > warning is shown even if you're running ruby with warnings turned off, > > since > > it is generated from the Qt library on the C++ side. Unfortunately, it > > doesn't > > tell you where the wrong signal or slot name is). > > > > I hope this helps > > > > Stefano > > Thanks for your answer, I have already tried that too. Do you mean that after replacing TreeWidgetItem with QTreeWidgetItem your nitem_clicked slot still doesn't get called? If so, that's weird, since I tried it and it works for me. > > I oversleep problem a little, looked into source code and found > metaObject().signalNames method. The catch is that if I create > TreeWidget like: > > t = Qt::TreeWidget.new > p t.metaObject().signalNames > > I get nice output of all available signals, but if I write > > p self.metaObject().signalNames > > inside my defined TreeView class i get []. Where is the catch? > > > by > TheR It may be a bug in qtruby, but I'm not sure. You can ask on the QtRuby mailing list (subscribing at https://mail.kde.org/mailman/listinfo/kde-bindings). If you don't, I'll do that one of the next days, as soon as I have a bit of free time. However, I've noticed that if I define a new signal in the custom class, metaObject#signalNames returns it, but it still doesn't contain signals from the base class. Stefano