Registered Member
|
So, I'm trying to do some work on the media player plugin right now.
I want the video widget to have the current time and total time next to the SeekSlider. So, I've added a QLabel in the constructor in videowidget.cpp, which I want to update whenever the mediaObject emits a tick, which you have set to happen ever second in mediaplayer.cpp. So, I've added this:
And updateTime() sets the text in the QLabel. It works fine when I call it from the constructor or onStateChanged(). However, it does not receive any tick signals. There are no compile / linking errors or warnings of any kind. The moc files also look correct. I've had this problem before, always when creating a new slot. If I connect the signal to an existing slot, it works. The problem always just seems to go away without a reason, when I make clean or clear my ccache or something like that. This time, I've cleared my ccache and deleted my whole build directory without any luck. Any suggestions? What am I missing / doing wrong? |
Moderator
|
First of all, you shouldn't put the parameter name in the SIGNAL and SLOT macros.
Second, I had this problem to and managed to work around it by removing the generated automoc.cpp files. Since I upgraded to KDE4.1, I haven't seen it yet (though it could just be that I haven't added a slot since then). |
Registered Member
|
I've tried without the parameter, no luck. I've also tried removing the automoc, most times that works, not this time. I'll just try again and see, I guess. Like I said, this time I went as far as deleting the whole build directory without success. |
Moderator
|
Strange, then there must be something wrong with the declaration of the slot, but if it is in the moc files and Qt doesn't complain on the command line it should be OK. |
Registered Member
|
I've moved the connect command for the tick / updateTime pair over to mediaplayerplugin.cpp since I was able to add an action slot there before. Right where you create the video widget and have this:
Is there anything else caching that I don't know about? Does moc/automoc4 have a cache? Anything else that needs to know about the slot other than the moc files? |
Moderator
|
|
Registered Member
|
Tried this, still no luck. Uint64 is just quint64, and the moc does a reinterpret cast thing, so it shouldn't make a difference anyway. I posted the patch on bugzilla so you can try it and see if you get the same behavior as me, if you could. EDIT: Tried deleting the moc files one more time, and now it's working. I'll assume it was the suggested change and keep that in mind for the future. Thanks. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]