Python pyqtgraph.Qt.QtGui.QVBoxLayout() Examples

The following are 15 code examples of pyqtgraph.Qt.QtGui.QVBoxLayout(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module pyqtgraph.Qt.QtGui , or try the search function .
Example #1
Source File: widgets.py    From pyFlightAnalysis with MIT License 6 votes vote down vote up
def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.setFixedSize(QtCore.QSize(600, 400))
        w = QtGui.QWidget()
        self.setCentralWidget(w)
        vlayout = QtGui.QVBoxLayout()
        w.setLayout(vlayout)
        self.htmlView = QtWidgets.QTextBrowser(self)
        font = QtGui.QFont()
        font.setFamily('Arial')
        self.htmlView.setReadOnly(True)
        self.htmlView.setFont(font)
        self.htmlView.setOpenExternalLinks(True)
        self.htmlView.setObjectName('Help information')
        html_help_path = get_source_name('docs/help.html')
        ret = self.htmlView.setSource(QtCore.QUrl(html_help_path))
        print('load result:', ret)
#         self.htmlView.append(ret)
        vlayout.addWidget(self.htmlView) 
Example #2
Source File: midicontrol.py    From OpenNFB with GNU General Public License v3.0 6 votes vote down vote up
def config_dialog(self):
        self.config = True
        win = QtGui.QDialog()

        layout = QtGui.QVBoxLayout()

        keys = self.cc.keys()
        keys.sort()

        for cc in keys:
            label = "CC " + str(cc)
            button = QtGui.QPushButton(label)
            func = lambda cc=cc: self.midi.send_cc(0, cc, random.randint(0, 127))
            button.pressed.connect(func)
            layout.addWidget(button)

        finishButton = QtGui.QPushButton('Finished')
        layout.addWidget(finishButton)
        finishButton.clicked.connect(win.accept)

        win.setLayout(layout)

        win.exec_()
        self.config = False 
Example #3
Source File: label_events.py    From ConvNetQuake with MIT License 6 votes vote down vote up
def __init__(self, output, parent=None):
    super(MainWidget, self).__init__(parent=parent)

    self.load_thread = None
    self.stream = None
    self.catalog = None
    self.filtered_catalog = None
    self.num_events = 0
    self.event_idx = -1
    self.output = output

    self.statusBar = self.parent().statusBar()

    self.layout = QtGui.QVBoxLayout()
    self.setLayout(self.layout)
    self.resize(800,800)

    self.set_buttons()
    self.set_graphics_view() 
Example #4
Source File: gccNMFInterface.py    From gcc-nmf with MIT License 6 votes vote down vote up
def initControlWidgets(self):
        self.initMaskFunctionControls()
        self.initMaskFunctionPlot()
        self.initNMFControls()
        self.initLocalizationControls()
        self.initUIControls()
         
        controlWidgetsLayout = QtGui.QVBoxLayout()
        controlWidgetsLayout.addWidget(self.gccPHATPlotWidget)
        controlWidgetsLayout.addLayout(self.maskFunctionControlslayout)
        self.addSeparator(controlWidgetsLayout)
        controlWidgetsLayout.addLayout(self.nmfControlsLayout)
        controlWidgetsLayout.addLayout(self.localizationControlsLayout)
        self.addSeparator(controlWidgetsLayout)
        controlWidgetsLayout.addWidget(self.uiConrolsWidget)
        
        self.controlsWidget = QtGui.QWidget()
        self.controlsWidget.setLayout(controlWidgetsLayout)
        self.controlsWidget.setAutoFillBackground(True) 
Example #5
Source File: gccNMFInterface.py    From gcc-nmf with MIT License 6 votes vote down vote up
def initMaskFunctionControls(self):
        self.maskFunctionControlslayout = QtGui.QHBoxLayout()
        labelsLayout = QtGui.QVBoxLayout()
        slidersLayout = QtGui.QVBoxLayout()
        self.maskFunctionControlslayout.addLayout(labelsLayout)
        self.maskFunctionControlslayout.addLayout(slidersLayout)
        def addSlider(label, changedFunction, minimum, maximum, value):
            labelWidget = QtGui.QLabel(label)
            labelsLayout.addWidget(labelWidget)
            slider = QtGui.QSlider(QtCore.Qt.Horizontal)
            slider.setMinimum(minimum)
            slider.setMaximum(maximum)
            slider.setValue(value)
            slider.sliderReleased.connect(changedFunction)
            slidersLayout.addWidget(slider)
            return slider, labelWidget
        
        self.targetModeWindowTDOASlider, self.targetModeWindowTDOALabel = addSlider('Center:', self.tdoaRegionChanged, 0, 100, 50)
        self.targetModeWindowWidthSlider, _ = addSlider('Width:', self.tdoaRegionChanged, 1, 101, 50)
        self.targetModeWindowBetaSlider, _ = addSlider('Shape:', self.tdoaRegionChanged, 0, 100, 50)
        self.targetModeWindowNoiseFloorSlider, _ = addSlider('Floor:', self.tdoaRegionChanged, 0, 100, 0) 
Example #6
Source File: relativity.py    From tf-pose with Apache License 2.0 5 votes vote down vote up
def setupGUI(self):
        self.layout = QtGui.QVBoxLayout()
        self.layout.setContentsMargins(0,0,0,0)
        self.setLayout(self.layout)
        self.splitter = QtGui.QSplitter()
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.layout.addWidget(self.splitter)
        
        self.tree = ParameterTree(showHeader=False)
        self.splitter.addWidget(self.tree)
        
        self.splitter2 = QtGui.QSplitter()
        self.splitter2.setOrientation(QtCore.Qt.Vertical)
        self.splitter.addWidget(self.splitter2)
        
        self.worldlinePlots = pg.GraphicsLayoutWidget()
        self.splitter2.addWidget(self.worldlinePlots)
        
        self.animationPlots = pg.GraphicsLayoutWidget()
        self.splitter2.addWidget(self.animationPlots)
        
        self.splitter2.setSizes([int(self.height()*0.8), int(self.height()*0.2)])
        
        self.inertWorldlinePlot = self.worldlinePlots.addPlot()
        self.refWorldlinePlot = self.worldlinePlots.addPlot()
        
        self.inertAnimationPlot = self.animationPlots.addPlot()
        self.inertAnimationPlot.setAspectLocked(1)
        self.refAnimationPlot = self.animationPlots.addPlot()
        self.refAnimationPlot.setAspectLocked(1)
        
        self.inertAnimationPlot.setXLink(self.inertWorldlinePlot)
        self.refAnimationPlot.setXLink(self.refWorldlinePlot) 
Example #7
Source File: MatplotlibWidget.py    From FAE with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None, size=(5.0, 4.0), dpi=100):
        QtGui.QWidget.__init__(self)
        super(MatplotlibWidget, self).__init__(parent)
        self.fig = Figure(size, dpi=dpi)
        self.canvas = FigureCanvas(self.fig)
        self.canvas.setParent(self)
        # self.toolbar = NavigationToolbar(self.canvas, self)
        
        self.vbox = QtGui.QVBoxLayout()
        # self.vbox.addWidget(self.toolbar)
        self.vbox.addWidget(self.canvas)
        
        self.setLayout(self.vbox) 
