Qt example

I try to execute this:

root.cern.ch/viewvc/trunk/tutori … iew=markup

but I got:

TClass::TClass:0: RuntimeWarning: no dictionary for class QObject is available
Traceback (most recent call last):
  File "main.py", line 51, in <module>
    QObject.connect(application, SIGNAL("lastWindowClosed()"),termAddress ,SLOT("Terminate()"))
RuntimeError: underlying C/C++ object has been deleted

using ROOT 5.26 compiled with python and Qt support.[/code]

Hi,

works just fine for me …

Which version of Qt are you using and what is the content of your .rootrc file?

Cheers,
Wim

[quote=“wlav”]Hi,

works just fine for me …

Which version of Qt are you using and what is the content of your .rootrc file?

Cheers,
Wim[/quote]

I’m using Qt 4.6.0 and I can’t find nothing about qt into system.rootrc (I can’t find the file .rootrc)

Hi,

not in the system.rootrc indeed, b/c it’s not enabled by default. Your own ~/.rootrc (create one if it doesn’t exist) or equivalent needs to contain:Gui.Backend: qt Gui.Factory: qtgui Plugin.TGuiFactory: qtgui TQtRootGuiFactory QtRoot "TQtRootGuiFactory()"since if you don’t ROOT will use the default graphics system, not Qt.

Cheers,
Wim

[quote=“wlav”]Hi,

not in the system.rootrc indeed, b/c it’s not enabled by default. Your own ~/.rootrc (create one if it doesn’t exist) or equivalent needs to contain:Gui.Backend: qt Gui.Factory: qtgui Plugin.TGuiFactory: qtgui TQtRootGuiFactory QtRoot "TQtRootGuiFactory()"since if you don’t ROOT will use the default graphics system, not Qt.

Cheers,
Wim[/quote]

Ok, thanks very much, now it works, but… why is not this file created at installation time?

Hi,

Qt isn’t the default graphics system; and a default ~/.rootrc as the installation could provide, would be empty.

Cheers,
Wim (who wrote neither the installation nor the Qt interface, so of course I’m just guessing here)