예제 #1
0
    def __init__(self, parent=None, getfocus=None):
        super(IPythonView, self).__init__(parent)
        
        # Create an in-process kernel
        self.kernel_manager = QtInProcessKernelManager()
        self.kernel_manager.start_kernel()
        self.kernel = self.kernel_manager.kernel
        self.kernel.gui = 'qt4'
        self.shell = self.kernel.shell

        self.kernel_client = self.kernel_manager.client()
        self.kernel_client.start_channels()

        self.control = RichIPythonWidget()
        self.control.set_default_style(colors='linux')
        self.control.kernel_manager = self.kernel_manager
        self.control.kernel_client = self.kernel_client
        self.control.exit_requested.connect(self.stop)
        
        # Enable Pylab mode.
        self.shell.enable_pylab()
        self.shell.automagic = True
        
        # Add some variables in the namespace.
        self.push(galry=galry)
        
        box = QtGui.QVBoxLayout()
        box.addWidget(self.control)
        
        box.setContentsMargins(0, 0, 0, 0)
        box.setSpacing(0)

        
        self.setLayout(box)
예제 #2
0
    def create_layout(self):
        self.projection_view = ProjectionView(self, getfocus=False)
        self.feature_view = FeatureView(self, getfocus=False)
        self.set_data()

        # Connect the FeatureView signal to the top-level widget signals.
        self.feature_view.spikesHighlighted.connect(self.spikesHighlighted)
        self.feature_view.spikesSelected.connect(self.spikesSelected)

        # Connect the bottom-level projectionChanged signals to the top-level
        # widget signals.
        self.feature_view.projectionChanged.connect(self.projectionChanged)
        self.projection_view.projectionChanged.connect(self.projectionChanged)

        # Interconnect the projectionChanged between the two bottom-level widgets.
        self.projection_view.projectionChanged.connect(
            self.projection_changed_projection_callback)
        self.feature_view.projectionChanged.connect(
            self.projection_changed_feature_callback)

        box = QtGui.QVBoxLayout()
        # HACK: pyside does not have this function
        if hasattr(box, 'setMargin'):
            box.setMargin(0)

        box.addWidget(self.projection_view)
        box.addWidget(self.feature_view)

        self.setLayout(box)
    def __init__(self, parent=None, getfocus=None):
        super(LogView, self).__init__(parent)

        # Create the text edit widget.
        self.textedit = QtGui.QTextEdit()
        self.textedit.setReadOnly(True)

        # Add the text edit widget to the layout.
        box = QtGui.QVBoxLayout()
        box.addWidget(self.textedit)
        box.setContentsMargins(0, 0, 0, 0)
        box.setSpacing(0)
        self.setLayout(box)