Example #8
Source File: widgets.py    From pyFlightAnalysis with MIT License 5 votes vote down vote up
def __init__(self, params_data, changed_params_data, *args, **kwargs):
        self.params_data = params_data
        self.params_data_show = list(self.params_data.keys())
        self.changed_params_data = changed_params_data
        super().__init__(*args, **kwargs)
        self.resize(QtCore.QSize(500,500))
        self.params_table = QtGui.QTableWidget()
        self.choose_item_lineEdit = QtGui.QLineEdit(self)
        self.choose_item_lineEdit.setPlaceholderText('filter by data name')
        self.choose_item_lineEdit.textChanged.connect(self.callback_filter)
        self.btn_changed_filter = QtGui.QPushButton('Changed')
        self.btn_changed_filter.clicked.connect(self.btn_changed_filter_clicked) 
        w = QtGui.QWidget()
        self.vlayout = QtGui.QVBoxLayout(w)
        self.hlayout = QtGui.QHBoxLayout(self)
        self.setCentralWidget(w)
        self.centralWidget().setLayout(self.vlayout)
        self.vlayout.addWidget(self.params_table)
        self.vlayout.addLayout(self.hlayout)
        self.hlayout.addWidget(self.btn_changed_filter)
        self.hlayout.addWidget(self.choose_item_lineEdit)
        self.params_table.setEditTriggers(QtGui.QAbstractItemView.DoubleClicked | 
                                                     QtGui.QAbstractItemView.SelectedClicked)
        self.params_table.setSortingEnabled(False)
        self.params_table.horizontalHeader().setStretchLastSection(True)
        self.params_table.resizeColumnsToContents()
        self.params_table.setColumnCount(2)
        self.params_table.setColumnWidth(0, 120)
        self.params_table.setColumnWidth(1, 50)
        self.params_table.setHorizontalHeaderLabels(['Name', 'value'])
        self.show_all_params = True
        self.filtertext = ''
        self.update_table() 
