def testShow(self):
     from PyMca5.PyMcaGui.pymca import RGBCorrelatorWidget
     widget = RGBCorrelatorWidget.RGBCorrelatorWidget()
     widget.show()
     self.qapp.processEvents()
     from PyMca5.PyMcaGui.plotting import PyMcaPrintPreview
     PyMcaPrintPreview.resetSingletonPrintPreview()
示例#2
0
    def __init__(self, parent = None, graph = None, bgrx = True):
        qt.QWidget.__init__(self, parent)
        self.setWindowTitle("PyMca RGB Correlator")
        self.setWindowIcon(qt.QIcon(qt.QPixmap(RGBCorrelatorGraph.IconDict['gioconda16'])))
        self.mainLayout = qt.QVBoxLayout(self)
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.mainLayout.setSpacing(6)
        self.splitter   = qt.QSplitter(self)
        self.splitter.setOrientation(qt.Qt.Horizontal)
        self.controller = RGBCorrelatorWidget.RGBCorrelatorWidget(self.splitter)
        self._y1AxisInverted = False
        self._imageBuffer = None
        self._matplotlibSaveImage = None
        standaloneSaving = True
        if graph is None:
            if MATPLOTLIB:
                standaloneSaving = False
            if USE_MASK_WIDGET:
                self.graphWidgetContainer = MaskImageWidget.MaskImageWidget(self.splitter,
                                            selection=True,
                                            imageicons=True,
                                            standalonesave=standaloneSaving,
                                            profileselection=False,
                                            polygon=True)
                self.graphWidget = self.graphWidgetContainer.graphWidget
            else:
                self.graphWidget = RGBCorrelatorGraph.RGBCorrelatorGraph(self.splitter,
                                            standalonesave=standaloneSaving)
            if not standaloneSaving:
                self.graphWidget.saveToolButton.clicked.connect( \
                         self._saveToolButtonSignal)
                self._saveMenu = qt.QMenu()
                self._saveMenu.addAction(QString("Standard"),    self.graphWidget._saveIconSignal)
                self._saveMenu.addAction(QString("Matplotlib") , self._saveMatplotlibImage)
            self.graph = self.graphWidget.graph
            #add flip Icon
            self.graphWidget.hFlipToolButton.clicked.connect( \
                         self._hFlipIconSignal)
            self._handleGraph    = True
        else:
            self.graph = graph
            self._handleGraph = False
        #self.splitter.setStretchFactor(0,1)
        #self.splitter.setStretchFactor(1,1)
        self.mainLayout.addWidget(self.splitter)

        self.reset    = self.controller.reset
        self.addImage = self.controller.addImage
        self.removeImage = self.controller.removeImage
        self.addImageSlot = self.controller.addImageSlot
        self.removeImageSlot = self.controller.removeImageSlot
        self.replaceImageSlot = self.controller.replaceImageSlot
        self.setImageShape = self.controller.setImageShape
        self.update   = self.controller.update
        self.transposeImages   = self.controller.transposeImages
        self.controller.sigRGBCorrelatorWidgetSignal.connect( \
                     self.correlatorSignalSlot)