CMS 3D CMS Logo

Public Member Functions | Public Attributes

lumiQTWidget::ApplicationWindow Class Reference

List of all members.

Public Member Functions

def __init__
def closeEvent
def destroy
def fileQuit
def saveAs

Public Attributes

 main_widget
 qApp

Detailed Description

main evt loop

Definition at line 16 of file lumiQTWidget.py.


Constructor & Destructor Documentation

def lumiQTWidget::ApplicationWindow::__init__ (   self,
  fig = None 
)

Definition at line 20 of file lumiQTWidget.py.

00021                                :
00022         self.qApp=QtGui.QApplication(sys.argv)#every PyQt4 application must create an application object
00023         QtGui.QMainWindow.__init__(self)
00024         self.setWindowTitle('lumi plot')
00025         self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
00026         self.main_widget = QtGui.QWidget(self)
00027         l = QtGui.QVBoxLayout(self.main_widget)
00028         sc = LumiCanvas(self.main_widget,fig=fig)
00029         bn = QtGui.QPushButton("Save to File",self.main_widget)
00030         bn.clicked.connect(lambda:self.saveAs(fig))
00031         l.addWidget(sc)
00032         l.addWidget(bn)
00033         self.main_widget.setFocus()
00034         self.setCentralWidget(self.main_widget)
        

Member Function Documentation

def lumiQTWidget::ApplicationWindow::closeEvent (   self,
  ce 
)

Definition at line 41 of file lumiQTWidget.py.

00042                             :
        self.fileQuit()
def lumiQTWidget::ApplicationWindow::destroy (   self)

Definition at line 43 of file lumiQTWidget.py.

00044                      :
        sys.exit(self.qApp.exec_())
def lumiQTWidget::ApplicationWindow::fileQuit (   self)

Definition at line 39 of file lumiQTWidget.py.

00040                       :
        self.close()
def lumiQTWidget::ApplicationWindow::saveAs (   self,
  fig 
)

Definition at line 35 of file lumiQTWidget.py.

00036                         :
00037         filename=QtGui.QFileDialog.getSaveFileName(self,"Save plot as file","","(*.png)")
00038         if filename == "": return
        fig.savefig(filename,format="PNG")                         

Member Data Documentation

Definition at line 20 of file lumiQTWidget.py.

Definition at line 20 of file lumiQTWidget.py.