Пример #1
0
    def setupUi(self, SettingsDisplayWidget):
        SettingsDisplayWidget.setObjectName("SettingsDisplayWidget")
        SettingsDisplayWidget.resize(276, 241)
        self.verticalLayout = QtWidgets.QVBoxLayout(SettingsDisplayWidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.tableView = ElementTableView(SettingsDisplayWidget)
        self.tableView.setObjectName("tableView")
        self.tableView.horizontalHeader().setStretchLastSection(False)
        self.verticalLayout.addWidget(self.tableView)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.button_add_current = QtWidgets.QPushButton(SettingsDisplayWidget)
        self.button_add_current.setObjectName("button_add_current")
        self.horizontalLayout.addWidget(self.button_add_current)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.button_add_item = QtWidgets.QPushButton(SettingsDisplayWidget)
        self.button_add_item.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/add_icon"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.button_add_item.setIcon(icon)
        self.button_add_item.setObjectName("button_add_item")
        self.horizontalLayout.addWidget(self.button_add_item)
        self.button_del_item = QtWidgets.QPushButton(SettingsDisplayWidget)
        self.button_del_item.setEnabled(False)
        self.button_del_item.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/remove_icon"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.button_del_item.setIcon(icon1)
        self.button_del_item.setObjectName("button_del_item")
        self.horizontalLayout.addWidget(self.button_del_item)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(SettingsDisplayWidget)
        QtCore.QMetaObject.connectSlotsByName(SettingsDisplayWidget)
class Ui_TableDisplayWidgetAddDel(object):
    def setupUi(self, TableDisplayWidgetAddDel):
        TableDisplayWidgetAddDel.setObjectName("TableDisplayWidgetAddDel")
        TableDisplayWidgetAddDel.resize(251, 167)
        TableDisplayWidgetAddDel.setContextMenuPolicy(
            QtCore.Qt.CustomContextMenu)
        self.horizontalLayout = QtWidgets.QHBoxLayout(TableDisplayWidgetAddDel)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.dataView = ElementTableView(TableDisplayWidgetAddDel)
        self.dataView.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.dataView.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.dataView.setObjectName("dataView")
        self.dataView.horizontalHeader().setStretchLastSection(True)
        self.dataView.verticalHeader().setVisible(False)
        self.horizontalLayout.addWidget(self.dataView)
        self.buttonLayout = QtWidgets.QVBoxLayout()
        self.buttonLayout.setObjectName("buttonLayout")
        self.add_button = QtWidgets.QPushButton(TableDisplayWidgetAddDel)
        self.add_button.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/add_icon"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        self.add_button.setIcon(icon)
        self.add_button.setObjectName("add_button")
        self.buttonLayout.addWidget(self.add_button)
        self.delete_button = QtWidgets.QPushButton(TableDisplayWidgetAddDel)
        self.delete_button.setEnabled(False)
        self.delete_button.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/remove_icon"), QtGui.QIcon.Normal,
                        QtGui.QIcon.Off)
        self.delete_button.setIcon(icon1)
        self.delete_button.setObjectName("delete_button")
        self.buttonLayout.addWidget(self.delete_button)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.buttonLayout.addItem(spacerItem)
        self.horizontalLayout.addLayout(self.buttonLayout)

        self.retranslateUi(TableDisplayWidgetAddDel)
        self.add_button.clicked.connect(TableDisplayWidgetAddDel.add_item)
        self.dataView.doubleClicked['QModelIndex'].connect(
            TableDisplayWidgetAddDel.edit_item)
        self.dataView.customContextMenuRequested['QPoint'].connect(
            TableDisplayWidgetAddDel.showContextMenu)
        self.delete_button.clicked.connect(
            TableDisplayWidgetAddDel.delete_item)
        QtCore.QMetaObject.connectSlotsByName(TableDisplayWidgetAddDel)

    def retranslateUi(self, TableDisplayWidgetAddDel):
        _translate = QtCore.QCoreApplication.translate
        TableDisplayWidgetAddDel.setWindowTitle(
            _translate("TableDisplayWidgetAddDel", "Form"))
