Knowing which TCanvas sent a Closed signal

Hi,

Let’s say that I create a TCanvas (which is displayed in an independent window) and register it in some kind of manager (because I need a reference to update it).
I connect a slot to the Closed signal of this TCanvas. When the user closes it, the slot is called and I would like to unregister this canvas from the manager. Unfortunately, the Closed signal doesn’t have any argument and I have no clue how to know which TCanvas has been closed.
To say it in other words, I would like to know which TCanvas has been closed when the slot corresponding to the Closed signal is called.

How can I do that ? I thought about extending TCanvas, but I would prefer to keep it simple if possible…

Thanks in advance,

Barth

Hi Barth,

Well, it’s a tricky problem… You could try to use TCanvas *c = (TCanvas *) gTQSender; but the canvas is probably already gone…
I will check and let you know.

Cheers,
Bertrand.

Ok, thanks.

For the time beintg, I decided to extend TCanvas in order to have the slot inside the TCanvas object and therefore I obviously have a reference to the TCanvas being closed. It works well.

Cheers,

Barth