Example #9
Source File: inputcontrol.py    From eegsynth with GNU General Public License v3.0 5 votes vote down vote up
def drawmain(self):
        # the left contains the rows, the right the columns
        leftlayout = QtGui.QVBoxLayout()
        rightlayout = QtGui.QHBoxLayout()
        mainlayout = QtGui.QHBoxLayout()
        mainlayout.addLayout(leftlayout)
        mainlayout.addLayout(rightlayout)
        self.setLayout(mainlayout)

        # the section 'slider' is treated as the first row
        # this is only for backward compatibility
        section = 'slider'
        if config.has_section(section):
            sectionlayout = QtGui.QHBoxLayout()
            self.drawpanel(sectionlayout, config.items(section))
            leftlayout.addLayout(sectionlayout)

        for row in range(0, 16):
            section = 'row%d' % (row + 1)
            if config.has_section(section):
                sectionlayout = QtGui.QHBoxLayout()
                self.drawpanel(sectionlayout, config.items(section))
                leftlayout.addLayout(sectionlayout)

        # the section 'button' is treated as the first column
        # this is only for backward compatibility
        section = 'button'
        if config.has_section(section):
            sectionlayout = QtGui.QVBoxLayout()
            self.drawpanel(sectionlayout, config.items(section))
            rightlayout.addLayout(sectionlayout)

        for column in range(0, 16):
            section = 'column%d' % (column + 1)
            if config.has_section(section):
                sectionlayout = QtGui.QVBoxLayout()
                self.drawpanel(sectionlayout, config.items(section))
                rightlayout.addLayout(sectionlayout) 
Example #10
Source File: plotly_test.py    From VNect-tensorflow with Apache License 2.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(App, self).__init__(parent)

        #### Create Gui Elements ###########
        self.mainbox = QtGui.QWidget()
        self.setCentralWidget(self.mainbox)
        self.mainbox.setLayout(QtGui.QVBoxLayout())

        self.canvas = pg.GraphicsLayoutWidget()
        self.mainbox.layout().addWidget(self.canvas)

        self.label = QtGui.QLabel()
        self.mainbox.layout().addWidget(self.label)

        self.view = self.canvas.addViewBox()
        self.view.setAspectLocked(True)
        self.view.setRange(QtCore.QRectF(0,0, 100, 100))

        #  image plot
        self.img = pg.ImageItem(border='w')
        self.view.addItem(self.img)

        self.canvas.nextRow()
        #  line plot
        self.otherplot = self.canvas.addPlot()
        self.h2 = self.otherplot.plot(pen='y')


        #### Set Data  #####################

        self.x = np.linspace(0,50., num=100)
        self.X,self.Y = np.meshgrid(self.x,self.x)

        self.counter = 0
        self.fps = 0.
        self.lastupdate = time.time()

        #### Start  #####################
        self._update() 
Example #11
Source File: gui.py    From audio-reactive-led-strip with MIT License 5 votes vote down vote up
def __init__(self, width=800, height=450, title=''):
        # Create GUI window
        self.app = QtGui.QApplication([])
        self.win = pg.GraphicsWindow(title)
        self.win.resize(width, height)
        self.win.setWindowTitle(title)
        # Create GUI layout
        self.layout = QtGui.QVBoxLayout()
        self.win.setLayout(self.layout) 
