Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
self.tabWidget.addTab(self.Generate, "")
self.Batch = QtWidgets.QWidget()
self.Batch.setObjectName("Batch")
self.gridLayout_3 = QtWidgets.QGridLayout(self.Batch)
self.gridLayout_3.setContentsMargins(21, 21, 21, 5)
self.gridLayout_3.setObjectName("gridLayout_3")
self.label_5 = QtWidgets.QLabel(self.Batch)
self.label_5.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_5.setObjectName("label_5")
self.gridLayout_3.addWidget(self.label_5, 1, 0, 1, 1)
self.batch_wave = QtWidgets.QLineEdit(self.Batch)
self.batch_wave.setObjectName("batch_wave")
self.gridLayout_3.addWidget(self.batch_wave, 1, 1, 1, 6)
self.batchProcessButton = QtWidgets.QPushButton(self.Batch)
self.batchProcessButton.setEnabled(True)
self.batchProcessButton.setMinimumSize(QtCore.QSize(0, 40))
font = QtGui.QFont()
font.setKerning(True)
self.batchProcessButton.setFont(font)
self.batchProcessButton.setAutoDefault(False)
self.batchProcessButton.setObjectName("batchProcessButton")
self.gridLayout_3.addWidget(self.batchProcessButton, 7, 1, 1, 6)
self.label_24 = QtWidgets.QLabel(self.Batch)
self.label_24.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_24.setObjectName("label_24")
self.gridLayout_3.addWidget(self.label_24, 6, 0, 1, 1)
self.label_22 = QtWidgets.QLabel(self.Batch)
self.label_22.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_22.setObjectName("label_22")
self.gridLayout_3.addWidget(self.label_22, 5, 2, 1, 1)
self.label_19 = QtWidgets.QLabel(self.Batch)
self.label_19.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
Form.resize(468, 45)
self.gridLayout = QtWidgets.QGridLayout(Form)
self.gridLayout.setObjectName("gridLayout")
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.loadCurrentRunButton = QtWidgets.QPushButton(Form)
self.loadCurrentRunButton.setText("Load Current Run")
self.loadCurrentRunButton.setMinimumSize(QtCore.QSize(100, 25))
self.loadCurrentRunButton.setToolTip("Load the current run for the current instrument")
self.loadCurrentRunButton.setObjectName("loadCurrentRunButton")
self.incrementRunButton = QtWidgets.QToolButton(Form)
self.incrementRunButton.setText(">")
self.incrementRunButton.setMinimumSize(QtCore.QSize(25, 25))
self.incrementRunButton.setToolTip("Increment the run")
self.incrementRunButton.setObjectName("incrementRunButton")
self.decrementRunButton = QtWidgets.QToolButton(Form)
self.decrementRunButton.setText("<")
self.decrementRunButton.setMinimumSize(QtCore.QSize(25, 25))
self.decrementRunButton.setToolTip("Decrement the run")
self.decrementRunButton.setObjectName("decrementRunButton")
self.instrumentLabel = QtWidgets.QLabel(Form)
self.instrumentLabel.setText("Instrument")
self.instrumentLabel.setToolTip("")
self.instrumentLabel.setObjectName("instrumentLabel")
self.runEdit = QtWidgets.QLineEdit(Form)
self.runEdit.setMinimumSize(QtCore.QSize(0, 25))
def setup_tool_bar(self):
'''
Setup the top tool bar
'''
self.tool_bar = QToolBar(self.public)
self.tool_bar.setObjectName("dockWidgetToolBar")
self.layout.insertWidget(0, self.tool_bar)
self.tool_bar.setIconSize(QSize(16, 16))
self.tool_bar.toggleViewAction().setEnabled(False)
self.tool_bar.toggleViewAction().setVisible(False)
self.public.top_level_changed.connect(self.public.set_toolbar_floating_style)
def minimumSizeHint(self):
"""
This property holds the recommended minimum size for the widget.
Returns
-------
QSize
"""
return QSize(10, 10) # This is totally arbitrary, I just want *some* visible nonzero size
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.search_lineEdit.sizePolicy().hasHeightForWidth())
self.search_lineEdit.setSizePolicy(sizePolicy)
self.search_lineEdit.setMinimumSize(QtCore.QSize(75, 0))
self.search_lineEdit.setMaximumSize(QtCore.QSize(90, 16777215))
self.search_lineEdit.setMaxLength(20)
self.search_lineEdit.setObjectName("search_lineEdit")
self.horizontalLayout.addWidget(self.search_lineEdit)
self.search_btn = QtWidgets.QPushButton(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.search_btn.sizePolicy().hasHeightForWidth())
self.search_btn.setSizePolicy(sizePolicy)
self.search_btn.setMinimumSize(QtCore.QSize(40, 0))
self.search_btn.setMaximumSize(QtCore.QSize(30, 16777215))
self.search_btn.setObjectName("search_btn")
self.horizontalLayout.addWidget(self.search_btn)
self.gridLayout.addLayout(self.horizontalLayout, 1, 0, 1, 1)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.staDate_label = QtWidgets.QLabel(self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.staDate_label.sizePolicy().hasHeightForWidth())
self.staDate_label.setSizePolicy(sizePolicy)
self.staDate_label.setMinimumSize(QtCore.QSize(80, 0))
self.staDate_label.setMaximumSize(QtCore.QSize(90, 16777215))
self.staDate_label.setObjectName("staDate_label")
self.horizontalLayout_4.addWidget(self.staDate_label)
self.label_2 = QtWidgets.QLabel(self.centralwidget)
def sizeHint(self):
return QSize(0, 0)
def __init__(self, parent=None, filename=None):
QPushButton.__init__(self, parent)
PyDMPrimitiveWidget.__init__(self)
self.mouseReleaseEvent = self.push_button_release_event
self.setContextMenuPolicy(Qt.CustomContextMenu)
self.customContextMenuRequested.connect(self.show_context_menu)
self.iconFont = IconFont()
self._icon = self.iconFont.icon("file")
self.setIconSize(QSize(16, 16))
self.setIcon(self._icon)
self._filenames = [filename] if filename is not None else []
self._titles = []
self._macros = []
self.num_additional_items = 0
self._shift_key_was_down = False
self.setCursor(QCursor(self._icon.pixmap(16, 16)))
self._display_menu_items = None
self._display_filename = ""
self._macro_string = None
self._open_in_new_window = False
self.open_in_new_window_action = QAction("Open in New Window", self)
self.open_in_new_window_action.triggered.connect(partial(self.open_display, target=self.NEW_WINDOW))
self._show_icon = True
self._menu_needs_rebuild = True
def create_button(text='', layout=None, tooltip=None, icon=None,
enabled=True, default=False):
"""Create a button, set its title, and add it to the parent."""
button = QtWidgets.QPushButton()
button.setCursor(Qt.PointingHandCursor)
button.setFocusPolicy(Qt.NoFocus)
if text:
button.setText(' ' + text)
if icon is not None:
button.setIcon(icon)
button.setIconSize(QtCore.QSize(defs.small_icon, defs.small_icon))
if tooltip is not None:
button.setToolTip(tooltip)
if layout is not None:
layout.addWidget(button)
if not enabled:
button.setEnabled(False)
if default:
button.setDefault(True)
return button
def __init__(self, parent=None):
super(GraphView, self).__init__(parent)
self.setObjectName('graphView')
self.__graphViewWidget = parent
self.setRenderHint(QtGui.QPainter.Antialiasing)
self.setRenderHint(QtGui.QPainter.TextAntialiasing)
self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
# Explicitly set the scene rect. This ensures all view parameters will be explicitly controlled
# in the event handlers of this class.
size = QtCore.QSize(600, 400);
self.resize(size)
self.setSceneRect(-size.width() * 0.5, -size.height() * 0.5, size.width(), size.height())
self.setAcceptDrops(True)
self.reset()
def event(self, event):
res = QtWidgets.QMessageBox.event(self, event)
event_type = event.type()
if (event_type == QtCore.QEvent.MouseMove or
event_type == QtCore.QEvent.MouseButtonPress):
maxi = QtCore.QSize(defs.max_size, defs.max_size)
self.setMaximumSize(maxi)
text = self.findChild(QtWidgets.QTextEdit)
if text is not None:
expand = QtWidgets.QSizePolicy.Expanding
text.setSizePolicy(QtWidgets.QSizePolicy(expand, expand))
text.setMaximumSize(maxi)
return res