10 from PyQt4.QtGui
import *
11 from PyQt4.QtCore
import *
17 class window(QMainWindow):
20 QMainWindow.__init__(self)
24 self.CentralWidget = QWidget(self)
25 self.setCentralWidget(self.CentralWidget)
26 self.Layout = QGridLayout(self.CentralWidget)
29 self.QuitButton = QPushButton(self.centralWidget())
30 self.QuitButton.setText(
'Quit')
31 self.Layout.addWidget(self.QuitButton, 1, 0)
33 QObject.connect(self.QuitButton, SIGNAL(
'clicked()'), self.quit)
36 self.hist = ROOT.TH1F(
"pipo",
"pipo", 100, 0, 100)
39 self.Address = sip.unwrapinstance(self.CentralWidget)
40 self.Canvas = ROOT.TQtWidget(sip.voidptr(self.Address).ascobject())
41 ROOT.SetOwnership( self.Canvas,
False )
45 self.Layout.addWidget(sip.wrapinstance(ROOT.AddressOf(self.Canvas)[0],QWidget), 0, 0)
51 ROOT.gApplication.Terminate()
54 if __name__ ==
'__main__':
56 terminator = ROOT.TQtRootSlot.CintSlot()
57 termAddress = sip.wrapinstance(ROOT.AddressOf(terminator)[0],QObject)
58 QObject.connect(application, SIGNAL(
"lastWindowClosed()"),termAddress ,SLOT(
"Terminate()"))
61 ROOT.gApplication.Run(1)