Example #12
Source File: relativity.py    From qgisSpaceSyntaxToolkit with GNU General Public License v3.0 5 votes vote down vote up
def setupGUI(self):
        self.layout = QtGui.QVBoxLayout()
        self.layout.setContentsMargins(0,0,0,0)
        self.setLayout(self.layout)
        self.splitter = QtGui.QSplitter()
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.layout.addWidget(self.splitter)
        
        self.tree = ParameterTree(showHeader=False)
        self.splitter.addWidget(self.tree)
        
        self.splitter2 = QtGui.QSplitter()
        self.splitter2.setOrientation(QtCore.Qt.Vertical)
        self.splitter.addWidget(self.splitter2)
        
        self.worldlinePlots = pg.GraphicsLayoutWidget()
        self.splitter2.addWidget(self.worldlinePlots)
        
        self.animationPlots = pg.GraphicsLayoutWidget()
        self.splitter2.addWidget(self.animationPlots)
        
        self.splitter2.setSizes([int(self.height()*0.8), int(self.height()*0.2)])
        
        self.inertWorldlinePlot = self.worldlinePlots.addPlot()
        self.refWorldlinePlot = self.worldlinePlots.addPlot()
        
        self.inertAnimationPlot = self.animationPlots.addPlot()
        self.inertAnimationPlot.setAspectLocked(1)
        self.refAnimationPlot = self.animationPlots.addPlot()
        self.refAnimationPlot.setAspectLocked(1)
        
        self.inertAnimationPlot.setXLink(self.inertWorldlinePlot)
        self.refAnimationPlot.setXLink(self.refWorldlinePlot) 
Example #13
Source File: gccNMFInterface.py    From gcc-nmf with MIT License 5 votes vote down vote up
def initWindowLayout(self):
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(1)
        
        self.infoLabelWidgets = []
        def addWidgetWithLabel(widget, label, fromRow, fromColumn, rowSpan=1, columnSpan=1):
            labeledWidget = QtGui.QWidget()
            widgetLayout = QtGui.QVBoxLayout()
            widgetLayout.setContentsMargins(0, 0, 0, 0)
            widgetLayout.setSpacing(1)
            labeledWidget.setLayout(widgetLayout)
            
            labelWidget = QtGui.QLabel(label)
            labelWidget.setContentsMargins(0, 3, 0, 1)
            labelWidget.setAutoFillBackground(True)
            labelWidget.setAlignment(QtCore.Qt.AlignCenter)
            #labelWidget.setStyleSheet('QLabel { border-top-width: 10px }')       
            self.infoLabelWidgets.append(labelWidget)
            
            widgetLayout.addWidget(labelWidget)
            widgetLayout.addWidget(widget)
            labeledWidget.setSizePolicy(sizePolicy)
            self.mainLayout.addWidget(labeledWidget, fromRow, fromColumn, rowSpan, columnSpan)
        
        addWidgetWithLabel(self.inputSpectrogramWidget, 'Input Spectrogram', 0, 1)
        addWidgetWithLabel(self.outputSpectrogramWidget, 'Output Spectrogram', 1, 1)
        addWidgetWithLabel(self.controlsWidget, 'GCC-NMF Masking Function', 0, 2)
        addWidgetWithLabel(self.gccPHATHistoryWidget, 'GCC PHAT Angular Spectrogram', 0, 3)
        addWidgetWithLabel(self.dictionaryWidget, 'NMF Dictionary', 1, 2)
        addWidgetWithLabel(self.coefficientMaskWidget, 'NMF Dictionary Mask', 1, 3)
        #for widget in self.infoLabelWidgets:
        #    widget.hide()
        #map(lambda widget: widget.hide(), self.infoLabelWidgets) 
Example #14
Source File: widgets.py    From pyFlightAnalysis with MIT License 4 votes vote down vote up
def __init__(self, item_id, mainwindow, *args, **kargs):
        self.id = item_id
        self.mainwindow = mainwindow
        super().__init__(*args, **kargs)
        self.resize(QtCore.QSize(300, 200))
        self.properties_table = QtGui.QTableWidget()
