Connect Root signal to QT slot

Hi all,

I have a TCanvas in a QT application which I update by a QT timer event. When the user closes the TCanvas window, I get a segfault from the timer event as the the TCanvas no longer exists.
I now want to use the Closed()-signal from the TCanvas to stop my QT timer. Therefore I need to connect somehow the Root signal to the QT slot.
I can’t use the QT connect method as this expects a QObject, and when I use the Root connect method the the slot in my QT class is not recognized: Error in TQObject::CheckConnectArgs: slot stopGraph() does not exist

Any help for that would be highly appreciated, thanks!

QMainCanvas::QMainCanvas(QWidget *parent) : QWidget(parent)
    canvas = new TCanvas("canvas","CanvasTitle",0,0, width(),height());
    QObject::connect(canvas->GetCanvas(),SIGNAL(Closed()),this, SLOT(stopGraph()));

void QMainCanvas::stopGraph()

I need to see your application to advise.

Normally QtRoot application creates TQtWidget to represent TCanvas within Qt application.

Since TQtWidget is the the regular QWidget (QWidget subclass ) one can use it as such. In addition TQtWidget is in possession of the few customs Qt signals and slots. Check
So the communication you are speaking about should no be a problem. You can find a lot of HelloWord-level examples from the Qt-distribution (see … tExamples/ )

However, for some rare cases the TQtWidget /QWidget signals / slots do not suffice. For such case one can use so-called QtRootSlot
Check this: