Python PyQt5.QtWidgets.QSpacerItem() Examples

The following are 30 code examples of PyQt5.QtWidgets.QSpacerItem(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module PyQt5.QtWidgets , or try the search function .
Example #1
Source File: addition.py    From MusicBox with MIT License 7 votes vote down vote up
def __init__(self, parent=None):
        super(SearchLineEdit, self).__init__()
        self.setObjectName("SearchLine")
        self.parent = parent
        self.setMinimumSize(218, 20)
        with open('QSS/searchLine.qss', 'r') as f:
            self.setStyleSheet(f.read())

        self.button = QPushButton(self)
        self.button.setMaximumSize(13, 13)
        self.button.setCursor(QCursor(Qt.PointingHandCursor))

        self.setTextMargins(3, 0, 19, 0)

        self.spaceItem = QSpacerItem(150, 10, QSizePolicy.Expanding)

        self.mainLayout = QHBoxLayout()
        self.mainLayout.addSpacerItem(self.spaceItem)
        # self.mainLayout.addStretch(1)
        self.mainLayout.addWidget(self.button)
        self.mainLayout.addSpacing(10)
        self.mainLayout.setContentsMargins(0, 0, 0, 0)
        self.setLayout(self.mainLayout) 
Example #2
Source File: collectionEditor.py    From openMotor with GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, parent, buttons=False):
        super(CollectionEditor, self).__init__(QWidget(parent))

        self.preferences = None

        self.propertyEditors = {}
        self.setLayout(QVBoxLayout())
        self.layout().setSpacing(0)

        self.form = QFormLayout()
        self.layout().addLayout(self.form)

        self.stats = QVBoxLayout()
        self.layout().addLayout(self.stats)


        self.verticalSpacer = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Expanding)
        self.layout().addItem(self.verticalSpacer)

        self.buttons = buttons
        if self.buttons:
            self.addButtons() 
Example #3
Source File: dialogpaste.py    From liquid-swap with GNU General Public License v3.0 6 votes vote down vote up
def setupUi(self, PasteDialog):
        PasteDialog.setObjectName("PasteDialog")
        PasteDialog.resize(400, 300)
        self.gridLayout = QtWidgets.QGridLayout(PasteDialog)
        self.gridLayout.setObjectName("gridLayout")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.textBrowser = QtWidgets.QTextBrowser(PasteDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.textBrowser.sizePolicy().hasHeightForWidth())
        self.textBrowser.setSizePolicy(sizePolicy)
        self.textBrowser.setAcceptRichText(False)
        self.textBrowser.setTextInteractionFlags(QtCore.Qt.LinksAccessibleByKeyboard|QtCore.Qt.LinksAccessibleByMouse|QtCore.Qt.TextBrowserInteraction|QtCore.Qt.TextEditable|QtCore.Qt.TextEditorInteraction|QtCore.Qt.TextSelectableByKeyboard|QtCore.Qt.TextSelectableByMouse)
        self.textBrowser.setOpenLinks(False)
        self.textBrowser.setObjectName("textBrowser")
        self.verticalLayout.addWidget(self.textBrowser)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.buttonImport = QtWidgets.QPushButton(PasteDialog)
        self.buttonImport.setObjectName("buttonImport")
        self.horizontalLayout.addWidget(self.buttonImport)
        self.buttonCancel = QtWidgets.QPushButton(PasteDialog)
        self.buttonCancel.setObjectName("buttonCancel")
        self.horizontalLayout.addWidget(self.buttonCancel)
        self.buttonOk = QtWidgets.QPushButton(PasteDialog)
        self.buttonOk.setObjectName("buttonOk")
        self.horizontalLayout.addWidget(self.buttonOk)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.gridLayout.addLayout(self.verticalLayout, 0, 0, 1, 1)

        self.retranslateUi(PasteDialog)
        QtCore.QMetaObject.connectSlotsByName(PasteDialog) 
Example #4
Source File: combo_listwidget.py    From PyQt with GNU General Public License v3.0 6 votes vote down vote up
def initUi(self):
        self.horizontalLayout = QHBoxLayout(self)
        self.file_btn = QPushButton(QIcon(":/newPrefix/file.png"), self.text, self)
        sizePolicy = QSizePolicy(QSizePolicy.Minimum, QSizePolicy.Preferred)
        self.file_btn.setSizePolicy(sizePolicy)
        qss = '''QPushButton 
{
    background-color: transparent;
    border: none;
}

QPushButton:hover {
    background:transparent;
    }'''
        self.file_btn.setStyleSheet(qss)
        self.bt_close = QToolButton(self)
        self.bt_close.setIcon(QIcon(":/newPrefix/if_Delete_1493279.png"))
        self.bt_close.setAutoRaise(True)
        self.bt_close.setToolTip("Delete")
        self.bt_close.clicked.connect(lambda: self.itemOpSignal.emit(self.listwidgetItem))

        self.horizontalLayout.addWidget(self.bt_close)
        self.horizontalLayout.addWidget(self.file_btn)
        spacerItem = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem) 
