def setup_method(self, method): self.attribute_combo = QtGui.QComboBox() self.lower_value = QtGui.QLineEdit() self.upper_value = QtGui.QLineEdit() self.mode_combo = QtGui.QComboBox() self.flip_button = QtGui.QToolButton() self.log_button = QtGui.QToolButton() self.log_button.setCheckable(True) self.data = Data(x=np.linspace(-100, 100, 10000), y=np.linspace(2, 3, 10000), label='test_data') self.data_collection = DataCollection([self.data]) self.helper = AttributeLimitsHelper(self.attribute_combo, self.lower_value, self.upper_value, mode_combo=self.mode_combo, flip_button=self.flip_button, log_button=self.log_button) self.component_helper = ComponentIDComboHelper(self.attribute_combo, self.data_collection) self.component_helper.append(self.data) self.x_id = self.data.visible_components[0] self.y_id = self.data.visible_components[1]
def __init__(self, parent=None): super(CustomPreferences, self).__init__(parent=parent) self.layout = QtGui.QFormLayout() self.option1 = QtGui.QLineEdit() self.option2 = QtGui.QLineEdit() self.layout.addRow("Option 1", self.option1) self.layout.addRow("Option 2", self.option2) self.setLayout(self.layout)
def __init__(self, parent=None): super(GenericTextBox, self).__init__(parent) self._l = QtGui.QHBoxLayout() self._textbox = QtGui.QLineEdit() self._l.setContentsMargins(2, 2, 2, 2) self._l.addWidget(self._textbox) self.setLayout(self._l)
def __init__(self, parent=None): super(PlotlyPreferences, self).__init__(parent=parent) self.layout = QtGui.QFormLayout() self.text_user = QtGui.QLineEdit() self.text_apikey = QtGui.QLineEdit() self.layout.addRow("Plotly username", self.text_user) self.layout.addRow("Plotly API key", self.text_apikey) self.setLayout(self.layout) self.user = settings.PLOTLY_USER self.apikey = settings.PLOTLY_APIKEY
def __init__(self, argument, parent=None): super(ArgumentWidget, self).__init__(parent) self.layout = QtGui.QHBoxLayout() self.layout.setContentsMargins(1, 0, 1, 1) self.setLayout(self.layout) label = QtGui.QLabel(argument) self._label = label self._component_id = None self.layout.addWidget(label) self.editor = QtGui.QLineEdit() self.editor.setReadOnly(True) try: self.editor.setPlaceholderText("Drag a component from above") except AttributeError: # feature added in Qt 4.7 pass self.layout.addWidget(self.editor) self.setAcceptDrops(True)
def test_connect_float_edit(): class Test(object): a = CallbackProperty() t = Test() line = QtGui.QLineEdit() connect_float_edit(t, 'a', line) line.setText('1.0') line.editingFinished.emit() assert t.a == 1.0 line.setText('4.0') line.editingFinished.emit() assert t.a == 4.0 t.a = 3.0 assert line.text() == '3'
def _setup_widgets(self): self.layout = QtGui.QFormLayout() self.size_widget = QtGui.QSpinBox() self.size_widget.setMinimum(1) self.size_widget.setMaximum(40) self.size_widget.setValue(self.layer.style.markersize) self.label_widget = QtGui.QLineEdit() self.label_widget.setText(self.layer.label) self.label_widget.selectAll() self.symbol_widget = QtGui.QComboBox() for idx, symbol in enumerate(self._symbols): icon = symbol_icon(symbol) self.symbol_widget.addItem(icon, '') if symbol is self.layer.style.marker: self.symbol_widget.setCurrentIndex(idx) self.symbol_widget.setIconSize(QtCore.QSize(20, 20)) self.symbol_widget.setMinimumSize(10, 32) self.color_widget = ColorWidget() self.color_widget.setStyleSheet('ColorWidget {border: 1px solid;}') color = self.layer.style.color color = mpl_to_qt4_color(color, alpha=self.layer.style.alpha) self.set_color(color) self.okcancel = QtGui.QDialogButtonBox(QtGui.QDialogButtonBox.Ok | QtGui.QDialogButtonBox.Cancel) if self._edit_label: self.layout.addRow("Label", self.label_widget) self.layout.addRow("Symbol", self.symbol_widget) self.layout.addRow("Color", self.color_widget) self.layout.addRow("Size", self.size_widget) self.layout.addWidget(self.okcancel) self.setLayout(self.layout) self.layout.setContentsMargins(6, 6, 6, 6)
def __init__(self): self._float = QtGui.QLineEdit()
def setupUi(self, HistogramWidget): HistogramWidget.setObjectName("HistogramWidget") HistogramWidget.resize(240, 207) HistogramWidget.setFocusPolicy(QtCore.Qt.StrongFocus) HistogramWidget.setStyleSheet("") self.horizontalLayout_6 = QtGui.QHBoxLayout(HistogramWidget) self.horizontalLayout_6.setContentsMargins(0, 0, 0, 0) self.horizontalLayout_6.setObjectName("horizontalLayout_6") self.verticalLayout_5 = QtGui.QVBoxLayout() self.verticalLayout_5.setContentsMargins(-1, -1, -1, 10) self.verticalLayout_5.setObjectName("verticalLayout_5") self.option_dashboard = QtGui.QWidget(HistogramWidget) self.option_dashboard.setObjectName("option_dashboard") self.verticalLayout_4 = QtGui.QVBoxLayout(self.option_dashboard) self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.verticalLayout_4.setContentsMargins(0, 0, 0, 0) self.verticalLayout_4.setObjectName("verticalLayout_4") self.verticalLayout_3 = QtGui.QVBoxLayout() self.verticalLayout_3.setSpacing(3) self.verticalLayout_3.setObjectName("verticalLayout_3") self.combo_layout = QtGui.QHBoxLayout() self.combo_layout.setSpacing(1) self.combo_layout.setObjectName("combo_layout") self.attribute_layout = QtGui.QVBoxLayout() self.attribute_layout.setSpacing(1) self.attribute_layout.setObjectName("attribute_layout") self.label_4 = QtGui.QLabel(self.option_dashboard) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_4.sizePolicy().hasHeightForWidth()) self.label_4.setSizePolicy(sizePolicy) self.label_4.setAlignment(QtCore.Qt.AlignCenter) self.label_4.setObjectName("label_4") self.attribute_layout.addWidget(self.label_4) self.attributeCombo = QtGui.QComboBox(self.option_dashboard) self.attributeCombo.setSizeAdjustPolicy( QtGui.QComboBox.AdjustToMinimumContentsLength) self.attributeCombo.setObjectName("attributeCombo") self.attribute_layout.addWidget(self.attributeCombo) self.combo_layout.addLayout(self.attribute_layout) self.verticalLayout_3.addLayout(self.combo_layout) self.horizontalLayout_5 = QtGui.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.binSpinBox = QtGui.QDoubleSpinBox(self.option_dashboard) self.binSpinBox.setKeyboardTracking(False) self.binSpinBox.setDecimals(0) self.binSpinBox.setMinimum(1.0) self.binSpinBox.setMaximum(100000.0) self.binSpinBox.setSingleStep(3.0) self.binSpinBox.setProperty("value", 10.0) self.binSpinBox.setObjectName("binSpinBox") self.horizontalLayout_5.addWidget(self.binSpinBox) self.label = QtGui.QLabel(self.option_dashboard) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) self.label.setObjectName("label") self.horizontalLayout_5.addWidget(self.label) self.verticalLayout_3.addLayout(self.horizontalLayout_5) self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_4.setContentsMargins(-1, 2, -1, 2) self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.label_2 = QtGui.QLabel(self.option_dashboard) self.label_2.setObjectName("label_2") self.horizontalLayout_3.addWidget(self.label_2) self.xmin = QtGui.QLineEdit(self.option_dashboard) self.xmin.setMaxLength(18) self.xmin.setObjectName("xmin") self.horizontalLayout_3.addWidget(self.xmin) self.horizontalLayout_4.addLayout(self.horizontalLayout_3) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.label_5 = QtGui.QLabel(self.option_dashboard) self.label_5.setObjectName("label_5") self.horizontalLayout_2.addWidget(self.label_5) self.xmax = QtGui.QLineEdit(self.option_dashboard) self.xmax.setMaxLength(18) self.xmax.setObjectName("xmax") self.horizontalLayout_2.addWidget(self.xmax) self.horizontalLayout_4.addLayout(self.horizontalLayout_2) self.verticalLayout_3.addLayout(self.horizontalLayout_4) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.normalized_box = QtGui.QCheckBox(self.option_dashboard) self.normalized_box.setObjectName("normalized_box") self.verticalLayout.addWidget(self.normalized_box) self.autoscale_box = QtGui.QCheckBox(self.option_dashboard) self.autoscale_box.setChecked(True) self.autoscale_box.setObjectName("autoscale_box") self.verticalLayout.addWidget(self.autoscale_box) self.cumulative_box = QtGui.QCheckBox(self.option_dashboard) self.cumulative_box.setObjectName("cumulative_box") self.verticalLayout.addWidget(self.cumulative_box) spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.horizontalLayout.addLayout(self.verticalLayout) self.verticalLayout_2 = QtGui.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.xlog_box = QtGui.QCheckBox(self.option_dashboard) self.xlog_box.setObjectName("xlog_box") self.verticalLayout_2.addWidget(self.xlog_box) self.ylog_box = QtGui.QCheckBox(self.option_dashboard) self.ylog_box.setObjectName("ylog_box") self.verticalLayout_2.addWidget(self.ylog_box) spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout_2.addItem(spacerItem1) self.horizontalLayout.addLayout(self.verticalLayout_2) self.verticalLayout_3.addLayout(self.horizontalLayout) self.verticalLayout_4.addLayout(self.verticalLayout_3) self.verticalLayout_5.addWidget(self.option_dashboard) self.horizontalLayout_6.addLayout(self.verticalLayout_5) self.retranslateUi(HistogramWidget) QtCore.QMetaObject.connectSlotsByName(HistogramWidget)
def __init__(self, constraints, parent=None): """ Parameters ---------- constraints : dict The `contstraints` property of a :class:`~glue.core.fitters.BaseFitter1D` object parent : QtGui.QWidget (optional) The parent of this widget """ super(ConstraintsWidget, self).__init__(parent) self.constraints = constraints self.layout = QtGui.QGridLayout() self.layout.setContentsMargins(2, 2, 2, 2) self.layout.setSpacing(4) self.setLayout(self.layout) self.layout.addWidget(QtGui.QLabel("Estimate"), 0, 1) self.layout.addWidget(QtGui.QLabel("Fixed"), 0, 2) self.layout.addWidget(QtGui.QLabel("Bounded"), 0, 3) self.layout.addWidget(QtGui.QLabel("Lower Bound"), 0, 4) self.layout.addWidget(QtGui.QLabel("Upper Bound"), 0, 5) self._widgets = {} names = sorted(list(self.constraints.keys())) for k in names: row = [] w = QtGui.QLabel(k) row.append(w) v = QtGui.QDoubleValidator() e = QtGui.QLineEdit() e.setValidator(v) e.setText(str(constraints[k]['value'] or '')) row.append(e) w = QtGui.QCheckBox() w.setChecked(constraints[k]['fixed']) fix = w row.append(w) w = QtGui.QCheckBox() limits = constraints[k]['limits'] w.setChecked(limits is not None) bound = w row.append(w) e = QtGui.QLineEdit() e.setValidator(v) if limits is not None: e.setText(str(limits[0])) row.append(e) e = QtGui.QLineEdit() e.setValidator(v) if limits is not None: e.setText(str(limits[1])) row.append(e) def unset(w): def result(active): if active: w.setChecked(False) return result fix.toggled.connect(unset(bound)) bound.toggled.connect(unset(fix)) self._widgets[k] = row for i, row in enumerate(names, 1): for j, widget in enumerate(self._widgets[row]): self.layout.addWidget(widget, i, j)
def setupUi(self, ScatterWidget): ScatterWidget.setObjectName("ScatterWidget") ScatterWidget.resize(300, 349) ScatterWidget.setBaseSize(QtCore.QSize(555, 500)) ScatterWidget.setFocusPolicy(QtCore.Qt.StrongFocus) ScatterWidget.setStyleSheet("") self.horizontalLayout = QtGui.QHBoxLayout(ScatterWidget) self.horizontalLayout.setContentsMargins(3, 2, 2, 4) self.horizontalLayout.setObjectName("horizontalLayout") self.option_dashboard = QtGui.QWidget(ScatterWidget) self.option_dashboard.setObjectName("option_dashboard") self.verticalLayout = QtGui.QVBoxLayout(self.option_dashboard) self.verticalLayout.setSpacing(4) self.verticalLayout.setContentsMargins(0, 0, 0, 10) self.verticalLayout.setObjectName("verticalLayout") self.xAxisLayout = QtGui.QHBoxLayout() self.xAxisLayout.setSpacing(8) self.xAxisLayout.setContentsMargins(0, 0, 0, 0) self.xAxisLayout.setObjectName("xAxisLayout") self.xlabel = QtGui.QLabel(self.option_dashboard) self.xlabel.setObjectName("xlabel") self.xAxisLayout.addWidget(self.xlabel) self.xAxisComboBox = QtGui.QComboBox(self.option_dashboard) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.xAxisComboBox.sizePolicy().hasHeightForWidth()) self.xAxisComboBox.setSizePolicy(sizePolicy) self.xAxisComboBox.setSizeAdjustPolicy( QtGui.QComboBox.AdjustToMinimumContentsLength) self.xAxisComboBox.setObjectName("xAxisComboBox") self.xAxisLayout.addWidget(self.xAxisComboBox) self.xLogCheckBox = QtGui.QCheckBox(self.option_dashboard) self.xLogCheckBox.setObjectName("xLogCheckBox") self.xAxisLayout.addWidget(self.xLogCheckBox) self.xFlipCheckBox = QtGui.QCheckBox(self.option_dashboard) self.xFlipCheckBox.setObjectName("xFlipCheckBox") self.xAxisLayout.addWidget(self.xFlipCheckBox) self.xAxisLayout.setStretch(1, 4) self.verticalLayout.addLayout(self.xAxisLayout) self.yAxisLayout = QtGui.QHBoxLayout() self.yAxisLayout.setSpacing(8) self.yAxisLayout.setObjectName("yAxisLayout") self.ylabel = QtGui.QLabel(self.option_dashboard) self.ylabel.setObjectName("ylabel") self.yAxisLayout.addWidget(self.ylabel) self.yAxisComboBox = QtGui.QComboBox(self.option_dashboard) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.yAxisComboBox.sizePolicy().hasHeightForWidth()) self.yAxisComboBox.setSizePolicy(sizePolicy) self.yAxisComboBox.setSizeAdjustPolicy( QtGui.QComboBox.AdjustToMinimumContentsLength) self.yAxisComboBox.setObjectName("yAxisComboBox") self.yAxisLayout.addWidget(self.yAxisComboBox) self.yLogCheckBox = QtGui.QCheckBox(self.option_dashboard) self.yLogCheckBox.setObjectName("yLogCheckBox") self.yAxisLayout.addWidget(self.yLogCheckBox) self.yFlipCheckBox = QtGui.QCheckBox(self.option_dashboard) self.yFlipCheckBox.setObjectName("yFlipCheckBox") self.yAxisLayout.addWidget(self.yFlipCheckBox) self.yAxisLayout.setStretch(1, 4) self.verticalLayout.addLayout(self.yAxisLayout) self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.snapLimits = QtGui.QPushButton(self.option_dashboard) self.snapLimits.setObjectName("snapLimits") self.horizontalLayout_3.addWidget(self.snapLimits) self.swapAxes = QtGui.QPushButton(self.option_dashboard) self.swapAxes.setObjectName("swapAxes") self.horizontalLayout_3.addWidget(self.swapAxes) self.verticalLayout.addLayout(self.horizontalLayout_3) self.hidden_attributes = QtGui.QCheckBox(self.option_dashboard) self.hidden_attributes.setObjectName("hidden_attributes") self.verticalLayout.addWidget(self.hidden_attributes) self.line = QtGui.QFrame(self.option_dashboard) self.line.setFrameShadow(QtGui.QFrame.Sunken) self.line.setLineWidth(2) self.line.setMidLineWidth(0) self.line.setFrameShape(QtGui.QFrame.HLine) self.line.setFrameShadow(QtGui.QFrame.Sunken) self.line.setObjectName("line") self.verticalLayout.addWidget(self.line) self.label = QtGui.QLabel(self.option_dashboard) self.label.setFrameShape(QtGui.QFrame.NoFrame) self.label.setFrameShadow(QtGui.QFrame.Sunken) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.verticalLayout.addWidget(self.label) self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.xmin_label = QtGui.QLabel(self.option_dashboard) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.xmin_label.sizePolicy().hasHeightForWidth()) self.xmin_label.setSizePolicy(sizePolicy) self.xmin_label.setMinimumSize(QtCore.QSize(40, 0)) self.xmin_label.setObjectName("xmin_label") self.horizontalLayout_4.addWidget(self.xmin_label) self.xmin = QtGui.QLineEdit(self.option_dashboard) self.xmin.setObjectName("xmin") self.horizontalLayout_4.addWidget(self.xmin) self.xmax_label = QtGui.QLabel(self.option_dashboard) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.xmax_label.sizePolicy().hasHeightForWidth()) self.xmax_label.setSizePolicy(sizePolicy) self.xmax_label.setMinimumSize(QtCore.QSize(40, 0)) self.xmax_label.setObjectName("xmax_label") self.horizontalLayout_4.addWidget(self.xmax_label) self.xmax = QtGui.QLineEdit(self.option_dashboard) self.xmax.setObjectName("xmax") self.horizontalLayout_4.addWidget(self.xmax) self.verticalLayout.addLayout(self.horizontalLayout_4) self.horizontalLayout_5 = QtGui.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.ymin_label = QtGui.QLabel(self.option_dashboard) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ymin_label.sizePolicy().hasHeightForWidth()) self.ymin_label.setSizePolicy(sizePolicy) self.ymin_label.setMinimumSize(QtCore.QSize(40, 0)) self.ymin_label.setObjectName("ymin_label") self.horizontalLayout_5.addWidget(self.ymin_label) self.ymin = QtGui.QLineEdit(self.option_dashboard) self.ymin.setObjectName("ymin") self.horizontalLayout_5.addWidget(self.ymin) self.ymax_label = QtGui.QLabel(self.option_dashboard) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ymax_label.sizePolicy().hasHeightForWidth()) self.ymax_label.setSizePolicy(sizePolicy) self.ymax_label.setMinimumSize(QtCore.QSize(40, 0)) self.ymax_label.setObjectName("ymax_label") self.horizontalLayout_5.addWidget(self.ymax_label) self.ymax = QtGui.QLineEdit(self.option_dashboard) self.ymax.setObjectName("ymax") self.horizontalLayout_5.addWidget(self.ymax) self.verticalLayout.addLayout(self.horizontalLayout_5) spacerItem = QtGui.QSpacerItem(1, 1, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.verticalLayout.addItem(spacerItem) self.horizontalLayout.addWidget(self.option_dashboard) self.retranslateUi(ScatterWidget) QtCore.QMetaObject.connectSlotsByName(ScatterWidget)
def setupUi(self, CustomComponentWidget): CustomComponentWidget.setObjectName("CustomComponentWidget") CustomComponentWidget.resize(804, 585) self.horizontalLayout_4 = QtGui.QHBoxLayout(CustomComponentWidget) self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.verticalLayout_5 = QtGui.QVBoxLayout() self.verticalLayout_5.setObjectName("verticalLayout_5") self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.verticalLayout_2 = QtGui.QVBoxLayout() self.verticalLayout_2.setObjectName("verticalLayout_2") self.label = QtGui.QLabel(CustomComponentWidget) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label.sizePolicy().hasHeightForWidth()) self.label.setSizePolicy(sizePolicy) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.verticalLayout_2.addWidget(self.label) self.component_list = QtGui.QListWidget(CustomComponentWidget) self.component_list.setDefaultDropAction(QtCore.Qt.IgnoreAction) self.component_list.setObjectName("component_list") self.verticalLayout_2.addWidget(self.component_list) self.verticalLayout_2.setStretch(0, 5) self.horizontalLayout.addLayout(self.verticalLayout_2) self.verticalLayout = QtGui.QVBoxLayout() self.verticalLayout.setObjectName("verticalLayout") self.label_2 = QtGui.QLabel(CustomComponentWidget) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_2.sizePolicy().hasHeightForWidth()) self.label_2.setSizePolicy(sizePolicy) self.label_2.setAlignment(QtCore.Qt.AlignCenter) self.label_2.setObjectName("label_2") self.verticalLayout.addWidget(self.label_2) self.data_list = QtGui.QListWidget(CustomComponentWidget) self.data_list.setObjectName("data_list") self.verticalLayout.addWidget(self.data_list) self.verticalLayout.setStretch(0, 5) self.verticalLayout.setStretch(1, 1) self.horizontalLayout.addLayout(self.verticalLayout) self.horizontalLayout.setStretch(0, 1) self.horizontalLayout.setStretch(1, 1) self.verticalLayout_5.addLayout(self.horizontalLayout) self.verticalLayout_3 = QtGui.QVBoxLayout() self.verticalLayout_3.setObjectName("verticalLayout_3") self.label_3 = QtGui.QLabel(CustomComponentWidget) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_3.sizePolicy().hasHeightForWidth()) self.label_3.setSizePolicy(sizePolicy) self.label_3.setAlignment(QtCore.Qt.AlignCenter) self.label_3.setObjectName("label_3") self.verticalLayout_3.addWidget(self.label_3) self.expression = QtGui.QLineEdit(CustomComponentWidget) self.expression.setAlignment(QtCore.Qt.AlignCenter) self.expression.setObjectName("expression") self.verticalLayout_3.addWidget(self.expression) self.verticalLayout_5.addLayout(self.verticalLayout_3) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.verticalLayout_4 = QtGui.QVBoxLayout() self.verticalLayout_4.setObjectName("verticalLayout_4") self.label_4 = QtGui.QLabel(CustomComponentWidget) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.label_4.sizePolicy().hasHeightForWidth()) self.label_4.setSizePolicy(sizePolicy) self.label_4.setAlignment(QtCore.Qt.AlignCenter) self.label_4.setObjectName("label_4") self.verticalLayout_4.addWidget(self.label_4) self.new_label = QtGui.QLineEdit(CustomComponentWidget) self.new_label.setObjectName("new_label") self.verticalLayout_4.addWidget(self.new_label) self.verticalLayout_4.setStretch(0, 5) self.verticalLayout_4.setStretch(1, 1) self.horizontalLayout_2.addLayout(self.verticalLayout_4) self.buttonBox = QtGui.QDialogButtonBox(CustomComponentWidget) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.buttonBox.sizePolicy().hasHeightForWidth()) self.buttonBox.setSizePolicy(sizePolicy) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel | QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.horizontalLayout_2.addWidget(self.buttonBox) self.horizontalLayout_2.setStretch(0, 10) self.verticalLayout_5.addLayout(self.horizontalLayout_2) self.verticalLayout_5.setStretch(0, 5) self.verticalLayout_5.setStretch(1, 1) self.verticalLayout_5.setStretch(2, 1) self.horizontalLayout_4.addLayout(self.verticalLayout_5) self.retranslateUi(CustomComponentWidget) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), CustomComponentWidget.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), CustomComponentWidget.reject) QtCore.QMetaObject.connectSlotsByName(CustomComponentWidget)
def setupUi(self, SubsetFacet): SubsetFacet.setObjectName("SubsetFacet") SubsetFacet.resize(366, 405) self.verticalLayout = QtGui.QVBoxLayout(SubsetFacet) self.verticalLayout.setContentsMargins(4, 4, 4, 4) self.verticalLayout.setObjectName("verticalLayout") self.component_selector = ComponentSelector(SubsetFacet) sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.component_selector.sizePolicy().hasHeightForWidth()) self.component_selector.setSizePolicy(sizePolicy) self.component_selector.setObjectName("component_selector") self.verticalLayout.addWidget(self.component_selector) self.horizontalLayout_5 = QtGui.QHBoxLayout() self.horizontalLayout_5.setObjectName("horizontalLayout_5") self.label = QtGui.QLabel(SubsetFacet) self.label.setObjectName("label") self.horizontalLayout_5.addWidget(self.label) self.num = QtGui.QSpinBox(SubsetFacet) self.num.setMaximum(20) self.num.setProperty("value", 5) self.num.setObjectName("num") self.horizontalLayout_5.addWidget(self.num) self.verticalLayout.addLayout(self.horizontalLayout_5) self.horizontalLayout_4 = QtGui.QHBoxLayout() self.horizontalLayout_4.setObjectName("horizontalLayout_4") self.horizontalLayout_3 = QtGui.QHBoxLayout() self.horizontalLayout_3.setObjectName("horizontalLayout_3") self.label_3 = QtGui.QLabel(SubsetFacet) self.label_3.setObjectName("label_3") self.horizontalLayout_3.addWidget(self.label_3) self.min = QtGui.QLineEdit(SubsetFacet) self.min.setObjectName("min") self.horizontalLayout_3.addWidget(self.min) self.horizontalLayout_4.addLayout(self.horizontalLayout_3) self.horizontalLayout_2 = QtGui.QHBoxLayout() self.horizontalLayout_2.setObjectName("horizontalLayout_2") self.label_4 = QtGui.QLabel(SubsetFacet) self.label_4.setObjectName("label_4") self.horizontalLayout_2.addWidget(self.label_4) self.max = QtGui.QLineEdit(SubsetFacet) self.max.setObjectName("max") self.horizontalLayout_2.addWidget(self.max) self.log = QtGui.QCheckBox(SubsetFacet) self.log.setObjectName("log") self.horizontalLayout_2.addWidget(self.log) self.horizontalLayout_4.addLayout(self.horizontalLayout_2) self.verticalLayout.addLayout(self.horizontalLayout_4) self.horizontalLayout = QtGui.QHBoxLayout() self.horizontalLayout.setObjectName("horizontalLayout") self.label_2 = QtGui.QLabel(SubsetFacet) self.label_2.setObjectName("label_2") self.horizontalLayout.addWidget(self.label_2) self.color_scale = QtGui.QComboBox(SubsetFacet) self.color_scale.setObjectName("color_scale") self.horizontalLayout.addWidget(self.color_scale) self.verticalLayout.addLayout(self.horizontalLayout) self.buttonBox = QtGui.QDialogButtonBox(SubsetFacet) self.buttonBox.setOrientation(QtCore.Qt.Horizontal) self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok) self.buttonBox.setObjectName("buttonBox") self.verticalLayout.addWidget(self.buttonBox) self.verticalLayout.setStretch(0, 5) self.retranslateUi(SubsetFacet) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), SubsetFacet.accept) QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), SubsetFacet.reject) QtCore.QMetaObject.connectSlotsByName(SubsetFacet)