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]
Exemple #2
0
    def _setup_widget(self):
        w = QtGui.QWidget()
        l = QtGui.QFormLayout()
        w.setLayout(l)

        combo = QtGui.QComboBox()
        combo.addItem("Mean", userData=Aggregate.mean)
        combo.addItem("Median", userData=Aggregate.median)
        combo.addItem("Max", userData=Aggregate.max)
        combo.addItem("Centroid", userData=Aggregate.mom1)
        combo.addItem("Linewidth", userData=Aggregate.mom2)

        run = QtGui.QPushButton("Collapse")
        save = QtGui.QPushButton("Save as FITS file")

        buttons = QtGui.QHBoxLayout()
        buttons.addWidget(run)
        buttons.addWidget(save)

        self._save = save
        self._run = run

        l.addRow("", combo)
        l.addRow("", buttons)

        self.widget = w
        self._combo = combo
        self._agg = None
def test_connect_current_combo():
    class Test(object):
        a = CallbackProperty()

    t = Test()

    combo = QtGui.QComboBox()
    combo.addItem('a', 'a')
    combo.addItem('b', 'b')

    connect_current_combo(t, 'a', combo)

    combo.setCurrentIndex(1)
    assert t.a == 'b'

    combo.setCurrentIndex(0)
    assert t.a == 'a'

    combo.setCurrentIndex(-1)
    assert t.a is None

    t.a = 'b'
    assert combo.currentIndex() == 1

    t.a = 'a'
    assert combo.currentIndex() == 0

    # TODO: should the following not return an error?
    with pytest.raises(ValueError) as exc:
        t.a = 'c'
    assert exc.value.args[0] == 'c not found in combo box'

    t.a = None
    assert combo.currentIndex() == -1
    def setupUi(self, ComponentSelector):
        ComponentSelector.setObjectName("ComponentSelector")
        ComponentSelector.resize(295, 452)
        self.verticalLayout_2 = QtGui.QVBoxLayout(ComponentSelector)
        self.verticalLayout_2.setContentsMargins(2, 2, 2, 2)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtGui.QLabel(ComponentSelector)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.data_selector = QtGui.QComboBox(ComponentSelector)
        self.data_selector.setObjectName("data_selector")
        self.verticalLayout.addWidget(self.data_selector)
        self.label_2 = QtGui.QLabel(ComponentSelector)
        self.label_2.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.label_2.setAlignment(QtCore.Qt.AlignCenter)
        self.label_2.setObjectName("label_2")
        self.verticalLayout.addWidget(self.label_2)
        self.component_selector = GlueListWidget(ComponentSelector)
        self.component_selector.setObjectName("component_selector")
        self.verticalLayout.addWidget(self.component_selector)
        self.verticalLayout_2.addLayout(self.verticalLayout)

        self.retranslateUi(ComponentSelector)
        QtCore.QMetaObject.connectSlotsByName(ComponentSelector)
Exemple #5
0
    def __init__(self, label='', pix2world=None, lo=0, hi=10,
                 parent=None, aggregation=None):
        super(SliceWidget, self).__init__(parent)
        if aggregation is not None:
            raise NotImplemented("Aggregation option not implemented")
        if pix2world is not None:
            raise NotImplemented("Pix2world option not implemented")

        layout = QtGui.QVBoxLayout()
        layout.setContentsMargins(3, 1, 3, 1)
        layout.setSpacing(0)

        top = QtGui.QHBoxLayout()
        top.setContentsMargins(3, 3, 3, 3)
        label = QtGui.QLabel(label)
        top.addWidget(label)

        mode = QtGui.QComboBox()
        mode.addItem('x', 'x')
        mode.addItem('y', 'y')
        mode.addItem('slice', 'slice')
        mode.currentIndexChanged.connect(lambda x:
                                         self.mode_changed.emit(self.mode))
        mode.currentIndexChanged.connect(self._update_mode)
        top.addWidget(mode)

        layout.addLayout(top)

        slider = load_ui('data_slice_widget.ui', None,
                         directory=os.path.dirname(__file__))
        slider.slider

        slider.slider.setMinimum(lo)
        slider.slider.setMaximum(hi)
        slider.slider.setValue((lo + hi) / 2)
        slider.slider.valueChanged.connect(lambda x:
                                           self.slice_changed.emit(self.mode))
        slider.slider.valueChanged.connect(lambda x: slider.label.setText(str(x)))

        slider.label.setMinimumWidth(50)
        slider.label.setText(str(slider.slider.value()))
        slider.label.textChanged.connect(lambda x: slider.slider.setValue(int(x)))

        slider.first.clicked.connect(nonpartial(self._browse_slice, 'first'))
        slider.prev.clicked.connect(nonpartial(self._browse_slice, 'prev'))
        slider.next.clicked.connect(nonpartial(self._browse_slice, 'next'))
        slider.last.clicked.connect(nonpartial(self._browse_slice, 'last'))

        layout.addWidget(slider)

        self.setLayout(layout)

        self._ui_label = label
        self._ui_slider = slider
        self._ui_mode = mode
        self._update_mode()
        self._frozen = False