Example #5
Source File: welcome.py    From dzetsaka with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, DockWidget):
        DockWidget.setObjectName("DockWidget")
        DockWidget.resize(513, 387)
        self.dockWidgetContents = QtWidgets.QWidget()
        self.dockWidgetContents.setEnabled(True)
        self.dockWidgetContents.setObjectName("dockWidgetContents")
        self.gridLayout = QtWidgets.QGridLayout(self.dockWidgetContents)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtWidgets.QLabel(self.dockWidgetContents)
        sizePolicy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.Preferred,
            QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label.sizePolicy().hasHeightForWidth())
        self.label.setSizePolicy(sizePolicy)
        self.label.setAcceptDrops(True)
        self.label.setAutoFillBackground(False)
        self.label.setText("")
        self.label.setPixmap(
            QtGui.QPixmap(":/plugins/dzetsaka/img/parcguyane.jpg"))
        self.label.setScaledContents(False)
        self.label.setAlignment(QtCore.Qt.AlignHCenter | QtCore.Qt.AlignTop)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(
            478, 10, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
        self.gridLayout.addItem(spacerItem, 1, 0, 1, 1)
        self.label_2 = QtWidgets.QLabel(self.dockWidgetContents)
        self.label_2.setAutoFillBackground(True)
        self.label_2.setWordWrap(True)
        self.label_2.setOpenExternalLinks(True)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
        DockWidget.setWidget(self.dockWidgetContents)

        self.retranslateUi(DockWidget)
        QtCore.QMetaObject.connectSlotsByName(DockWidget) 
Example #6
Source File: UITranslator.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def qui(self, ui_list_string, parentObject_string='', opt=''):
        # pre-defined user short name syntax
        type_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit',
            'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem', 
        }
        # get ui_list, creation or existing ui object
        ui_list = [x.strip() for x in ui_list_string.split('|')]
        for i in range(len(ui_list)):
            if ui_list[i] in self.uiList:
                # - exisiting object
                ui_list[i] = self.uiList[ui_list[i]]
            else:
                # - string creation: 
                # get part info
                partInfo = ui_list[i].split(';',1)
                uiName = partInfo[0].split('@')[0]
                uiType = uiName.rsplit('_',1)[-1]
                if uiType in type_dict:
                    uiType = type_dict[uiType]
                # set quickUI string format
                ui_list[i] = partInfo[0]+';'+uiType
                if len(partInfo)==1:
                    # give empty button and label a place holder name
                    if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'):
                        ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName 
                elif len(partInfo)==2:
                    ui_list[i]=ui_list[i]+";"+partInfo[1]
        # get parentObject or exisiting object
        parentObject = parentObject_string
        if parentObject in self.uiList:
            parentObject = self.uiList[parentObject]
        # process quickUI
        self.quickUI(ui_list, parentObject, opt) 
Example #7
Source File: ui_about.py    From multibootusb with GNU General Public License v2.0 5 votes vote down vote up
def setupUi(self, About):
        About.setObjectName("About")
        About.resize(498, 369)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(About.sizePolicy().hasHeightForWidth())
        About.setSizePolicy(sizePolicy)
        self.verticalLayout = QtWidgets.QVBoxLayout(About)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout_11 = QtWidgets.QGridLayout()
        self.gridLayout_11.setObjectName("gridLayout_11")
        self.label_6 = QtWidgets.QLabel(About)
        self.label_6.setObjectName("label_6")
        self.gridLayout_11.addWidget(self.label_6, 1, 1, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem, 1, 2, 1, 1)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem1, 1, 0, 1, 1)
        spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        self.gridLayout_11.addItem(spacerItem2, 0, 1, 1, 1)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_11.addItem(spacerItem3, 2, 1, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout_11)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem4)
        self.button_close = QtWidgets.QPushButton(About)
        self.button_close.setObjectName("button_close")
        self.horizontalLayout.addWidget(self.button_close)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(About)
        QtCore.QMetaObject.connectSlotsByName(About) 
Example #8
Source File: gui.py    From code-jam-5 with MIT License 5 votes vote down vote up
def setup_ui(self):
        spacer = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding,
                                       QtWidgets.QSizePolicy.MinimumExpanding)
        self.setLayout(self.main_layout)

        self.fps_layout.addWidget(self.fps_label)
        self.fps_layout.addSpacerItem(spacer)
        self.fps_spin.setRange(1, 60)
        self.fps_spin.setAccelerated(True)
        self.fps_layout.addWidget(self.fps_spin)
        self.main_layout.addLayout(self.fps_layout)

        self.step_layout.addWidget(self.step_label)
        self.step_combo.addItems(("1", "3", "6", "12", "24"))
        self.step_layout.addSpacerItem(spacer)
        self.step_layout.addWidget(self.step_combo)
        self.main_layout.addLayout(self.step_layout)

        self.color_map_layout.addWidget(self.color_map)
        self.color_map_layout.addWidget(self.color_map_label, alignment=QtCore.Qt.AlignRight)

        self.main_layout.addLayout(self.color_map_layout)
        self.main_layout.addSpacerItem(spacer)
        self.main_layout.addWidget(self.save_button, alignment=QtCore.Qt.AlignCenter)
        self.main_layout.addWidget(self.license_button, alignment=QtCore.Qt.AlignCenter)

        self.setWindowFlag(QtCore.Qt.WindowContextHelpButtonHint, False)
        self.color_map.pressed.connect(self.color_map_chooser)
        self.save_button.pressed.connect(self.save_settings)
        self.license_button.pressed.connect(self.show_license)

        self.retranslate_ui()
        self.grab_settings()
        self.show() 