#         self.setCentralWidget(self.properties_table)
        self.properties_table.setSortingEnabled(False)
        self.properties_table.horizontalHeader().setStretchLastSection(True)
        self.properties_table.resizeColumnsToContents()
        self.properties_table.setColumnCount(2)
        self.properties_table.setColumnWidth(0, 120)
        self.properties_table.setColumnWidth(1, 50)
        self.properties_table.setHorizontalHeaderLabels(['Property', 'value'])
        # first row --- color
        self.properties_table.insertRow(0)
        self.properties_table.setCellWidget(0, 0, QtGui.QLabel('Color'))
        self.curve = mainwindow.data_plotting[self.id][2]
        self.btn = ColorPushButton(self.id, self.properties_table, self.curve.opts['pen'])
        self.properties_table.setCellWidget(0, 1, self.btn)
        # second row --- symbol
        self.properties_table.insertRow(1)
        self.properties_table.setCellWidget(1, 0, QtGui.QLabel('Marker'))
        self.mkr = Marker(self.curve.opts['symbol'])
        self.properties_table.setCellWidget(1, 1, self.mkr)
        # third row --- symbol size
        self.properties_table.insertRow(2)
        self.properties_table.setCellWidget(2, 0, QtGui.QLabel('Marker Size'))
        print('symbolSize:', str(self.curve.opts['symbolSize']))
        self.ln = LineEdit(str(self.curve.opts['symbolSize']))
        self.properties_table.setCellWidget(2, 1, self.ln)
        w = QtGui.QWidget()
        self.vlayout = QtGui.QVBoxLayout()
        self.hlayout = QtGui.QHBoxLayout()
        self.setCentralWidget(w)
        self.centralWidget().setLayout(self.vlayout)
        self.vlayout.addWidget(self.properties_table)
        self.vlayout.addLayout(self.hlayout)
        self.cancel_btn = QtGui.QPushButton('Cancel')
        self.ok_btn = QtGui.QPushButton('OK')
        self.cancel_btn.clicked.connect(self.callback_cancel_clicked)
        self.ok_btn.clicked.connect(self.callback_properties_changed)
        self.hlayout.addWidget(self.cancel_btn)
        self.hlayout.addWidget(self.ok_btn) 
Example #15
Source File: widgets.py    From pyFlightAnalysis with MIT License 4 votes vote down vote up
def __init__(self, mainwindow, *args, **kwargs):
        self.mainwindow = mainwindow
        # gui
        self.graph_predefined_list = ['XY_Estimation',
                                       'Altitude Estimate',
                                       'Roll Angle',
                                       'Pitch Angle',
                                       'Yaw Angle',
                                       'Roll Angle Rate',
                                       'Pitch Angle Rate',
                                       'Yaw Angle Rate',
                                       'Local Position X',
                                       'Local Position Y',
                                       'Local Position Z',
                                       'Velocity',
                                       'Manual Control Input',
                                       'Actuator Controls 0',
                                       'Actuation Outputs(Main)',
                                       'Actuation Outputs(Aux)',
                                       'Magnetic field strength',
                                       'Distance Sensor',
                                       'GPS Uncertainty',
                                       'GPS noise and jamming',
                                       'CPU & RAM',
                                       'Power']
        super().__init__(*args,**kwargs)
        self.setFixedSize(QtCore.QSize(300, 660))
        self.graph_table = QtGui.QTableWidget(self)
        self.graph_table.setColumnCount(2)
        self.graph_table.setColumnWidth(0, 200)
        self.graph_table.setColumnWidth(1, 40)
        for index, item in enumerate(self.graph_predefined_list):
            self.graph_table.insertRow(index)
            lbl = QtGui.QLabel(item)
            lbl.mouseDoubleClickEvent = self.callback_double_clicked(item)
            self.graph_table.setCellWidget(index, 0, lbl)
            chk = Checkbox(item)
            if item in self.mainwindow.analysis_graph_list:
                chk.setChecked(True)
            chk.sigStateChanged.connect(self.callback_check_state_changed)
            self.graph_table.setCellWidget(index, 1, chk)
        self.clear_btn = QtGui.QPushButton('Clear all')
        self.clear_btn.clicked.connect(self.callback_clear)
        #
        w = QtGui.QWidget()
        self.vlayout = QtGui.QVBoxLayout(w)
        self.setCentralWidget(w)
        self.centralWidget().setLayout(self.vlayout)
        self.vlayout.addWidget(self.graph_table)
        self.vlayout.addWidget(self.clear_btn)