Exemple #6
0
    def _build_ui(self):
        w = QtGui.QComboBox()
        for p in sorted(self.params):
            w.addItem(p)

        if isinstance(self.params, list):
            self.params = dict((p, p) for p in self.params)

        w.currentIndexChanged.connect(nonpartial(self.changed))
        return w
def test_component_id_combo_helper():

    combo = QtGui.QComboBox()

    dc = DataCollection([])

    helper = ComponentIDComboHelper(combo, dc)

    assert _items_as_string(combo) == ""

    data1 = Data(x=[1, 2, 3], y=[2, 3, 4], label='data1')

    dc.append(data1)
    helper.append(data1)

    assert _items_as_string(combo) == "x:y"

    data2 = Data(a=[1, 2, 3], b=['a', 'b', 'c'], label='data2')

    dc.append(data2)
    helper.append(data2)

    assert _items_as_string(combo) == "data1:x:y:data2:a:b"

    helper.categorical = False

    assert _items_as_string(combo) == "data1:x:y:data2:a"

    helper.numeric = False

    assert _items_as_string(combo) == "data1:data2"

    helper.categorical = True
    helper.numeric = True

    helper.visible = False
    assert _items_as_string(
        combo
    ) == "data1:Pixel Axis 0:World 0:x:y:data2:Pixel Axis 0:World 0:a:b"
    helper.visible = True

    dc.remove(data2)

    assert _items_as_string(combo) == "x:y"

    # TODO: check that renaming a component updates the combo
    # data1.id['x'].label = 'z'
    # assert _items_as_string(combo) == "z:y"

    helper.remove(data1)

    assert _items_as_string(combo) == ""
Exemple #8
0
    def __init__(self,
                 attribute_combo,
                 lower_value,
                 upper_value,
                 mode_combo=None,
                 flip_button=None,
                 log_button=None,
                 data=None,
                 limits_cache=None):

        self.component_id_combo = attribute_combo
        self.mode_combo = mode_combo
        self.lower_value = lower_value
        self.upper_value = upper_value
        self.flip_button = flip_button
        self.log_button = log_button

        self.component_id_combo.currentIndexChanged.connect(
            self._update_limits)

        self.lower_value.editingFinished.connect(self._manual_edit)
        self.upper_value.editingFinished.connect(self._manual_edit)

        if self.log_button is None:
            self.log_button = QtGui.QToolButton()

        self.log_button.toggled.connect(self._manual_edit)

        if self.mode_combo is None:
            # Make hidden combo box to avoid having to always figure out if the
            # combo mode exists. This will then always be set to Min/Max.
            self.mode_combo = QtGui.QComboBox()

        self._setup_mode_combo()
        self.mode_combo.currentIndexChanged.connect(self._update_mode)

        if self.flip_button is not None:
            self.flip_button.clicked.connect(self._flip_limits)

        if limits_cache is None:
            limits_cache = {}

        self._limits = limits_cache
        self._callbacks = []
def test_data_collection_combo_helper():

    combo = QtGui.QComboBox()

    dc = DataCollection([])

    helper = DataCollectionComboHelper(combo, dc)

    data1 = Data(x=[1, 2, 3], y=[2, 3, 4], label='data1')

    dc.append(data1)

    assert _items_as_string(combo) == "data1"

    data1.label = 'mydata1'
    assert _items_as_string(combo) == "mydata1"

    dc.remove(data1)

    assert _items_as_string(combo) == ""
Exemple #10
0
    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)
Exemple #11
0
    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)
Exemple #12
0
 def _build_ui(self):
     result = QtGui.QComboBox()
     result.currentIndexChanged.connect(nonpartial(self.changed))
     return result
 def __init__(self):
     self._combo = QtGui.QComboBox()
     self._combo.addItem('a')
     self._combo.addItem('b')
    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)
Exemple #15
0
                      filter=lambda msg: msg.sender is self._datasets)