Example #9
Source File: ui_messagetype_options.py    From urh with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, DialogMessageType):
        DialogMessageType.setObjectName("DialogMessageType")
        DialogMessageType.resize(471, 359)
        self.gridLayout = QtWidgets.QGridLayout(DialogMessageType)
        self.gridLayout.setObjectName("gridLayout")
        self.cbRulesetMode = QtWidgets.QComboBox(DialogMessageType)
        self.cbRulesetMode.setObjectName("cbRulesetMode")
        self.cbRulesetMode.addItem("")
        self.cbRulesetMode.addItem("")
        self.cbRulesetMode.addItem("")
        self.gridLayout.addWidget(self.cbRulesetMode, 1, 0, 1, 2)
        self.tblViewRuleset = QtWidgets.QTableView(DialogMessageType)
        self.tblViewRuleset.setShowGrid(False)
        self.tblViewRuleset.setObjectName("tblViewRuleset")
        self.gridLayout.addWidget(self.tblViewRuleset, 2, 0, 3, 2)
        self.btnRemoveRule = QtWidgets.QToolButton(DialogMessageType)
        icon = QtGui.QIcon.fromTheme("list-remove")
        self.btnRemoveRule.setIcon(icon)
        self.btnRemoveRule.setObjectName("btnRemoveRule")
        self.gridLayout.addWidget(self.btnRemoveRule, 3, 2, 1, 1)
        self.rbAssignManually = QtWidgets.QRadioButton(DialogMessageType)
        self.rbAssignManually.setObjectName("rbAssignManually")
        self.gridLayout.addWidget(self.rbAssignManually, 0, 0, 1, 1)
        self.rbAssignAutomatically = QtWidgets.QRadioButton(DialogMessageType)
        self.rbAssignAutomatically.setObjectName("rbAssignAutomatically")
        self.gridLayout.addWidget(self.rbAssignAutomatically, 0, 1, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(20, 145, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 4, 2, 1, 1)
        self.btnAddRule = QtWidgets.QToolButton(DialogMessageType)
        icon = QtGui.QIcon.fromTheme("list-add")
        self.btnAddRule.setIcon(icon)
        self.btnAddRule.setObjectName("btnAddRule")
        self.gridLayout.addWidget(self.btnAddRule, 2, 2, 1, 1)
        self.buttonBox = QtWidgets.QDialogButtonBox(DialogMessageType)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2)

        self.retranslateUi(DialogMessageType) 
Example #10
Source File: Ui_SPreview.py    From pyleecan with Apache License 2.0 5 votes vote down vote up
def setupUi(self, SPreview):
        SPreview.setObjectName("SPreview")
        SPreview.resize(532, 450)
        SPreview.setMinimumSize(QtCore.QSize(0, 0))
        self.verticalLayout = QtWidgets.QVBoxLayout(SPreview)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.w_plot = MPLCanvas2(SPreview)
        sizePolicy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred
        )
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.w_plot.sizePolicy().hasHeightForWidth())
        self.w_plot.setSizePolicy(sizePolicy)
        self.w_plot.setMinimumSize(QtCore.QSize(300, 300))
        self.w_plot.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.w_plot.setObjectName("w_plot")
        self.horizontalLayout_2.addWidget(self.w_plot)
        self.tab_machine = WMachineTable(SPreview)
        self.tab_machine.setObjectName("tab_machine")
        self.horizontalLayout_2.addWidget(self.tab_machine)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(
            40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum
        )
        self.horizontalLayout.addItem(spacerItem)
        self.b_previous = QtWidgets.QPushButton(SPreview)
        self.b_previous.setObjectName("b_previous")
        self.horizontalLayout.addWidget(self.b_previous)
        self.b_next = QtWidgets.QPushButton(SPreview)
        self.b_next.setObjectName("b_next")
        self.horizontalLayout.addWidget(self.b_next)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.retranslateUi(SPreview)
        QtCore.QMetaObject.connectSlotsByName(SPreview) 
