Hello Luca,
I have installed PyQt and tested it with the simple script involving
"Python + PyQt + Sim + PyROOT + QtRoot"
( uhh !!! ) the scaring number of the layers (Rene is right !)
Anyway
The working version of the python script was included into QtRoot CVS
(see:
http://www.star.bnl.gov/cgi-bin/cvsweb.cgi/QtRoot/qtExamples/HelloPython
/
and some extra details were posted via the Qt-root mail list
Please, use this mail list to communicate your future QtRoot related
questions.
Best Regards
Valeri Fine
> -----Original Message-----
> From: Luca Baldini [mailto:luca.baldini_at_pi.infn.it]
> Sent: Tuesday, January 16, 2007 3:31 AM
> To: Fine, Valeri
> Cc: Johan Bregeon; WLavrijsen_at_lbl.gov; Luca Baldini; ROOT Talk
> Subject: Re: [ROOT] RE: PyQt and PyROOT
>
> Hi Valeri,
> this is the best we could do, so far, following your suggestions.
> The script works, except for the fact that it needs the last
raw_input()
> stuff, otherwise the window get closed
> immediately. I still don't get that, it looks like the application
main
> loop is not running...
> Also, we would like to be able to close the application by clicking on
> the window, rather than pressing a
> key on the prompt.
>
>
> #!/bin/env python
>
> import sip
> from qt import QMainWindow, QWidget, QGridLayout
> from ROOT import TH1F, TQtWidget, gSystem, AddressOf
>
> gSystem.Load('qtcint')
>
> class window(QMainWindow):
> def __init__(self):
> QMainWindow.__init__(self)
> self.CentralWidget = QWidget(self)
> self.setCentralWidget(self.CentralWidget)
> self.Layout = QGridLayout(self.CentralWidget)
> self.Histogram = TH1F("histogram", "histogram", 100, 0, 100)
> self.Address = sip.unwrapinstance(self.CentralWidget)
> self.Canvas =
TQtWidget(sip.voidptr(self.Address).ascobject())
>
> self.Layout.addWidget(sip.wrapinstance(AddressOf(self.Canvas)[0],
> QWidget), 0, 0)
> self.Histogram.Draw()
>
> if __name__ == '__main__':
> w = window()
> w.resize(350, 350)
> w.show()
> raw_input('Press return to exit...')
Received on Thu Jan 18 2007 - 23:55:36 CET
This archive was generated by hypermail 2.2.0 : Fri Jan 19 2007 - 11:50:00 CET