Python pyqtgraph.Qt.QtGui.QHBoxLayout() Examples
The following are 10
code examples of pyqtgraph.Qt.QtGui.QHBoxLayout().
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 |
def __init__(self,*args,**kwargs): super(QuadrotorWin,self).__init__(*args,**kwargs) self.toolBar = self.addToolBar('showSetting') self.trace_show = QtGui.QAction(QtGui.QIcon(get_source_name('icons/trace.gif')), 'show trace', self) self.trace_show.triggered.connect(self.callback_show_trace) self.trace_showed = False self.vector_show = QtGui.QAction(QtGui.QIcon(get_source_name('icons/rotor_vector.gif')), 'show rotation speed vector',self) self.vector_show.triggered.connect(self.callback_show_vector) self.vector_showed = False self.toolBar.addAction(self.trace_show) self.toolBar.addAction(self.vector_show) self.quadrotor_win_main_widget = QtGui.QWidget(self) self.quadrotor_win_main_layout = QtGui.QHBoxLayout() self.quadrotor_win_main_widget.setLayout(self.quadrotor_win_main_layout) self.quadrotor_widget = QuadrotorWidget(self.quadrotor_win_main_widget) self.quadrotor_win_main_layout.addWidget(self.quadrotor_widget) self.setCentralWidget(self.quadrotor_win_main_widget) self.setWindowTitle("pyFlightAnalysis Trace plot")
Example #2
Source File: batchviewer.py From BatchViewer with Apache License 2.0 | 6 votes |
def init(self, width, height): self.rect = QtCore.QRect(0, 0, width, height) self.imageItem = pg.ImageItem() self.imageItem.setImage(None) self.graphicsScene = pg.GraphicsScene() self.graphicsScene.addItem(self.imageItem) self.graphicsView = pg.GraphicsView() self.graphicsView.setRenderHint(QtGui.QPainter.Antialiasing) self.graphicsView.setScene(self.graphicsScene) layout = QtGui.QHBoxLayout() layout.addWidget(self.graphicsView) self.setLayout(layout) self.setMaximumSize(width, height) self.setMinimumSize(width-10, height-10)
Example #3
Source File: gccNMFInterface.py From gcc-nmf with MIT License | 6 votes |
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 #4
Source File: gccNMFInterface.py From gcc-nmf with MIT License | 6 votes |
def initNMFControls(self): self.nmfControlsLayout = QtGui.QHBoxLayout() self.nmfControlsLayout.addStretch(1) self.nmfControlsLayout.addWidget(QtGui.QLabel('Dictionary Size:')) self.dictionarySizeDropDown = QtGui.QComboBox() for dictionarySize in self.dictionarySizes: self.dictionarySizeDropDown.addItem( str(dictionarySize) ) self.dictionarySizeDropDown.setMaximumWidth(75) self.dictionarySizeDropDown.setCurrentIndex(self.dictionarySizes.index(self.dictionarySize)) self.dictionarySizeDropDown.currentIndexChanged.connect(self.dictionarySizeChanged) self.nmfControlsLayout.addWidget(self.dictionarySizeDropDown) self.nmfControlsLayout.addStretch(1) self.nmfControlsLayout.addWidget(QtGui.QLabel('Num Updates:')) self.numHUpdatesSpinBox = QtGui.QSpinBox() self.nmfControlsLayout.addWidget(self.numHUpdatesSpinBox) self.nmfControlsLayout.addStretch(1)
Example #5
Source File: gccNMFInterface.py From gcc-nmf with MIT License | 6 votes |
def initLocalizationControls(self): self.localizationControlsLayout = QtGui.QHBoxLayout() self.localizationControlsLayout.addStretch(3) self.localizationCheckBox = QtGui.QCheckBox('Enable Localization') self.localizationCheckBox.setChecked(self.localizationEnabled) self.localizationCheckBox.stateChanged.connect(self.localizationStateChanged) self.localizationControlsLayout.addWidget(self.localizationCheckBox) self.localizationControlsLayout.addStretch(1) self.localizationWindowSizeLabel = QtGui.QLabel('Sliding Window Size:') self.localizationControlsLayout.addWidget(self.localizationWindowSizeLabel) self.localziaitonWindowSizeSpinBox = QtGui.QSpinBox() self.localziaitonWindowSizeSpinBox.setMinimum(1) self.localziaitonWindowSizeSpinBox.setMaximum(128) self.localziaitonWindowSizeSpinBox.setValue(self.localizationWindowSize) self.localziaitonWindowSizeSpinBox.valueChanged.connect(self.localizationParamsChanged) self.localizationControlsLayout.addWidget(self.localziaitonWindowSizeSpinBox) self.localizationControlsLayout.addStretch(3)
Example #6
Source File: gccNMFInterface.py From gcc-nmf with MIT License | 6 votes |
def initUIControls(self): self.uiConrolsWidget = QtGui.QWidget() buttonBarWidgetLayout = QtGui.QHBoxLayout(spacing=0) buttonBarWidgetLayout.setContentsMargins(0, 0, 0, 0) buttonBarWidgetLayout.setSpacing(0) self.uiConrolsWidget.setLayout(buttonBarWidgetLayout) def addButton(label, widget=None, function=None): button = QtGui.QPushButton(label) if function is None: button.clicked.connect(lambda: widget.setVisible(widget.isHidden())) else: button.clicked.connect(function) button.setStyleSheet('QPushButton {' 'border-color: black;' 'border-width: 5px;}') buttonBarWidgetLayout.addWidget(button) return button addButton('Info', function=self.toggleInfoViews) self.toggleSeparationButton = addButton(self.separationOnIconString, function=self.toggleSeparation) self.playPauseButton = addButton(self.playIconString, function=self.togglePlay)
Example #7
Source File: widgets.py From pyFlightAnalysis with MIT License | 5 votes |
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 #8
Source File: label_events.py From ConvNetQuake with MIT License | 5 votes |
def set_buttons(self): self.button_layout = QtGui.QHBoxLayout() self.prev_button = QtGui.QPushButton('Previous Event') self.next_button = QtGui.QPushButton('Next Event') # self.catalog_button = QtGui.QPushButton("Save Catalog") self.next_button.clicked.connect(self.next_event) self.prev_button.clicked.connect(self.prev_event) # self.catalog_button.clicked.connect(self.save_catalog) self.button_layout.addWidget(self.prev_button) self.button_layout.addWidget(self.next_button) # self.button_layout.addWidget(self.catalog_button) self.layout.addLayout(self.button_layout)
Example #9
Source File: inputcontrol.py From eegsynth with GNU General Public License v3.0 | 5 votes |
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: widgets.py From pyFlightAnalysis with MIT License | 4 votes |
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)