Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, parent=None):
super().__init__(parent)
self._emitUpdate = True
# make radio buttons and layout ##
self.buttons = {
GridOption.noGrid: QtGui.QRadioButton('No grid'),
GridOption.guessShape: QtGui.QRadioButton('Guess shape'),
GridOption.specifyShape: QtGui.QRadioButton('Specify shape'),
}
btnLayout = QtGui.QVBoxLayout()
self.btnGroup = QtGui.QButtonGroup(self)
for opt in GridOption:
btn = self.buttons[opt]
self.btnGroup.addButton(btn, opt.value)
btnLayout.addWidget(btn)
btnBox = QtGui.QGroupBox('Grid')
btnBox.setLayout(btnLayout)
# make shape spec widget
self.shapeSpec = ShapeSpecificationWidget()
shapeLayout = QtGui.QVBoxLayout()
shapeLayout.addWidget(self.shapeSpec)
shapeBox = QtGui.QGroupBox('Shape')
shapeBox.setLayout(shapeLayout)
def __init__(self, parent=None):
super().__init__(parent=parent)
setMplDefaults()
self.plot = MPLPlot()
self.mplBar = NavBar(self.plot, self)
self.addMplBarOptions()
self.mplBar.setIconSize(QtCore.QSize(16,16))
self.layout = QtGui.QVBoxLayout(self)
self.layout.addWidget(self.plot)
self.layout.addWidget(self.mplBar)
def __init__(self, parent: QtGui.QWidget = None):
"""Constructor for :class:`PlotWidgetContainer`. """
super().__init__(parent=parent)
self.plotWidget = None
self.data = None
self.layout = QtGui.QVBoxLayout(self)
self.layout.setContentsMargins(0, 0, 0, 0)
self.reload = QtGui.QPushButton('Reload')
self.optSetters = {
'filepath': self.fileinput.setText,
'groupname': self.groupinput.setText,
}
self.optGetters = {
'filepath': self.fileinput.text,
'groupname': self.groupinput.text,
}
flayout = QtGui.QFormLayout()
flayout.addRow('File path:', self.fileinput)
flayout.addRow('Group:', self.groupinput)
vlayout = QtGui.QVBoxLayout()
vlayout.addLayout(flayout)
vlayout.addWidget(self.reload)
self.setLayout(vlayout)
self.fileinput.textEdited.connect(
lambda x: self.signalOption('filepath')
)
self.groupinput.textEdited.connect(
lambda x: self.signalOption('groupname')
)
self.reload.pressed.connect(self.node.update)
def __init__(self, parent: QtGui.QWidget = None,
embedWidgetClass: QtGui.QWidget = None,
node: Node = None):
super().__init__(parent)
self.optGetters = {}
self.optSetters = {}
self.node = node
self._emitGuiChange = True
self.widget = None
if embedWidgetClass is not None:
layout = QtGui.QVBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
self.widget = embedWidgetClass()
layout.addWidget(self.widget)
self.setLayout(layout)
}
btnLayout = QtGui.QVBoxLayout()
self.btnGroup = QtGui.QButtonGroup(self)
for opt in GridOption:
btn = self.buttons[opt]
self.btnGroup.addButton(btn, opt.value)
btnLayout.addWidget(btn)
btnBox = QtGui.QGroupBox('Grid')
btnBox.setLayout(btnLayout)
# make shape spec widget
self.shapeSpec = ShapeSpecificationWidget()
shapeLayout = QtGui.QVBoxLayout()
shapeLayout.addWidget(self.shapeSpec)
shapeBox = QtGui.QGroupBox('Shape')
shapeBox.setLayout(shapeLayout)
# Widget layout
layout = QtGui.QHBoxLayout()
layout.addWidget(btnBox)
layout.addWidget(shapeBox)
layout.addStretch()
self.setLayout(layout)
# Connect signals/slots #
self.btnGroup.buttonToggled.connect(self.gridButtonSelected)
self.shapeSpec.confirm.clicked.connect(self.shapeSpecified)
# Default settings