Example #11
Source File: addmem.py    From IDAngr with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def setupUi(self, IDAngrAddMem):
        IDAngrAddMem.setObjectName("IDAngrAddMem")
        IDAngrAddMem.resize(440, 251)
        self.gridLayout_2 = QtWidgets.QGridLayout(IDAngrAddMem)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.gridLayout = QtWidgets.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtWidgets.QLabel(IDAngrAddMem)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
        self.addrTextEdit = QtWidgets.QLineEdit(IDAngrAddMem)
        self.addrTextEdit.setObjectName("addrTextEdit")
        self.gridLayout.addWidget(self.addrTextEdit, 1, 0, 1, 1)
        self.label_2 = QtWidgets.QLabel(IDAngrAddMem)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
        self.lenTextEdit = QtWidgets.QLineEdit(IDAngrAddMem)
        self.lenTextEdit.setObjectName("lenTextEdit")
        self.gridLayout.addWidget(self.lenTextEdit, 3, 0, 1, 1)
        self.gridLayout_2.addLayout(self.gridLayout, 0, 0, 1, 1)
        spacerItem = QtWidgets.QSpacerItem(20, 79, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.gridLayout_2.addItem(spacerItem, 1, 0, 1, 1)
        self.buttonBox = QtWidgets.QDialogButtonBox(IDAngrAddMem)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout_2.addWidget(self.buttonBox, 2, 0, 1, 1)

        self.retranslateUi(IDAngrAddMem)
        self.buttonBox.accepted.connect(IDAngrAddMem.accept)
        self.buttonBox.rejected.connect(IDAngrAddMem.reject)
        QtCore.QMetaObject.connectSlotsByName(IDAngrAddMem) 
Example #12
Source File: dialogs.py    From pandasgui with MIT License 5 votes vote down vote up
def __init__(self, df, column):
        super().__init__()

        self.layout = QtWidgets.QVBoxLayout()
        self.setLayout(self.layout)
        self.df = df
        from pandasgui import show
        self.column_name = column
        self.names = QtWidgets.QLineEdit()
        self.names.textChanged.connect(self.makePicker)

        self.picker = Picker(['col1', 'col2', 'col3'], df[column].astype(str).unique())

        # Add button
        btnFinish = QtWidgets.QPushButton("Finish")
        btnFinish.clicked.connect(self.finish)
        btnReset = QtWidgets.QPushButton("Reset")
        btnReset.clicked.connect(self.finish)
        buttonLayout = QtWidgets.QHBoxLayout()
        spacer = QtWidgets.QSpacerItem(0, 0, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        buttonLayout.addSpacerItem(spacer)
        buttonLayout.addWidget(btnReset)
        buttonLayout.addWidget(btnFinish)

        # Add all to layout
        self.layout.addLayout(buttonLayout)
        self.layout.addWidget(self.names)
        self.layout.addWidget(self.picker)
        self.show() 
Example #13
Source File: profiles.py    From qomui with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, profileEdit):
        profileEdit.setObjectName("profileEdit")
        profileEdit.resize(439, 500)
        self.verticalLayout = QtWidgets.QVBoxLayout(profileEdit)
        self.verticalLayout.setObjectName("verticalLayout")
        self.profileLine = QtWidgets.QLineEdit(profileEdit)
        self.profileLine.setObjectName("profileLine")
        self.verticalLayout.addWidget(self.profileLine)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.chooseProtocolBox = QtWidgets.QComboBox(profileEdit)
        self.chooseProtocolBox.setObjectName("chooseProtocolBox")
        self.horizontalLayout_2.addWidget(self.chooseProtocolBox)
        self.modeBox = QtWidgets.QComboBox(profileEdit)
        self.modeBox.setObjectName("modeBox")
        self.horizontalLayout_2.addWidget(self.modeBox)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.choiceTable = QtWidgets.QTableWidget(profileEdit)
        self.choiceTable.setObjectName("choiceTable")
        self.choiceTable.setShowGrid(False)
        self.choiceTable.horizontalHeader().hide()
        self.choiceTable.verticalHeader().hide()
        self.verticalLayout.addWidget(self.choiceTable)
        self.filterLine = QtWidgets.QLineEdit(profileEdit)
        self.verticalLayout.addWidget(self.filterLine)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(595, 17, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.buttonBox = QtWidgets.QDialogButtonBox(profileEdit)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.horizontalLayout.addWidget(self.buttonBox)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.retranslateUi(profileEdit)
        QtCore.QMetaObject.connectSlotsByName(profileEdit)

        self.choiceTable.itemChanged.connect(self.itemChanged)
        self.buttonBox.accepted.connect(self.confirm)
        self.buttonBox.rejected.connect(self.cancel) 
Example #14
Source File: framerate_viewer.py    From stytra with GNU General Public License v3.0 5 votes vote down vote up
def add_framerate(self, framerate_acc):
        lbl_name = QLabel(framerate_acc.name)
        fr_disp = FramerateWidget(framerate_acc)
        if len(self.fr_widgets) > 0:
            self.layout().addItem(QSpacerItem(40, 10))
        self.layout().addWidget(lbl_name)
        self.fr_widgets.append(fr_disp)
        self.layout().addWidget(fr_disp) 
Example #15
Source File: UI_mixer.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, equipment=None, entradas=1, parent=None):
        """
        equipment: Initial equipment instance to model
        entradas: Stream Input number to equipment
        """
        super().__init__(Mixer, salida=False, parent=parent)

        # Input tab
        for i in range(entradas):
            entrada = UI_corriente.Ui_corriente()
            entrada.Changed.connect(partial(self.cambiarEntrada, i))
            self.Entrada.addTab(entrada, str(i+1))

        # Calculate tab
        lyt_Calc = QtWidgets.QGridLayout(self.tabCalculo)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Output Pressure Method")), 1, 1)
        self.criterio = QtWidgets.QComboBox()
        for txt in self.Equipment.TEXT_METODO:
            self.criterio.addItem(txt)
        self.criterio.currentIndexChanged.connect(self.criterio_Changed)
        lyt_Calc.addWidget(self.criterio, 1, 2)

        lyt_Calc.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed),
            2, 1, 1, 3)
        lyt_Calc.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Output Pressure")), 3, 1)
        self.Pout = Entrada_con_unidades(Pressure)
        self.Pout.valueChanged.connect(partial(self.changeParams, "Pout"))
        lyt_Calc.addWidget(self.Pout, 3, 2)
        lyt_Calc.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 4, 1, 1, 3)

        self.criterio_Changed(0)

        if equipment:
            self.setEquipment(equipment)
        else:
            self.Equipment = Mixer(entradas=entradas) 
Example #16
Source File: Ui_untitled.py    From PhyloSuite with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(363, 193)
        self.widget = QtWidgets.QWidget(Form)
        self.widget.setGeometry(QtCore.QRect(40, 90, 71, 24))
        self.widget.setObjectName("widget")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setSpacing(0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.toolButton = QtWidgets.QToolButton(self.widget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.toolButton.sizePolicy().hasHeightForWidth())
        self.toolButton.setSizePolicy(sizePolicy)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/picture/resourses/1485528481_arrow-down-01.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButton.setIcon(icon)
        self.toolButton.setObjectName("toolButton")
        self.horizontalLayout.addWidget(self.toolButton)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form) 
