Solved Slot never called
-
Looks like you misplaced something. finished() should be a public method (a signal).
Chris, in Qt4 signals used to be protected, so it might be simply that he's using a bit older version than we assumed. ;)
-
awww, ok. Good catch guys.
@Helson so just replace
connect(d, &Downloader::finished, d, &Downloader::deleteLater);
with
connect(d, SIGNAL(finished()), d, SLOT(deleteLater()));
and think about upgrading to Qt5. Especially since you're following tutorials there's no point in learning obsolete stuff.
-
@Chris-Kawa said:
connect(d, SIGNAL(finished()), d, SLOT(deleteLater()));we did. still said it was protected ?!
so we moved to ctor in Download class -
so we moved to ctor in Download class
Don't do that. It makes your class dependent on being created on the heap, which you can't guarantee. If someone creates it on the stack you will crash on double delete.
-
@Chris-Kawa
Ah yes I see. Luckily we did not do it, ;)
we moved to dodownload member function and
used old syntax.Im not used to Qt4 so the whole protected signals were
confusing. -
Im not used to Qt4 so the whole protected signals were
confusing.If you think about it, semantically it's more correct that signals are
protected
. A signal is raised from the object itself to notify others and in principle shouldn't be available for others to emit it! My suspicion is that they're nowpublic
because of the new way of connecting, which by my opinion is not such an improvement over the old one.PS.
Is it me, or the forum is going nuts? I have the distinct feeling that I see Helson's posts as mrjj's? -
hi, I talked with him in chat also, so I did post here.
Forums crash every 2 minutes for me though. -
@mrjj
Yes, but who are you? Are you indeed mrjj, or there's some bug in the forum and you're in fact Helson? :) -
@kshegunov
Heh. Im mrjj
(i hope) -
@mrjj
Ok, because I would have expected this:Ah yes I see. Luckily we did not do it, ;)
we moved to dodownload member function and
used old syntax.to be written by Helson. So it's my mistake, sorry for the misunderstanding. :)
-
@kshegunov
well You should have the credits as you solved it :)
and sorry for writing a bit unclear :) -
@mrjj
Thanks for the credits, although I'm not sure how much I care about them, still I appreciate the sentiment. :)