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):
qt.QWidget.__init__(self, parent)
layout1 = qt.QHBoxLayout(self)
self.TextLabel = qt.QLabel(self)
self.TextLabel.setText("TextLabel")
self.Entry = qt.QLineEdit(self)
layout1.addWidget(self.TextLabel)
layout1.addWidget(self.Entry)
def __init__(self, text, parent=None):
"""
:param text: the legend
:param parent: the Qt parent if any
"""
qt.QLabel.__init__(self, text, parent)
self.setLayout(qt.QVBoxLayout())
self.layout().setContentsMargins(0, 0, 0, 0)
def __createInfoLayout(self, parent):
layout = qt.QGridLayout()
header = qt.QLabel(parent=parent)
header.setText("Time: ")
label = qt.QLabel(parent=parent)
label.setText("")
layout.addWidget(header, 0, 0)
layout.addWidget(label, 0, 1)
self.__timeLabel = label
header = qt.QLabel(parent=parent)
header.setText("Nb polygons: ")
label = qt.QLabel(parent=parent)
label.setText("")
layout.addWidget(header, 2, 0)
layout.addWidget(label, 2, 1)
self.__polygonsLabel = label
header = qt.QLabel(parent=parent)
header.setText("Nb points: ")
label = qt.QLabel(parent=parent)
label.setText("")
layout.addWidget(header, 1, 0)
layout.addWidget(label, 1, 1)
self.__pointsLabel = label
return layout
def __init__(self, parent=None, n=None):
qt.QWidget.__init__(self, parent)
self.layout = qt.QHBoxLayout(self)
self.layout.setContentsMargins(0, 2, 0, 2)
self.layout.setSpacing(10)
self.rowsCB = qt.QComboBox(self)
self.columnsCB = qt.QComboBox(self)
self.layout.addWidget(qt.QLabel("Rows dimension", self))
self.layout.addWidget(self.rowsCB)
self.layout.addWidget(qt.QLabel(" ", self))
self.layout.addWidget(qt.QLabel("Columns dimension", self))
self.layout.addWidget(self.columnsCB)
self.layout.addStretch(1)
self._slotsAreConnected = False
if n is not None:
self.setNDimensions(n)
def __init__(self, parent=None):
qt.QWidget.__init__(self, parent=parent)
self._nPoints = qt.QSpinBox(self)
self._nPoints.setRange(1, 9999)
self._nPoints.setValue(1024)
self._nPoints.valueChanged[int].connect(self.__widgetChanged)
layout = qt.QHBoxLayout(self)
layout.setContentsMargins(0, 0, 0, 0)
label = qt.QLabel('Samples:')
label.setToolTip("Number of sample points of the profile")
layout.addWidget(label)
layout.addWidget(self._nPoints)
main_panel.setLayout(qt.QVBoxLayout())
layout = main_panel.layout()
layout.addWidget(qt.QLabel("WaitingPushButton"))
layout.addWidget(self.createWaitingPushButton())
layout.addWidget(self.createWaitingPushButton2())
layout.addWidget(qt.QLabel("ThreadPoolPushButton"))
layout.addWidget(self.createThreadPoolPushButton())
layout.addWidget(qt.QLabel("RangeSlider"))
layout.addWidget(self.createRangeSlider())
layout.addWidget(self.createRangeSliderWithBackground())
panel = self.createLegendIconPanel(self)
layout.addWidget(qt.QLabel("LegendIconWidget"))
layout.addWidget(panel)
panel = self.createElidedLabelPanel(self)
layout.addWidget(qt.QLabel("ElidedLabel"))
layout.addWidget(panel)
self.setCentralWidget(main_panel)
def getEditor(self, parent, option, index):
layout = qt.QHBoxLayout()
layout.setContentsMargins(0, 0, 0, 0)
layout.setSpacing(0)
layout.addWidget(qt.QLabel('0'))
layout.addStretch(1)
layout.addWidget(qt.QLabel('1'))
editor = qt.QWidget(parent)
editor.setLayout(layout)
return editor
def _initTransparencyWidget(self):
""" Init the mask transparency widget """
transparencyWidget = qt.QWidget(parent=self)
grid = qt.QGridLayout()
grid.setContentsMargins(0, 0, 0, 0)
self.transparencySlider = qt.QSlider(qt.Qt.Horizontal, parent=transparencyWidget)
self.transparencySlider.setRange(3, 10)
self.transparencySlider.setValue(8)
self.transparencySlider.setToolTip(
'Set the transparency of the mask display')
self.transparencySlider.valueChanged.connect(self._updateColors)
grid.addWidget(qt.QLabel('Display:', parent=transparencyWidget), 0, 0)
grid.addWidget(self.transparencySlider, 0, 1, 1, 3)
grid.addWidget(qt.QLabel('<small><b>Transparent</b></small>', parent=transparencyWidget), 1, 1)
grid.addWidget(qt.QLabel('<small><b>Opaque</b></small>', parent=transparencyWidget), 1, 3)
transparencyWidget.setLayout(grid)
return transparencyWidget
def __init__(self, parent=None):
qt.QWidget.__init__(self, parent)
self.resize(373, 44)
textfieldlayout = qt.QHBoxLayout(self)
layout2 = qt.QHBoxLayout(None)
layout2.setContentsMargins(0, 0, 0, 0)
layout2.setSpacing(6)
spacer = qt.QSpacerItem(20, 20,
qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum)
layout2.addItem(spacer)
self.TextLabel = qt.QLabel(self)
self.TextLabel.setText(str("TextLabel"))
layout2.addWidget(self.TextLabel)
spacer_2 = qt.QSpacerItem(20, 20,
qt.QSizePolicy.Expanding, qt.QSizePolicy.Minimum)
layout2.addItem(spacer_2)
textfieldlayout.addLayout(layout2)