Example #17
Source File: Ui_popUp.py    From PhyloSuite with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, pop):
        pop.setObjectName("pop")
        pop.resize(442, 379)
        self.gridLayout = QtWidgets.QGridLayout(pop)
        self.gridLayout.setObjectName("gridLayout")
        self.textEdit = QtWidgets.QTextEdit(pop)
        self.textEdit.setObjectName("textEdit")
        self.gridLayout.addWidget(self.textEdit, 1, 0, 1, 2)
        self.pushButton = QtWidgets.QPushButton(pop)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/picture/resourses/btn_ok.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton.setIcon(icon)
        self.pushButton.setObjectName("pushButton")
        self.gridLayout.addWidget(self.pushButton, 2, 0, 1, 1)
        self.pushButton_2 = QtWidgets.QPushButton(pop)
        icon1 = QtGui.QIcon()
        icon1.addPixmap(QtGui.QPixmap(":/picture/resourses/if_Delete_1493279.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton_2.setIcon(icon1)
        self.pushButton_2.setObjectName("pushButton_2")
        self.gridLayout.addWidget(self.pushButton_2, 2, 1, 1, 1)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.label = QtWidgets.QLabel(pop)
        self.label.setObjectName("label")
        self.horizontalLayout_2.addWidget(self.label)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.toolButton = QtWidgets.QToolButton(pop)
        icon2 = QtGui.QIcon()
        icon2.addPixmap(QtGui.QPixmap(":/picture/resourses/interface-controls-text-wrap-512.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.toolButton.setIcon(icon2)
        self.toolButton.setCheckable(True)
        self.toolButton.setObjectName("toolButton")
        self.horizontalLayout_2.addWidget(self.toolButton)
        self.gridLayout.addLayout(self.horizontalLayout_2, 0, 0, 1, 2)

        self.retranslateUi(pop)
        QtCore.QMetaObject.connectSlotsByName(pop) 
Example #18
Source File: UI_reactor.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(widgetReacciones, self).__init__(parent)
        self.indices, self.nombres, M=getComponents()
        gridLayout = QtWidgets.QGridLayout(self)

        self.TablaReacciones=Tabla(5, horizontalHeader=[QtWidgets.QApplication.translate("pychemqt", "Reaction"), "ΔHr, %s" %unidades.MolarEnthalpy(None).text(), QtWidgets.QApplication.translate("pychemqt", "Type"), QtWidgets.QApplication.translate("pychemqt", "Phase"), QtWidgets.QApplication.translate("pychemqt", "Description")], dinamica=False, verticalHeader=True, orientacion=QtCore.Qt.AlignLeft)
        self.TablaReacciones.setMinimumWidth(500)
        self.TablaReacciones.setSelectionBehavior(QtWidgets.QAbstractItemView.SelectRows)
        self.TablaReacciones.setSelectionMode(QtWidgets.QAbstractItemView.SingleSelection)
        self.TablaReacciones.horizontalHeader().setStretchLastSection(True)
        self.TablaReacciones.setEditTriggers(QtWidgets.QAbstractItemView.NoEditTriggers)
        self.TablaReacciones.itemSelectionChanged.connect(self.actualizarBotones)
        gridLayout.addWidget(self.TablaReacciones,1,1,6,4)

        self.botonAbrir=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/fileOpen.png")), QtWidgets.QApplication.translate("pychemqt", "Open"))
        self.botonAbrir.clicked.connect(self.botonAbrirClicked)
        gridLayout.addWidget(self.botonAbrir,1,5)
        self.botonGuardar=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/fileSave.png")), QtWidgets.QApplication.translate("pychemqt", "Save"))
        self.botonGuardar.clicked.connect(self.botonGuardarClicked)
        self.botonGuardar.setSizePolicy(QtWidgets.QSizePolicy.Fixed,QtWidgets.QSizePolicy.Fixed)
        self.botonGuardar.setEnabled(False)
        gridLayout.addWidget(self.botonGuardar,2,5)

        self.botonNew=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/fileNew.png")), QtWidgets.QApplication.translate("pychemqt", "New"))
        self.botonNew.clicked.connect(self.botonNewClicked)
        gridLayout.addWidget(self.botonNew,3,5)
        self.botonEdit=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/editor.png")), QtWidgets.QApplication.translate("pychemqt", "Edit"))
        self.botonEdit.setEnabled(False)
        self.botonEdit.setCheckable(True)
        self.botonEdit.clicked.connect(self.botonEditClicked)
        gridLayout.addWidget(self.botonEdit,4,5)
        self.botonDelete=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/editDelete.png")), QtWidgets.QApplication.translate("pychemqt", "Delete"))
        self.botonDelete.setEnabled(False)
        self.botonDelete.clicked.connect(self.botonDeleteClicked)
        gridLayout.addWidget(self.botonDelete,5,5)
        self.botonClear=QtWidgets.QPushButton(QtGui.QIcon(QtGui.QPixmap(os.environ["pychemqt"]+"/images/button/clear.png")), QtWidgets.QApplication.translate("pychemqt", "Clear"))
        self.botonClear.clicked.connect(self.botonClearClicked)
        gridLayout.addWidget(self.botonClear,6,5)
        gridLayout.addItem(QtWidgets.QSpacerItem(10,10,QtWidgets.QSizePolicy.Expanding,QtWidgets.QSizePolicy.Expanding),10,1) 
Example #19
Source File: prefMoody.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, config=None, parent=None):
        super(Widget, self).__init__(parent)
        layout = QtWidgets.QGridLayout(self)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Method:")), 1, 1)
        self.metodos = QtWidgets.QComboBox()
        for f in f_list:
            line = f.__doc__.split("\n")[0]
            year = line.split(" ")[-1]
            name = line.split(" ")[-3]
            doc = name + " " + year
            self.metodos.addItem(doc)
        layout.addWidget(self.metodos, 1, 2)
        self.fanning = QtWidgets.QCheckBox(QtWidgets.QApplication.translate(
            "pychemqt", "Calculate fanning friction factor"))
        layout.addWidget(self.fanning, 2, 1, 1, 2)

        layout.addWidget(QtWidgets.QLabel("ε/d:"), 3, 1)
        self.ed = QtWidgets.QLineEdit()
        layout.addWidget(self.ed, 3, 2)
        self.lineconfig = LineConfig(
            "line", QtWidgets.QApplication.translate(
                "pychemqt", "Relative roughtness style line"))
        layout.addWidget(self.lineconfig, 4, 1, 1, 2)
        self.cruxconfig = LineConfig(
            "crux", QtWidgets.QApplication.translate(
                "pychemqt", "Crux style line"))
        layout.addWidget(self.cruxconfig, 5, 1, 1, 2)

        layout.addItem(QtWidgets.QSpacerItem(
            10, 0, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 10, 1, 1, 3)

        if config and config.has_section("Moody"):
            self.metodos.setCurrentIndex(config.getint("Moody", 'method'))
            self.fanning.setChecked(config.getboolean("Moody", 'fanning'))
            self.ed.setText(config.get("Moody", "ed"))
            self.lineconfig.setConfig(config, "Moody")
            self.cruxconfig.setConfig(config, "Moody") 
Example #20
Source File: widgets.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, color="#ffffff", alpha=255, isAlpha=False, parent=None):
        super(ColorSelector, self).__init__(parent)

        lyt = QtWidgets.QHBoxLayout(self)
        lyt.setContentsMargins(0, 0, 0, 0)
        lyt.setSpacing(0)

        self.RGB = QtWidgets.QLineEdit()
        self.RGB.editingFinished.connect(self.rgbChanged)
        self.RGB.setFixedSize(80, 24)
        lyt.addWidget(self.RGB)
        self.button = QtWidgets.QToolButton()
        self.button.setFixedSize(24, 24)
        self.button.clicked.connect(self.ColorButtonClicked)
        lyt.addWidget(self.button)
        lyt.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Fixed))

        if isAlpha:
            self.isAlpha = QtGui.QColor.HexArgb
        else:
            self.isAlpha = QtGui.QColor.HexRgb

        r = int(color[1:3], 16)
        g = int(color[3:5], 16)
        b = int(color[5:7], 16)
        color = QtGui.QColor(r, g, b, alpha)
        self.setColor(color) 
Example #21
Source File: playlist_ui.py    From superboucle with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(320, 333)
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.playlistList = QtWidgets.QListWidget(Dialog)
        self.playlistList.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.playlistList.setSizeIncrement(QtCore.QSize(100, 100))
        self.playlistList.setMovement(QtWidgets.QListView.Static)
        self.playlistList.setResizeMode(QtWidgets.QListView.Adjust)
        self.playlistList.setObjectName("playlistList")
        self.horizontalLayout.addWidget(self.playlistList)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.loadSongBtn = QtWidgets.QPushButton(Dialog)
        self.loadSongBtn.setObjectName("loadSongBtn")
        self.verticalLayout_3.addWidget(self.loadSongBtn)
        self.addSongsBtn = QtWidgets.QPushButton(Dialog)
        self.addSongsBtn.setObjectName("addSongsBtn")
        self.verticalLayout_3.addWidget(self.addSongsBtn)
        self.removeSongBtn = QtWidgets.QPushButton(Dialog)
        self.removeSongBtn.setObjectName("removeSongBtn")
        self.verticalLayout_3.addWidget(self.removeSongBtn)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.loadPlaylistBtn = QtWidgets.QPushButton(Dialog)
        self.loadPlaylistBtn.setObjectName("loadPlaylistBtn")
        self.verticalLayout_3.addWidget(self.loadPlaylistBtn)
        self.savePlaylistBtn = QtWidgets.QPushButton(Dialog)
        self.savePlaylistBtn.setObjectName("savePlaylistBtn")
        self.verticalLayout_3.addWidget(self.savePlaylistBtn)
        self.horizontalLayout.addLayout(self.verticalLayout_3)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #22
Source File: prefElemental.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, config=None, parent=None):
        super(Widget, self).__init__(parent)
        layout = QtWidgets.QGridLayout(self)

        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Color by element:")),
            1, 1)
        colorby = ["Element", "serie", "group_element", "period", "block", "phase",
                   "lattice_type", "space_group", "density_Solid",
                   "density_Liq", "density_Gas", "date", "atomic_mass",
                   "atomic_volume", "atomic_radius", "covalent_radius",
                   "vanderWaals_radius", "electronegativity",
                   "electron_affinity", "first_ionization", "Tf", "Tb",
                   "Heat_f", "Heat_b", "Cp", "k", "T_debye"]
        self.ElementalColorby = QtWidgets.QComboBox()
        for c in colorby:
            self.ElementalColorby.addItem(c)
        layout.addWidget(self.ElementalColorby, 1, 2)
        layout.addWidget(QtWidgets.QLabel(
            QtWidgets.QApplication.translate("pychemqt", "Color definition")),
            2, 1)
        self.ElementalDefinition = QtWidgets.QSpinBox()
        self.ElementalDefinition.setMaximumWidth(50)
        self.ElementalDefinition.setMinimum(5)
        layout.addWidget(self.ElementalDefinition, 2, 2)
        self.ElementalLog = QtWidgets.QCheckBox(
            QtWidgets.QApplication.translate("pychemqt", "Logarithmic scale"))
        layout.addWidget(self.ElementalLog, 3, 1, 1, 2)
        layout.addItem(QtWidgets.QSpacerItem(
            0, 0, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 4, 3)

        if config.has_section("Applications"):
            self.ElementalColorby.setCurrentText(
                config.get("Applications", 'elementalColorby'))
            self.ElementalDefinition.setValue(
                config.getint("Applications", 'elementalDefinition'))
            self.ElementalLog.setChecked(
                config.getboolean("Applications", 'elementalLog')) 
Example #23
Source File: port_manager_ui.py    From superboucle with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(320, 295)
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.portList = QtWidgets.QListWidget(Dialog)
        self.portList.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.portList.setSizeIncrement(QtCore.QSize(100, 100))
        self.portList.setMovement(QtWidgets.QListView.Static)
        self.portList.setResizeMode(QtWidgets.QListView.Adjust)
        self.portList.setObjectName("portList")
        self.horizontalLayout.addWidget(self.portList)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.addPortBtn = QtWidgets.QPushButton(Dialog)
        self.addPortBtn.setObjectName("addPortBtn")
        self.verticalLayout_3.addWidget(self.addPortBtn)
        self.removePortBtn = QtWidgets.QPushButton(Dialog)
        self.removePortBtn.setObjectName("removePortBtn")
        self.verticalLayout_3.addWidget(self.removePortBtn)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.loadPortlistBtn = QtWidgets.QPushButton(Dialog)
        self.loadPortlistBtn.setObjectName("loadPortlistBtn")
        self.verticalLayout_3.addWidget(self.loadPortlistBtn)
        self.savePortlistBtn = QtWidgets.QPushButton(Dialog)
        self.savePortlistBtn.setObjectName("savePortlistBtn")
        self.verticalLayout_3.addWidget(self.savePortlistBtn)
        self.horizontalLayout.addLayout(self.verticalLayout_3)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)
        self.autoconnectCBox = QtWidgets.QCheckBox(Dialog)
        self.autoconnectCBox.setObjectName("autoconnectCBox")
        self.gridLayout.addWidget(self.autoconnectCBox, 1, 0, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #24
Source File: scene_manager_ui.py    From superboucle with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(320, 333)
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.scenelistList = QtWidgets.QListWidget(Dialog)
        self.scenelistList.setMaximumSize(QtCore.QSize(16777215, 16777215))
        self.scenelistList.setSizeIncrement(QtCore.QSize(100, 100))
        self.scenelistList.setMovement(QtWidgets.QListView.Static)
        self.scenelistList.setResizeMode(QtWidgets.QListView.Adjust)
        self.scenelistList.setObjectName("scenelistList")
        self.horizontalLayout.addWidget(self.scenelistList)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout()
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.loadScenesBtn = QtWidgets.QPushButton(Dialog)
        self.loadScenesBtn.setObjectName("loadScenesBtn")
        self.verticalLayout_3.addWidget(self.loadScenesBtn)
        self.addScenesBtn = QtWidgets.QPushButton(Dialog)
        self.addScenesBtn.setObjectName("addScenesBtn")
        self.verticalLayout_3.addWidget(self.addScenesBtn)
        self.removeScenesBtn = QtWidgets.QPushButton(Dialog)
        self.removeScenesBtn.setObjectName("removeScenesBtn")
        self.verticalLayout_3.addWidget(self.removeScenesBtn)
        self.preview = QtWidgets.QGridLayout()
        self.preview.setSpacing(2)
        self.preview.setObjectName("preview")
        self.verticalLayout_3.addLayout(self.preview)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.setInitialSceneBtn = QtWidgets.QPushButton(Dialog)
        self.setInitialSceneBtn.setObjectName("setInitialSceneBtn")
        self.verticalLayout_3.addWidget(self.setInitialSceneBtn)
        self.horizontalLayout.addLayout(self.verticalLayout_3)
        self.gridLayout.addLayout(self.horizontalLayout, 0, 0, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #25
Source File: device_manager_ui.py    From superboucle with GNU General Public License v3.0 5 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(320, 229)
        self.gridLayout = QtWidgets.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.list = QtWidgets.QListWidget(Dialog)
        self.list.setObjectName("list")
        self.gridLayout.addWidget(self.list, 0, 0, 1, 1)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.editButton = QtWidgets.QPushButton(Dialog)
        self.editButton.setObjectName("editButton")
        self.verticalLayout.addWidget(self.editButton)
        self.deleteButton = QtWidgets.QPushButton(Dialog)
        self.deleteButton.setObjectName("deleteButton")
        self.verticalLayout.addWidget(self.deleteButton)
        spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.importButton = QtWidgets.QPushButton(Dialog)
        self.importButton.setObjectName("importButton")
        self.verticalLayout.addWidget(self.importButton)
        self.exportButton = QtWidgets.QPushButton(Dialog)
        self.exportButton.setObjectName("exportButton")
        self.verticalLayout.addWidget(self.exportButton)
        self.gridLayout.addLayout(self.verticalLayout, 0, 1, 1, 1)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example #26
Source File: universal_tool_template_v8.1.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def qui(self, ui_list_string, parentObject_string='', opt=''):
        # pre-defined user short name syntax
        type_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txtEdit': 'LNTextEdit', 'txt': 'QTextEdit',
            'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem', 
        }
        # get ui_list, creation or existing ui object
        ui_list = [x.strip() for x in ui_list_string.split('|')]
        for i in range(len(ui_list)):
            if ui_list[i] in self.uiList:
                # - exisiting object
                ui_list[i] = self.uiList[ui_list[i]]
            else:
                # - string creation: 
                # get part info
                partInfo = ui_list[i].split(';',1)
                uiName = partInfo[0].split('@')[0]
                uiType = uiName.rsplit('_',1)[-1]
                if uiType in type_dict:
                    uiType = type_dict[uiType]
                # set quickUI string format
                ui_list[i] = partInfo[0]+';'+uiType
                if len(partInfo)==1:
                    # give empty button and label a place holder name
                    if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'):
                        ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName 
                elif len(partInfo)==2:
                    ui_list[i]=ui_list[i]+";"+partInfo[1]
        # get parentObject or exisiting object
        parentObject = parentObject_string
        if parentObject in self.uiList:
            parentObject = self.uiList[parentObject]
        # process quickUI
        self.quickUI(ui_list, parentObject, opt) 
Example #27
Source File: costIndex.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, equipment, parent=None):
        """constructor
        equipment: equipment class where the widget have to be put, define
        indiceCostos as a index in costIndex"""
        super(CostData, self).__init__(parent)
        self.indice = equipment.indiceCostos
        factor = equipment.kwargs["f_install"]
        gridLayout = QtWidgets.QGridLayout(self)
        gridLayout.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 1, 0, 1, 7)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Instalation factor:")), 2, 0, 1, 1)
        self.factorInstalacion = Entrada_con_unidades(
            float, spinbox=True, decimales=1, step=0.1, width=50, value=factor)
        self.factorInstalacion.valueChanged.connect(partial(
            self.valueChanged.emit, "f_install"))
        gridLayout.addWidget(self.factorInstalacion, 2, 1, 1, 1)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Base index:")), 2, 4, 1, 1)
        self.indiceBase = Entrada_con_unidades(
            float, readOnly=True, value=indiceBase[self.indice], decimales=1)
        gridLayout.addWidget(self.indiceBase, 2, 5, 1, 1)
        gridLayout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Current index:")), 3, 4, 1, 1)
        self.indiceActual = Entrada_con_unidades(
            float, readOnly=True, colorReadOnly="white",
            value=indiceActual[self.indice], decimales=1)
        gridLayout.addWidget(self.indiceActual, 3, 5, 1, 1)
        self.costIndex = QtWidgets.QToolButton()
        self.costIndex.setFixedSize(QtCore.QSize(24, 24))
        self.costIndex.clicked.connect(self.on_costIndex_clicked)
        self.costIndex.setText("...")
        self.costIndex.setVisible(False)
        gridLayout.addWidget(self.costIndex, 3, 5, 1, 1)
        gridLayout.addItem(QtWidgets.QSpacerItem(
            20, 20, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Expanding), 4, 0, 1, 7) 