if __name__ == "__main__":

    from glue.external.qt import get_qapp

    app = get_qapp()

    window = QtGui.QWidget()

    layout = QtGui.QVBoxLayout()

    window.setLayout(layout)

    data_combo = QtGui.QComboBox()
    layout.addWidget(data_combo)

    cid1_combo = QtGui.QComboBox()
    layout.addWidget(cid1_combo)

    cid2_combo = QtGui.QComboBox()
    layout.addWidget(cid2_combo)

    d1 = Data(x=[1,2,3], y=[2,3,4], label='banana')
    d2 = Data(a=[0,1,1], b=[2,1,1], label='apple')
    dc = DataCollection([d1, d2])

    helper = DataCollectionComboHelper(data_combo, dc)

    helper.add_component_id_combo(cid1_combo)
Exemple #16
0
    def setupUi(self, LinkEquation):
        LinkEquation.setObjectName("LinkEquation")
        LinkEquation.resize(466, 605)
        self.horizontalLayout_4 = QtGui.QHBoxLayout(LinkEquation)
        self.horizontalLayout_4.setContentsMargins(4, 4, 4, 4)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.top_label = QtGui.QLabel(LinkEquation)
        font = QtGui.QFont()
        font.setPointSize(14)
        font.setWeight(50)
        font.setBold(False)
        self.top_label.setFont(font)
        self.top_label.setScaledContents(False)
        self.top_label.setAlignment(QtCore.Qt.AlignCenter)
        self.top_label.setObjectName("top_label")
        self.verticalLayout.addWidget(self.top_label)
        self.function = QtGui.QComboBox(LinkEquation)
        self.function.setObjectName("function")
        self.verticalLayout.addWidget(self.function)
        self.info = QtGui.QLabel(LinkEquation)
        font = QtGui.QFont()
        font.setPointSize(18)
        self.info.setFont(font)
        self.info.setAlignment(QtCore.Qt.AlignCenter)
        self.info.setObjectName("info")
        self.verticalLayout.addWidget(self.info)
        self.help_txt = QtGui.QLabel(LinkEquation)
        font = QtGui.QFont()
        font.setFamily("Helvetica")
        font.setPointSize(12)
        font.setItalic(True)
        self.help_txt.setFont(font)
        self.help_txt.setAlignment(QtCore.Qt.AlignCenter)
        self.help_txt.setMargin(0)
        self.help_txt.setObjectName("help_txt")
        self.verticalLayout.addWidget(self.help_txt)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.input_label = QtGui.QLabel(LinkEquation)
        font = QtGui.QFont()
        font.setPointSize(14)
        font.setWeight(75)
        font.setBold(True)
        self.input_label.setFont(font)
        self.input_label.setAlignment(QtCore.Qt.AlignLeading
                                      | QtCore.Qt.AlignLeft
                                      | QtCore.Qt.AlignTop)
        self.input_label.setObjectName("input_label")
        self.horizontalLayout.addWidget(self.input_label)
        self.input_canvas = QtGui.QWidget(LinkEquation)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.input_canvas.sizePolicy().hasHeightForWidth())
        self.input_canvas.setSizePolicy(sizePolicy)
        self.input_canvas.setMinimumSize(QtCore.QSize(0, 0))
        self.input_canvas.setObjectName("input_canvas")
        self.horizontalLayout.addWidget(self.input_canvas)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.output_label = QtGui.QLabel(LinkEquation)
        font = QtGui.QFont()
        font.setPointSize(14)
        font.setWeight(75)
        font.setBold(True)
        self.output_label.setFont(font)
        self.output_label.setAlignment(QtCore.Qt.AlignLeading
                                       | QtCore.Qt.AlignLeft
                                       | QtCore.Qt.AlignTop)
        self.output_label.setObjectName("output_label")
        self.horizontalLayout_2.addWidget(self.output_label)
        self.output_canvas = QtGui.QWidget(LinkEquation)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.output_canvas.sizePolicy().hasHeightForWidth())
        self.output_canvas.setSizePolicy(sizePolicy)
        self.output_canvas.setMinimumSize(QtCore.QSize(0, 0))
        self.output_canvas.setObjectName("output_canvas")
        self.horizontalLayout_2.addWidget(self.output_canvas)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem)
        self.addButton = QtGui.QPushButton(LinkEquation)
        self.addButton.setObjectName("addButton")
        self.horizontalLayout_3.addWidget(self.addButton)
        self.verticalLayout.addLayout(self.horizontalLayout_3)
        self.verticalLayout.setStretch(4, 8)
        self.verticalLayout.setStretch(5, 8)
        self.horizontalLayout_4.addLayout(self.verticalLayout)

        self.retranslateUi(LinkEquation)
        QtCore.QMetaObject.connectSlotsByName(LinkEquation)
Exemple #17
0
    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)
Exemple #18
0
    def setupUi(self, DataConnector):
        DataConnector.setObjectName("DataConnector")
        DataConnector.resize(856, 670)
        self.verticalLayout_7 = QtGui.QVBoxLayout(DataConnector)
        self.verticalLayout_7.setObjectName("verticalLayout_7")
        self.verticalLayout_6 = QtGui.QVBoxLayout()
        self.verticalLayout_6.setObjectName("verticalLayout_6")
        self.horizontalLayout_6 = QtGui.QHBoxLayout()
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
        self.verticalLayout_4 = QtGui.QVBoxLayout()
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.left_label = QtGui.QLabel(DataConnector)
        self.left_label.setAlignment(QtCore.Qt.AlignCenter)
        self.left_label.setObjectName("left_label")
        self.verticalLayout.addWidget(self.left_label)
        self.left_combo = QtGui.QComboBox(DataConnector)
        self.left_combo.setObjectName("left_combo")
        self.verticalLayout.addWidget(self.left_combo)
        self.left_list = QtGui.QListWidget(DataConnector)
        self.left_list.setObjectName("left_list")
        self.verticalLayout.addWidget(self.left_list)
        self.horizontalLayout_2.addLayout(self.verticalLayout)
        self.verticalLayout_2 = QtGui.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.right_label = QtGui.QLabel(DataConnector)
        self.right_label.setAlignment(QtCore.Qt.AlignCenter)
        self.right_label.setObjectName("right_label")
        self.verticalLayout_2.addWidget(self.right_label)
        self.right_combo = QtGui.QComboBox(DataConnector)
        self.right_combo.setObjectName("right_combo")
        self.verticalLayout_2.addWidget(self.right_combo)
        self.right_list = QtGui.QListWidget(DataConnector)
        self.right_list.setObjectName("right_list")
        self.verticalLayout_2.addWidget(self.right_list)
        self.horizontalLayout_2.addLayout(self.verticalLayout_2)
        self.verticalLayout_4.addLayout(self.horizontalLayout_2)
        self.horizontalLayout_5 = QtGui.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                       QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_5.addItem(spacerItem)
        self.glue_button = QtGui.QPushButton(DataConnector)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred,
                                       QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.glue_button.sizePolicy().hasHeightForWidth())
        self.glue_button.setSizePolicy(sizePolicy)
        self.glue_button.setObjectName("glue_button")
        self.horizontalLayout_5.addWidget(self.glue_button)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_5.addItem(spacerItem1)
        self.verticalLayout_4.addLayout(self.horizontalLayout_5)
        self.horizontalLayout_6.addLayout(self.verticalLayout_4)
        self.verticalLayout_5 = QtGui.QVBoxLayout()
        self.verticalLayout_5.setObjectName("verticalLayout_5")
        self.verticalLayout_3 = QtGui.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.link_label = QtGui.QLabel(DataConnector)
        self.link_label.setAlignment(QtCore.Qt.AlignCenter)
        self.link_label.setObjectName("link_label")
        self.verticalLayout_3.addWidget(self.link_label)
        self.link_list = QtGui.QListWidget(DataConnector)
        self.link_list.setObjectName("link_list")
        self.verticalLayout_3.addWidget(self.link_list)
        self.verticalLayout_5.addLayout(self.verticalLayout_3)
        self.horizontalLayout_3 = QtGui.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem2)
        self.un_glue_button = QtGui.QPushButton(DataConnector)
        self.un_glue_button.setObjectName("un_glue_button")
        self.horizontalLayout_3.addWidget(self.un_glue_button)
        self.verticalLayout_5.addLayout(self.horizontalLayout_3)
        self.horizontalLayout_6.addLayout(self.verticalLayout_5)
        self.verticalLayout_6.addLayout(self.horizontalLayout_6)
        self.horizontalLayout_4 = QtGui.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                                        QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_4.addItem(spacerItem3)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.ok = QtGui.QPushButton(DataConnector)
        self.ok.setObjectName("ok")
        self.horizontalLayout.addWidget(self.ok)
        self.cancel = QtGui.QPushButton(DataConnector)
        self.cancel.setObjectName("cancel")
        self.horizontalLayout.addWidget(self.cancel)
        self.horizontalLayout_4.addLayout(self.horizontalLayout)
        self.verticalLayout_6.addLayout(self.horizontalLayout_4)
        self.verticalLayout_7.addLayout(self.verticalLayout_6)

        self.retranslateUi(DataConnector)
        QtCore.QMetaObject.connectSlotsByName(DataConnector)