UIKit0 / freemedforms

Automatically exported from code.google.com/p/freemedforms
Other
0 stars 0 forks source link

IPhotoProvider: problem with sig/slot connection #252

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
With the current code, all providers are connected to all identitywidget (even 
duplicates: patient/user...). So when the action corresponding to a provider is 
triggered, the provider gets the photo and send the signal photoReady to ALL 
identitywidgets, not only the one who called the action , resulting to all 
photobutton showing the same photo (user/patient/...)

--> We need a workaround. May be connect/disconnect on hide/show widget?

Original issue reported on code.google.com by eric.mae...@gmail.com on 19 Dec 2012 at 10:07

GoogleCodeExporter commented 9 years ago
Ah, so AFAIK the problem exists since the identitywidget (and so the 
IPhotoProvider hook) is used also for users.
connecting/disconnecting signals is nast & tricky, I think this is not 
recommended by Qt...

What if we implement something like "context" for the photo, like for actions 
too?
Then all receive the signal photoReady(QPixmap, QString) (like Q_EMIT 
photoReady(pixmap, "User.Photo") or "Patient.Photo" etc.

Could that be a possibility?
Strings are not very good, but with consts it's ok.
the webcamplugin could e.g. provide

Maybe, instead of using another type of constants, we could use the tokens for 
that? 
const char * const  TOKEN_PATIENTCONTACT_PHOTO = "Patient.Contact.Photo";

This one is missing anyway ;-)

Original comment by christian.a.reiter@gmail.com on 19 Dec 2012 at 10:49

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 1bec9c163fc8.

Original comment by eric.mae...@gmail.com on 19 Dec 2012 at 11:13

GoogleCodeExporter commented 9 years ago
Ah, now I see what you meant. In the moment the photo is received all get the 
signal. Then the "context" does not help...
But your solution is a good idea.

Original comment by christian.a.reiter@gmail.com on 19 Dec 2012 at 11:51