Example #28
Source File: heatTransfer.py    From pychemqt with GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(Chart, self).__init__(parent)
        self.setWindowTitle(self.title)
        layout = QtWidgets.QGridLayout(self)
        layout.addWidget(QtWidgets.QLabel(QtWidgets.QApplication.translate(
            "pychemqt", "Flow Arrangement")), 1, 1)
        self.flow = QtWidgets.QComboBox()
        for text, flow in self.flujo:
            self.flow.addItem(text)
        self.flow.currentIndexChanged.connect(self.plot)
        layout.addWidget(self.flow, 1, 2)
        self.mixed = QtWidgets.QComboBox()
        for text in self.mezclado:
            self.mixed.addItem(text)
        self.mixed.currentIndexChanged.connect(self.changeMixed)
        layout.addWidget(self.mixed, 1, 3)
        layout.addItem(QtWidgets.QSpacerItem(
            10, 10, QtWidgets.QSizePolicy.Expanding,
            QtWidgets.QSizePolicy.Fixed), 1, 4)

        self.diagrama = mpl(self, width=10, height=10)
        self.image = self.diagrama.fig.figimage([[0]], 0, 0, zorder=1)
        logo = image.imread('images/pychemqt_98.png')
        self.logo = self.diagrama.fig.figimage(logo, 0, 0, zorder=1)

        self.botonGuardar = QtWidgets.QToolButton()
        icon = os.environ["pychemqt"]+"/images/button/fileSave.png"
        self.botonGuardar.setIcon(QtGui.QIcon(QtGui.QPixmap(icon)))
        self.botonGuardar.setToolTip(
            QtWidgets.QApplication.translate("pychemqt", "Save chart to file"))
        self.botonGuardar.clicked.connect(self.save)
        layout.addWidget(self.botonGuardar, 5, 1)
        layout.addWidget(self.diagrama, 2, 1, 1, 6)
        self.buttonBox = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Close)
        self.buttonBox.rejected.connect(self.reject)
        layout.addWidget(self.buttonBox, 5, 2, 1, 5)

        self.plot(0)
        self.showMaximized()
        self.refixImage() 
Example #29
Source File: universal_tool_template_0803.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def qui(self, ui_list_string, parentObject_string='', opt=''):
        # pre-defined user short name syntax
        type_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem', 
        }
        # get ui_list, creation or existing ui object
        ui_list = [x.strip() for x in ui_list_string.split('|')]
        for i in range(len(ui_list)):
            if ui_list[i] in self.uiList:
                # - exisiting object
                ui_list[i] = self.uiList[ui_list[i]]
            else:
                # - string creation: 
                # get part info
                partInfo = ui_list[i].split(';',1)
                uiName = partInfo[0].split('@')[0]
                uiType = uiName.rsplit('_',1)[-1]
                if uiType in type_dict:
                    uiType = type_dict[uiType]
                # set quickUI string format
                ui_list[i] = partInfo[0]+';'+uiType
                if len(partInfo)==1:
                    # give empty button and label a place holder name
                    if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'):
                        ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName 
                elif len(partInfo)==2:
                    ui_list[i]=ui_list[i]+";"+partInfo[1]
        # get parentObject or exisiting object
        parentObject = parentObject_string
        if parentObject in self.uiList:
            parentObject = self.uiList[parentObject]
        # process quickUI
        self.quickUI(ui_list, parentObject, opt) 
Example #30
Source File: universal_tool_template_0903.py    From universal_tool_template.py with MIT License 5 votes vote down vote up
def qui(self, ui_list_string, parentObject_string='', opt=''):
        # pre-defined user short name syntax
        type_dict = {
            'vbox': 'QVBoxLayout','hbox':'QHBoxLayout','grid':'QGridLayout', 'form':'QFormLayout',
            'split': 'QSplitter', 'grp':'QGroupBox', 'tab':'QTabWidget',
            'btn':'QPushButton', 'btnMsg':'QPushButton', 'label':'QLabel', 'input':'QLineEdit', 'check':'QCheckBox', 'choice':'QComboBox',
            'txt': 'QTextEdit',
            'list': 'QListWidget', 'tree': 'QTreeWidget', 'table': 'QTableWidget',
            'space': 'QSpacerItem', 
        }
        # get ui_list, creation or existing ui object
        ui_list = [x.strip() for x in ui_list_string.split('|')]
        for i in range(len(ui_list)):
            if ui_list[i] in self.uiList:
                # - exisiting object
                ui_list[i] = self.uiList[ui_list[i]]
            else:
                # - string creation: 
                # get part info
                partInfo = ui_list[i].split(';',1)
                uiName = partInfo[0].split('@')[0]
                uiType = uiName.rsplit('_',1)[-1]
                if uiType in type_dict:
                    uiType = type_dict[uiType]
                # set quickUI string format
                ui_list[i] = partInfo[0]+';'+uiType
                if len(partInfo)==1:
                    # give empty button and label a place holder name
                    if uiType in ('btn', 'btnMsg', 'QPushButton','label', 'QLabel'):
                        ui_list[i] = partInfo[0]+';'+uiType + ';'+uiName 
                elif len(partInfo)==2:
                    ui_list[i]=ui_list[i]+";"+partInfo[1]
        # get parentObject or exisiting object
        parentObject = parentObject_string
        if parentObject in self.uiList:
            parentObject = self.uiList[parentObject]
        # process quickUI
        self.quickUI(ui_list, parentObject, opt)