Пример #3
0
    def setupUi(self, DatabaseSearchWidget):
        DatabaseSearchWidget.setObjectName("DatabaseSearchWidget")
        DatabaseSearchWidget.resize(393, 374)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(DatabaseSearchWidget)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.groupBox_search = QtWidgets.QGroupBox(DatabaseSearchWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox_search.sizePolicy().hasHeightForWidth())
        self.groupBox_search.setSizePolicy(sizePolicy)
        self.groupBox_search.setObjectName("groupBox_search")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox_search)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.combo_search_options = QtWidgets.QComboBox(self.groupBox_search)
        self.combo_search_options.setObjectName("combo_search_options")
        self.horizontalLayout.addWidget(self.combo_search_options)
        self.lineEdit_search_input = QtWidgets.QLineEdit(self.groupBox_search)
        self.lineEdit_search_input.setObjectName("lineEdit_search_input")
        self.horizontalLayout.addWidget(self.lineEdit_search_input)
        self.pushButton_search = QtWidgets.QPushButton(self.groupBox_search)
        self.pushButton_search.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/search_icon"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        self.pushButton_search.setIcon(icon)
        self.pushButton_search.setObjectName("pushButton_search")
        self.horizontalLayout.addWidget(self.pushButton_search)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.dataView_search_results = ElementTableView(self.groupBox_search)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.dataView_search_results.sizePolicy().hasHeightForWidth())
        self.dataView_search_results.setSizePolicy(sizePolicy)
        self.dataView_search_results.setObjectName("dataView_search_results")
        self.dataView_search_results.verticalHeader().setVisible(False)
        self.verticalLayout.addWidget(self.dataView_search_results)
        self.verticalLayout_2.addWidget(self.groupBox_search)

        self.retranslateUi(DatabaseSearchWidget)
        QtCore.QMetaObject.connectSlotsByName(DatabaseSearchWidget)
    def setupUi(self, StoichiometryDisplayWidget):
        StoichiometryDisplayWidget.setObjectName("StoichiometryDisplayWidget")
        StoichiometryDisplayWidget.resize(306, 240)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(
            StoichiometryDisplayWidget)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout()
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.dataView = ElementTableView(StoichiometryDisplayWidget)
        sizePolicy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.MinimumExpanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.dataView.sizePolicy().hasHeightForWidth())
        self.dataView.setSizePolicy(sizePolicy)
        self.dataView.setEditTriggers(
            QtWidgets.QAbstractItemView.DoubleClicked
            | QtWidgets.QAbstractItemView.SelectedClicked)
        self.dataView.setSortingEnabled(True)
        self.dataView.setObjectName("dataView")
        self.dataView.horizontalHeader().setStretchLastSection(True)
        self.dataView.verticalHeader().setVisible(False)
        self.verticalLayout_4.addWidget(self.dataView)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.statusDescriptionLabel = QtWidgets.QLabel(
            StoichiometryDisplayWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.statusDescriptionLabel.sizePolicy().hasHeightForWidth())
        self.statusDescriptionLabel.setSizePolicy(sizePolicy)
        self.statusDescriptionLabel.setMinimumSize(QtCore.QSize(0, 20))
        self.statusDescriptionLabel.setObjectName("statusDescriptionLabel")
        self.horizontalLayout.addWidget(self.statusDescriptionLabel)
        self.verticalLayout_4.addLayout(self.horizontalLayout)
        self.horizontalLayout_2.addLayout(self.verticalLayout_4)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.add_button = QtWidgets.QPushButton(StoichiometryDisplayWidget)
        self.add_button.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/add_icon"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        self.add_button.setIcon(icon)
        self.add_button.setObjectName("add_button")
        self.verticalLayout.addWidget(self.add_button)
        self.delete_button = QtWidgets.QPushButton(StoichiometryDisplayWidget)
        self.delete_button.setEnabled(False)
        self.delete_button.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/remove_icon"), QtGui.QIcon.Normal,
                        QtGui.QIcon.Off)
        self.delete_button.setIcon(icon1)
        self.delete_button.setObjectName("delete_button")
        self.verticalLayout.addWidget(self.delete_button)
        spacerItem1 = QtWidgets.QSpacerItem(20, 40,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem1)
        self.statusLabel = QtWidgets.QLabel(StoichiometryDisplayWidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.statusLabel.sizePolicy().hasHeightForWidth())
        self.statusLabel.setSizePolicy(sizePolicy)
        self.statusLabel.setMinimumSize(QtCore.QSize(28, 20))
        self.statusLabel.setMaximumSize(QtCore.QSize(28, 20))
        self.statusLabel.setStyleSheet("padding: 1 5 1 5;")
        self.statusLabel.setText("")
        self.statusLabel.setPixmap(QtGui.QPixmap(":/status_unknown"))
        self.statusLabel.setScaledContents(True)
        self.statusLabel.setAlignment(QtCore.Qt.AlignCenter)
        self.statusLabel.setObjectName("statusLabel")
        self.verticalLayout.addWidget(self.statusLabel)
        self.horizontalLayout_2.addLayout(self.verticalLayout)

        self.retranslateUi(StoichiometryDisplayWidget)
        self.add_button.clicked.connect(StoichiometryDisplayWidget.add_item)
        self.delete_button.clicked.connect(
            StoichiometryDisplayWidget.delete_item)
        QtCore.QMetaObject.connectSlotsByName(StoichiometryDisplayWidget)
Пример #5
0
    def setupUi(self, EditModelDialog):
        EditModelDialog.setObjectName("EditModelDialog")
        EditModelDialog.resize(359, 314)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(EditModelDialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.label_id = QtWidgets.QLabel(EditModelDialog)
        self.label_id.setObjectName("label_id")
        self.gridLayout.addWidget(self.label_id, 0, 0, 1, 1)
        self.input_id = QtWidgets.QLineEdit(EditModelDialog)
        self.input_id.setObjectName("input_id")
        self.gridLayout.addWidget(self.input_id, 0, 1, 1, 1)
        self.label_name = QtWidgets.QLabel(EditModelDialog)
        self.label_name.setObjectName("label_name")
        self.gridLayout.addWidget(self.label_name, 1, 0, 1, 1)
        self.input_name = QtWidgets.QLineEdit(EditModelDialog)
        self.input_name.setObjectName("input_name")
        self.gridLayout.addWidget(self.input_name, 1, 1, 1, 1)
        self.verticalLayout_2.addLayout(self.gridLayout)
        self.compartmentLabel = QtWidgets.QLabel(EditModelDialog)
        self.compartmentLabel.setObjectName("compartmentLabel")
        self.verticalLayout_2.addWidget(self.compartmentLabel)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.compartmentTableView = ElementTableView(EditModelDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.compartmentTableView.sizePolicy().hasHeightForWidth())
        self.compartmentTableView.setSizePolicy(sizePolicy)
        self.compartmentTableView.setEditTriggers(
            QtWidgets.QAbstractItemView.DoubleClicked)
        self.compartmentTableView.setObjectName("compartmentTableView")
        self.compartmentTableView.horizontalHeader().setStretchLastSection(
            True)
        self.compartmentTableView.verticalHeader().setVisible(False)
        self.horizontalLayout.addWidget(self.compartmentTableView)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.button_add_compartment = QtWidgets.QPushButton(EditModelDialog)
        self.button_add_compartment.setObjectName("button_add_compartment")
        self.verticalLayout.addWidget(self.button_add_compartment)
        self.button_del_compartment = QtWidgets.QPushButton(EditModelDialog)
        self.button_del_compartment.setObjectName("button_del_compartment")
        self.verticalLayout.addWidget(self.button_del_compartment)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.horizontalLayout.addLayout(self.verticalLayout)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.buttonBox = QtWidgets.QDialogButtonBox(EditModelDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                          | QtWidgets.QDialogButtonBox.Save)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout_2.addWidget(self.buttonBox)

        self.retranslateUi(EditModelDialog)
        self.buttonBox.accepted.connect(EditModelDialog.accept)
        self.buttonBox.rejected.connect(EditModelDialog.reject)
        EditModelDialog.accepted.connect(EditModelDialog.save_changes)
        QtCore.QMetaObject.connectSlotsByName(EditModelDialog)
    def setupUi(self, DatabaseSelectionDialog):
        DatabaseSelectionDialog.setObjectName("DatabaseSelectionDialog")
        DatabaseSelectionDialog.resize(890, 569)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(DatabaseSelectionDialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.groupBox = QtWidgets.QGroupBox(DatabaseSelectionDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.comboBox = QtWidgets.QComboBox(self.groupBox)
        self.comboBox.setObjectName("comboBox")
        self.horizontalLayout.addWidget(self.comboBox)
        self.lineEdit = QtWidgets.QLineEdit(self.groupBox)
        self.lineEdit.setObjectName("lineEdit")
        self.horizontalLayout.addWidget(self.lineEdit)
        self.pushButton = QtWidgets.QPushButton(self.groupBox)
        self.pushButton.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/search_icon"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        self.pushButton.setIcon(icon)
        self.pushButton.setObjectName("pushButton")
        self.horizontalLayout.addWidget(self.pushButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.dataView = ElementTableView(self.groupBox)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.dataView.sizePolicy().hasHeightForWidth())
        self.dataView.setSizePolicy(sizePolicy)
        self.dataView.setObjectName("dataView")
        self.dataView.verticalHeader().setVisible(False)
        self.verticalLayout.addWidget(self.dataView)
        self.horizontalLayout_2.addWidget(self.groupBox)
        self.groupBox_2 = QtWidgets.QGroupBox(DatabaseSelectionDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.groupBox_2.sizePolicy().hasHeightForWidth())
        self.groupBox_2.setSizePolicy(sizePolicy)
        self.groupBox_2.setObjectName("groupBox_2")
        self.formLayout = QtWidgets.QFormLayout(self.groupBox_2)
        self.formLayout.setContentsMargins(-1, 6, -1, -1)
        self.formLayout.setHorizontalSpacing(6)
        self.formLayout.setObjectName("formLayout")
        self.label = QtWidgets.QLabel(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        self.label.setObjectName("label")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                  self.label)
        self.label_name = QtWidgets.QLabel(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_name.sizePolicy().hasHeightForWidth())
        self.label_name.setSizePolicy(sizePolicy)
        self.label_name.setText("")
        self.label_name.setWordWrap(False)
        self.label_name.setObjectName("label_name")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                  self.label_name)
        self.label_4 = QtWidgets.QLabel(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_4.sizePolicy().hasHeightForWidth())
        self.label_4.setSizePolicy(sizePolicy)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                  self.label_4)
        self.label_2 = QtWidgets.QLabel(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_2.sizePolicy().hasHeightForWidth())
        self.label_2.setSizePolicy(sizePolicy)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole,
                                  self.label_2)
        self.label_charge = QtWidgets.QLabel(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_charge.sizePolicy().hasHeightForWidth())
        self.label_charge.setSizePolicy(sizePolicy)
        self.label_charge.setText("")
        self.label_charge.setObjectName("label_charge")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole,
                                  self.label_charge)
        self.label_formula = QtWidgets.QLabel(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_formula.sizePolicy().hasHeightForWidth())
        self.label_formula.setSizePolicy(sizePolicy)
        self.label_formula.setText("")
        self.label_formula.setObjectName("label_formula")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                  self.label_formula)
        self.list_synonyms = QtWidgets.QListWidget(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.list_synonyms.sizePolicy().hasHeightForWidth())
        self.list_synonyms.setSizePolicy(sizePolicy)
        self.list_synonyms.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.list_synonyms.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.list_synonyms.setSelectionMode(
            QtWidgets.QAbstractItemView.NoSelection)
        self.list_synonyms.setLayoutMode(QtWidgets.QListView.SinglePass)
        self.list_synonyms.setObjectName("list_synonyms")
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.FieldRole,
                                  self.list_synonyms)
        self.label_3 = QtWidgets.QLabel(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_3.sizePolicy().hasHeightForWidth())
        self.label_3.setSizePolicy(sizePolicy)
        self.label_3.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft
                                  | QtCore.Qt.AlignTop)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole,
                                  self.label_3)
        self.label_5 = QtWidgets.QLabel(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_5.sizePolicy().hasHeightForWidth())
        self.label_5.setSizePolicy(sizePolicy)
        self.label_5.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft
                                  | QtCore.Qt.AlignTop)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.LabelRole,
                                  self.label_5)
        self.tableWidget = QtWidgets.QTableWidget(self.groupBox_2)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.tableWidget.sizePolicy().hasHeightForWidth())
        self.tableWidget.setSizePolicy(sizePolicy)
        self.tableWidget.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.tableWidget.setWordWrap(False)
        self.tableWidget.setObjectName("tableWidget")
        self.tableWidget.setColumnCount(0)
        self.tableWidget.setRowCount(0)
        self.tableWidget.horizontalHeader().setStretchLastSection(True)
        self.tableWidget.verticalHeader().setVisible(False)
        self.tableWidget.verticalHeader().setHighlightSections(False)
        self.formLayout.setWidget(10, QtWidgets.QFormLayout.FieldRole,
                                  self.tableWidget)
        self.horizontalLayout_2.addWidget(self.groupBox_2)
        self.verticalLayout_2.addLayout(self.horizontalLayout_2)
        self.buttonBox = QtWidgets.QDialogButtonBox(DatabaseSelectionDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                          | QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout_2.addWidget(self.buttonBox)

        self.retranslateUi(DatabaseSelectionDialog)
        self.buttonBox.accepted.connect(DatabaseSelectionDialog.accept)
        self.buttonBox.rejected.connect(DatabaseSelectionDialog.reject)
        self.comboBox.currentIndexChanged['int'].connect(
            DatabaseSelectionDialog.update_query)
        self.pushButton.clicked.connect(DatabaseSelectionDialog.update_query)
        QtCore.QMetaObject.connectSlotsByName(DatabaseSelectionDialog)
Пример #7
0
    def setupUi(self, ReferenceEditDialog):
        ReferenceEditDialog.setObjectName("ReferenceEditDialog")
        ReferenceEditDialog.resize(291, 320)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(ReferenceEditDialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.label_authors = QtWidgets.QLabel(ReferenceEditDialog)
        self.label_authors.setAlignment(QtCore.Qt.AlignLeading
                                        | QtCore.Qt.AlignLeft
                                        | QtCore.Qt.AlignTop)
        self.label_authors.setObjectName("label_authors")
        self.gridLayout.addWidget(self.label_authors, 0, 0, 1, 1)
        self.authorTableView = ElementTableView(ReferenceEditDialog)
        self.authorTableView.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.authorTableView.setObjectName("authorTableView")
        self.authorTableView.horizontalHeader().setStretchLastSection(True)
        self.authorTableView.verticalHeader().setVisible(False)
        self.gridLayout.addWidget(self.authorTableView, 0, 1, 1, 1)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.addAuthorButton = QtWidgets.QPushButton(ReferenceEditDialog)
        self.addAuthorButton.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/add_icon"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        self.addAuthorButton.setIcon(icon)
        self.addAuthorButton.setObjectName("addAuthorButton")
        self.verticalLayout.addWidget(self.addAuthorButton)
        self.removeAuthorButton = QtWidgets.QPushButton(ReferenceEditDialog)
        self.removeAuthorButton.setText("")
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/remove_icon"), QtGui.QIcon.Normal,
                        QtGui.QIcon.Off)
        self.removeAuthorButton.setIcon(icon1)
        self.removeAuthorButton.setObjectName("removeAuthorButton")
        self.verticalLayout.addWidget(self.removeAuthorButton)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.gridLayout.addLayout(self.verticalLayout, 0, 2, 1, 1)
        self.label_title = QtWidgets.QLabel(ReferenceEditDialog)
        self.label_title.setObjectName("label_title")
        self.gridLayout.addWidget(self.label_title, 1, 0, 1, 1)
        self.titleInput = QtWidgets.QLineEdit(ReferenceEditDialog)
        self.titleInput.setObjectName("titleInput")
        self.gridLayout.addWidget(self.titleInput, 1, 1, 1, 2)
        self.label_year = QtWidgets.QLabel(ReferenceEditDialog)
        self.label_year.setObjectName("label_year")
        self.gridLayout.addWidget(self.label_year, 2, 0, 1, 1)
        self.yearInput = QtWidgets.QLineEdit(ReferenceEditDialog)
        self.yearInput.setObjectName("yearInput")
        self.gridLayout.addWidget(self.yearInput, 2, 1, 1, 2)
        self.label_journal = QtWidgets.QLabel(ReferenceEditDialog)
        self.label_journal.setObjectName("label_journal")
        self.gridLayout.addWidget(self.label_journal, 3, 0, 1, 1)
        self.journalInput = QtWidgets.QLineEdit(ReferenceEditDialog)
        self.journalInput.setObjectName("journalInput")
        self.gridLayout.addWidget(self.journalInput, 3, 1, 1, 2)
        self.label_pmid = QtWidgets.QLabel(ReferenceEditDialog)
        self.label_pmid.setObjectName("label_pmid")
        self.gridLayout.addWidget(self.label_pmid, 4, 0, 1, 1)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.pmidInput = QtWidgets.QLineEdit(ReferenceEditDialog)
        self.pmidInput.setObjectName("pmidInput")
        self.horizontalLayout.addWidget(self.pmidInput)
        self.searchPubmedButton = QtWidgets.QPushButton(ReferenceEditDialog)
        self.searchPubmedButton.setText("")
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/search_icon"), QtGui.QIcon.Normal,
                        QtGui.QIcon.Off)
        self.searchPubmedButton.setIcon(icon2)
        self.searchPubmedButton.setObjectName("searchPubmedButton")
        self.horizontalLayout.addWidget(self.searchPubmedButton)
        self.gridLayout.addLayout(self.horizontalLayout, 4, 1, 1, 2)
        self.label_pmc = QtWidgets.QLabel(ReferenceEditDialog)
        self.label_pmc.setObjectName("label_pmc")
        self.gridLayout.addWidget(self.label_pmc, 5, 0, 1, 1)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.pmcInput = QtWidgets.QLineEdit(ReferenceEditDialog)
        self.pmcInput.setObjectName("pmcInput")
        self.horizontalLayout_2.addWidget(self.pmcInput)
        self.searchPMCButton = QtWidgets.QPushButton(ReferenceEditDialog)
        self.searchPMCButton.setText("")
        self.searchPMCButton.setIcon(icon2)
        self.searchPMCButton.setObjectName("searchPMCButton")
        self.horizontalLayout_2.addWidget(self.searchPMCButton)
        self.gridLayout.addLayout(self.horizontalLayout_2, 5, 1, 1, 2)
        self.label_doi = QtWidgets.QLabel(ReferenceEditDialog)
        self.label_doi.setObjectName("label_doi")
        self.gridLayout.addWidget(self.label_doi, 6, 0, 1, 1)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.doiInput = QtWidgets.QLineEdit(ReferenceEditDialog)
        self.doiInput.setObjectName("doiInput")
        self.horizontalLayout_3.addWidget(self.doiInput)
        self.searchDOIButton = QtWidgets.QPushButton(ReferenceEditDialog)
        self.searchDOIButton.setText("")
        self.searchDOIButton.setIcon(icon2)
        self.searchDOIButton.setObjectName("searchDOIButton")
        self.horizontalLayout_3.addWidget(self.searchDOIButton)
        self.gridLayout.addLayout(self.horizontalLayout_3, 6, 1, 1, 2)
        self.label_link = QtWidgets.QLabel(ReferenceEditDialog)
        self.label_link.setObjectName("label_link")
        self.gridLayout.addWidget(self.label_link, 7, 0, 1, 1)
        self.linkInput = QtWidgets.QLineEdit(ReferenceEditDialog)
        self.linkInput.setObjectName("linkInput")
        self.gridLayout.addWidget(self.linkInput, 7, 1, 1, 2)
        self.verticalLayout_2.addLayout(self.gridLayout)
        self.buttonBox = QtWidgets.QDialogButtonBox(ReferenceEditDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel
                                          | QtWidgets.QDialogButtonBox.Save)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout_2.addWidget(self.buttonBox)

        self.retranslateUi(ReferenceEditDialog)
        self.buttonBox.accepted.connect(ReferenceEditDialog.accept)
        self.buttonBox.rejected.connect(ReferenceEditDialog.reject)
        self.titleInput.textEdited['QString'].connect(
            ReferenceEditDialog.activateButton)
        self.yearInput.textEdited['QString'].connect(
            ReferenceEditDialog.activateButton)
        self.journalInput.textEdited['QString'].connect(
            ReferenceEditDialog.activateButton)
        self.pmidInput.textEdited['QString'].connect(
            ReferenceEditDialog.activateButton)
        self.pmcInput.textEdited['QString'].connect(
            ReferenceEditDialog.activateButton)
        self.doiInput.textEdited['QString'].connect(
            ReferenceEditDialog.activateButton)
        self.linkInput.textEdited['QString'].connect(
            ReferenceEditDialog.activateButton)
        self.addAuthorButton.clicked.connect(ReferenceEditDialog.addAuthor)
        self.removeAuthorButton.clicked.connect(
            ReferenceEditDialog.deleteAuthor)
        self.searchPubmedButton.clicked.connect(
            ReferenceEditDialog.getPmidInfo)
        self.searchPMCButton.clicked.connect(ReferenceEditDialog.checkPMC)
        self.pmidInput.textEdited['QString'].connect(
            ReferenceEditDialog.checkPMID)
        self.pmcInput.textEdited['QString'].connect(
            ReferenceEditDialog.checkPMC)
        ReferenceEditDialog.accepted.connect(ReferenceEditDialog.save_state)
        self.searchPMCButton.clicked.connect(ReferenceEditDialog.getPmcInfo)
        self.searchDOIButton.clicked.connect(ReferenceEditDialog.getDOIInfo)
        ReferenceEditDialog.finished['int'].connect(
            ReferenceEditDialog.save_dialog_geometry)
        QtCore.QMetaObject.connectSlotsByName(ReferenceEditDialog)
        ReferenceEditDialog.setTabOrder(self.authorTableView, self.yearInput)
        ReferenceEditDialog.setTabOrder(self.yearInput, self.journalInput)
        ReferenceEditDialog.setTabOrder(self.journalInput, self.pmidInput)
        ReferenceEditDialog.setTabOrder(self.pmidInput,
                                        self.searchPubmedButton)
        ReferenceEditDialog.setTabOrder(self.searchPubmedButton, self.pmcInput)
        ReferenceEditDialog.setTabOrder(self.pmcInput, self.searchPMCButton)
        ReferenceEditDialog.setTabOrder(self.searchPMCButton, self.doiInput)
        ReferenceEditDialog.setTabOrder(self.doiInput, self.linkInput)
        ReferenceEditDialog.setTabOrder(self.linkInput, self.addAuthorButton)
        ReferenceEditDialog.setTabOrder(self.addAuthorButton,
                                        self.removeAuthorButton)