Python PySide.QtGui 模块,QSpacerItem() 实例源码

我们从Python开源项目中,提取了以下28个代码示例,用于说明如何使用PySide.QtGui.QSpacerItem()

项目:TWTools    作者:ZeX2    | 项目源码 | 文件源码
def setupUi(self):
        """Bruh"""
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setGeometry(50, 50, 600, 300)
        self.setWindowTitle("ZeZe's TWTools - Backtiming Calculator")
        self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png")))

        """Background color"""
        self.backgroundPalette = QtGui.QPalette()
        self.backgroundColor = QtGui.QColor(217, 204, 170)
        self.backgroundPalette.setColor(
            QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(self.backgroundPalette)

        """Main layout & return to main menu button"""
        self.verticalLayout = QtGui.QVBoxLayout(self)

        self.buttonLayout = QtGui.QHBoxLayout(self)
        self.verticalLayout.addLayout(self.buttonLayout)
        self.returnButton = QtGui.QPushButton("  Return to the Main Menu  ", self)
        self.returnButton.clicked.connect(self.return_function)
        self.buttonLayout.addWidget(self.returnButton)
        self.buttonSpacer = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.buttonLayout.addItem(self.buttonSpacer)
项目:pw_mGeoExporter    作者:paulwinex    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.horizontalLayout = QtGui.QHBoxLayout(Form)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.tableLayout = QtGui.QVBoxLayout()
        self.tableLayout.setObjectName("tableLayout")
        self.horizontalLayout.addLayout(self.tableLayout)
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.addAttr_btn = QtGui.QPushButton(Form)
        self.addAttr_btn.setMaximumSize(QtCore.QSize(30, 16777215))
        self.addAttr_btn.setObjectName("addAttr_btn")
        self.verticalLayout.addWidget(self.addAttr_btn)
        self.removeAttr_btn = QtGui.QPushButton(Form)
        self.removeAttr_btn.setMaximumSize(QtCore.QSize(30, 16777215))
        self.removeAttr_btn.setObjectName("removeAttr_btn")
        self.verticalLayout.addWidget(self.removeAttr_btn)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.horizontalLayout.addLayout(self.verticalLayout)
        self.horizontalLayout.setStretch(0, 1)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:TWTools    作者:ZeX2    | 项目源码 | 文件源码
def setupUi(self):
        """Bruh"""
        self.setGeometry(50, 50, 450, 250)
        self.setWindowTitle("ZeZe's TWTools - Updating Servers")
        self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png")))

        """Background color"""
        self.backgroundPalette = QtGui.QPalette()
        self.backgroundColor = QtGui.QColor(217, 204, 170)
        self.backgroundPalette.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(self.backgroundPalette)

        """Layout"""
        self.verticalLayout = QtGui.QVBoxLayout(self)

        self.text = QtGui.QLabel("Updating server list:")
        self.verticalLayout.addWidget(self.text)

        """Download bar"""
        self.progress_bar = QtGui.QProgressBar(self)
        self.progress_bar.setMinimum(0)
        self.progress_bar.setMaximum(27)
        self.progress_bar.setValue(0)
        self.progress_bar.setFormat("%v / %m")
        self.verticalLayout.addWidget(self.progress_bar)

        """Text browser for progress"""
        self.progress_text = QtGui.QTextBrowser(self)
        self.verticalLayout.addWidget(self.progress_text)

        """Button"""
        self.horizontalLayout = QtGui.QHBoxLayout(self)
        self.verticalLayout.addLayout(self.horizontalLayout)

        self.Spacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(self.Spacer)

        self.cancelButton = QtGui.QPushButton("Cancel")
        self.horizontalLayout.addWidget(self.cancelButton)
        self.cancelButton.clicked.connect(self.cancel_function)
项目:CyclopsVFX-Unity    作者:geoffroygivry    | 项目源码 | 文件源码
def setupUi(self, type_widget):
        type_widget.setObjectName("type_widget")
        type_widget.resize(248, 78)
        self.horizontalLayout_2 = QtGui.QHBoxLayout(type_widget)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.type_icon = QtGui.QLabel(type_widget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.type_icon.sizePolicy().hasHeightForWidth())
        self.type_icon.setSizePolicy(sizePolicy)
        self.type_icon.setObjectName("type_icon")
        self.horizontalLayout_2.addWidget(self.type_icon)
        spacerItem = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.line = QtGui.QFrame(type_widget)
        self.line.setFrameShape(QtGui.QFrame.VLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName("line")
        self.horizontalLayout_2.addWidget(self.line)
        spacerItem1 = QtGui.QSpacerItem(20, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.type_label = QtGui.QLabel(type_widget)
        font = QtGui.QFont()
        font.setFamily("Cantarell")
        font.setPointSize(10)
        font.setWeight(75)
        font.setBold(True)
        self.type_label.setFont(font)
        self.type_label.setObjectName("type_label")
        self.horizontalLayout_2.addWidget(self.type_label)

        self.retranslateUi(type_widget)
        QtCore.QMetaObject.connectSlotsByName(type_widget)
项目:FreeCAD-PCB    作者:marmni    | 项目源码 | 文件源码
def exportUstawienia(self):
        page = QtGui.QWizardPage()
        page.setSubTitle(u"<span style='font-weight:bold;font-size:13px;'>Settings</span>")
        #
        self.pathToFile = QtGui.QLineEdit('')
        #self.pathToFile.setReadOnly(True)
        #
        zmianaSciezki = QtGui.QPushButton('...')
        zmianaSciezki.setToolTip(u'Change path')
        QtCore.QObject.connect(zmianaSciezki, QtCore.SIGNAL("pressed ()"), self.zmianaSciezkiF)
        #
        self.addHoles = QtGui.QCheckBox(u'Add holes')
        self.addDimensions = QtGui.QCheckBox(u'Add dimensions')
        self.addAnnotations = QtGui.QCheckBox(u'Add annotations')
        self.addGluePaths = QtGui.QCheckBox(u'Export glue paths')
        #
        lay = QtGui.QGridLayout(page)
        lay.addWidget(QtGui.QLabel(u'Path: '), 0, 0, 1, 1)
        lay.addWidget(self.pathToFile, 0, 1, 1, 1)
        lay.addWidget(zmianaSciezki, 0, 2, 1, 1)
        lay.addItem(QtGui.QSpacerItem(1, 10), 1, 0, 1, 3)
        lay.addWidget(self.addHoles, 2, 0, 1, 3)
        lay.addWidget(self.addDimensions, 3, 0, 1, 3)
        lay.addWidget(self.addAnnotations, 4, 0, 1, 3)
        lay.addWidget(self.addGluePaths, 5, 0, 1, 3)
        lay.setColumnStretch(1, 6)
        return page
项目:FreeCAD-PCB    作者:marmni    | 项目源码 | 文件源码
def __init__(self, searchPhrase=None, parent=None):
        QtGui.QWidget.__init__(self, parent)
        #
        self.form = self
        self.form.setWindowIcon(QtGui.QIcon(":/data/img/downloadModel.png"))
        #
        if searchPhrase:
            self.form.setWindowTitle('Download model for {0}'.format(searchPhrase))
            url_1 = odnosnik("<a href='http://sourceforge.net/projects/eaglepcb2freecad/files/models/'>FreeCAD-PCB</a>")
            url_2 = odnosnik("<a href='http://www.tracepartsonline.net/(S(q4odzm45rnnypc4513kjgy45))/content.aspx?SKeywords={0}'>trace<b>parts</b></a>".format(searchPhrase))
            url_3 = odnosnik("<a href='http://www.3dcontentcentral.com/Search.aspx?arg={0}'>3D ContentCentral</a>".format(searchPhrase))
        else:
            self.form.setWindowTitle('Download model')
            url_1 = odnosnik("<a href='http://sourceforge.net/projects/eaglepcb2freecad/files/models/'>FreeCAD-PCB</a>")
            url_2 = odnosnik("<a href='http://www.tracepartsonline.net/(S(q4odzm45rnnypc4513kjgy45))/content.aspx'>trace<b>parts</b></a>")
            url_3 = odnosnik("<a href='http://www.3dcontentcentral.com/'>3D ContentCentral</a>")
        #
        lay = QtGui.QGridLayout(self)
        lay.addWidget(dodatkowaIkonka_lista(), 0, 0, 1, 1)
        lay.addWidget(url_1, 0, 1, 1, 1)


        lay.addWidget(dodatkowaIkonka_lista(), 1, 0, 1, 1)
        lay.addWidget(url_2, 1, 1, 1, 1)
        lay.addWidget(dodatkowaIkonka_klucz(), 1, 2, 1, 1)

        lay.addWidget(dodatkowaIkonka_lista(), 2, 0, 1, 1)
        lay.addWidget(url_3, 2, 1, 1, 1)
        lay.addWidget(dodatkowaIkonka_klucz(), 2, 2, 1, 1)

        lay.addItem(QtGui.QSpacerItem(5, 20), 3, 0, 1, 3)
        lay.addWidget(QtGui.QLabel('Printed Circuit Board supported formats: IGS, STEP'), 3, 0, 1, 3)
        lay.setColumnStretch(1, 10)
项目:smhr    作者:andycasey    | 项目源码 | 文件源码
def _add_pane_3(self):
        """
        Add pane 3, an intermediate pane while we are sampling the posterior.
        """

        self.p3 = QtGui.QWidget()
        self.layout.addWidget(self.p3)

        # Pane 3
        p3_layout = QtGui.QGridLayout()
        self.p3.setLayout(p3_layout)

        p3_layout.addItem(QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, 
            QtGui.QSizePolicy.Expanding), 0, 1, 1, 1)
        self.p3_progressbar = QtGui.QProgressBar(self)
        self.p3_progressbar.setFocusPolicy(QtCore.Qt.NoFocus)
        p3_layout.addWidget(self.p3_progressbar, 2, 1, 1, 1)

        p3_layout.addItem(QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
            QtGui.QSizePolicy.Minimum), 2, 2, 1, 1)
        p3_layout.addItem(QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
            QtGui.QSizePolicy.Minimum), 2, 0, 1, 1)
        self.p3_label = QtGui.QLabel(self)
        self.p3_label.setText("Sampling posterior")
        self.p3_label.setAlignment(QtCore.Qt.AlignCenter)
        p3_layout.addWidget(self.p3_label, 1, 1, 1, 1)
        p3_layout.addItem(QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, 
            QtGui.QSizePolicy.Expanding), 3, 1, 1, 1)


        return None
项目:MPowerTCX    作者:j33433    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(680, 403)
        self.gridLayout = QtGui.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.labelVersion = QtGui.QLabel(Dialog)
        self.labelVersion.setObjectName("labelVersion")
        self.gridLayout.addWidget(self.labelVersion, 0, 0, 1, 1)
        self.labelSupport = QtGui.QLabel(Dialog)
        self.labelSupport.setObjectName("labelSupport")
        self.gridLayout.addWidget(self.labelSupport, 1, 0, 1, 1)
        self.labelLicense = QtGui.QLabel(Dialog)
        self.labelLicense.setObjectName("labelLicense")
        self.gridLayout.addWidget(self.labelLicense, 2, 0, 1, 1)
        self.pushButton = QtGui.QPushButton(Dialog)
        self.pushButton.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/icon/mpowertcx icon flat.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton.setIcon(icon)
        self.pushButton.setIconSize(QtCore.QSize(256, 256))
        self.pushButton.setFlat(True)
        self.pushButton.setObjectName("pushButton")
        self.gridLayout.addWidget(self.pushButton, 3, 1, 1, 1)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 4, 1, 1, 1)
        self.licenseEdit = QtGui.QPlainTextEdit(Dialog)
        self.licenseEdit.setFrameShape(QtGui.QFrame.Box)
        self.licenseEdit.setReadOnly(True)
        self.licenseEdit.setObjectName("licenseEdit")
        self.gridLayout.addWidget(self.licenseEdit, 3, 0, 2, 1)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setCenterButtons(True)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:MPowerTCX    作者:j33433    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(756, 395)
        self.gridLayout = QtGui.QGridLayout(Dialog)
        self.gridLayout.setObjectName("gridLayout")
        self.labelVersion = QtGui.QLabel(Dialog)
        self.labelVersion.setObjectName("labelVersion")
        self.gridLayout.addWidget(self.labelVersion, 0, 0, 1, 1)
        self.labelSupport = QtGui.QLabel(Dialog)
        self.labelSupport.setObjectName("labelSupport")
        self.gridLayout.addWidget(self.labelSupport, 1, 0, 1, 1)
        self.labelLicense = QtGui.QLabel(Dialog)
        self.labelLicense.setObjectName("labelLicense")
        self.gridLayout.addWidget(self.labelLicense, 2, 0, 1, 1)
        self.pushButton = QtGui.QPushButton(Dialog)
        self.pushButton.setText("")
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/icon/mpowertcx icon flat.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.pushButton.setIcon(icon)
        self.pushButton.setIconSize(QtCore.QSize(256, 256))
        self.pushButton.setFlat(True)
        self.pushButton.setObjectName("pushButton")
        self.gridLayout.addWidget(self.pushButton, 3, 1, 1, 1)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.gridLayout.addItem(spacerItem, 4, 1, 1, 1)
        self.licenseEdit = QtGui.QPlainTextEdit(Dialog)
        self.licenseEdit.setFrameShape(QtGui.QFrame.NoFrame)
        self.licenseEdit.setReadOnly(True)
        self.licenseEdit.setObjectName("licenseEdit")
        self.gridLayout.addWidget(self.licenseEdit, 3, 0, 2, 1)
        self.buttonBox = QtGui.QDialogButtonBox(Dialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setCenterButtons(True)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 5, 0, 1, 2)

        self.retranslateUi(Dialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), Dialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), Dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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)
项目:freecad-nurbs    作者:microelly2    | 项目源码 | 文件源码
def setupUi(self, Zebra):
        Zebra.setObjectName(_fromUtf8("Zebra"))
        Zebra.resize(241, 302)
        self.verticalLayoutWidget = QtGui.QWidget(Zebra)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(10, 10, 221, 251))
        self.verticalLayoutWidget.setObjectName(_fromUtf8("verticalLayoutWidget"))
        self.verticalLayout = QtGui.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.label = QtGui.QLabel(self.verticalLayoutWidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.verticalLayout.addWidget(self.label, QtCore.Qt.AlignHCenter)
        self.horizontalSlider = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider.setObjectName(_fromUtf8("horizontalSlider"))
        self.verticalLayout.addWidget(self.horizontalSlider)
        self.label_2 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.verticalLayout.addWidget(self.label_2, QtCore.Qt.AlignHCenter)
        self.horizontalSlider_2 = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider_2.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_2.setObjectName(_fromUtf8("horizontalSlider_2"))
        self.verticalLayout.addWidget(self.horizontalSlider_2)
        self.label_3 = QtGui.QLabel(self.verticalLayoutWidget)
        self.label_3.setObjectName(_fromUtf8("label_3"))
        self.verticalLayout.addWidget(self.label_3, QtCore.Qt.AlignHCenter)
        self.horizontalSlider_3 = QtGui.QSlider(self.verticalLayoutWidget)
        self.horizontalSlider_3.setOrientation(QtCore.Qt.Horizontal)
        self.horizontalSlider_3.setObjectName(_fromUtf8("horizontalSlider_3"))
        self.verticalLayout.addWidget(self.horizontalSlider_3)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.pushButton = QtGui.QPushButton(self.verticalLayoutWidget)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.verticalLayout.addWidget(self.pushButton, QtCore.Qt.AlignHCenter)

        self.retranslateUi(Zebra)
#        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("released()")), Zebra.close)
#        QtCore.QMetaObject.connectSlotsByName(Zebra)
项目:TWTools    作者:ZeX2    | 项目源码 | 文件源码
def setupUi(self):
        """Bruh"""
        self.setAttribute(QtCore.Qt.WA_DeleteOnClose)
        self.setGeometry(50, 50, 850, 425)
        self.setWindowTitle("ZeZe's TWTools - Coord Extractor")
        self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png")))

        """Background color"""
        self.backgroundPalette = QtGui.QPalette()
        self.backgroundColor = QtGui.QColor(217, 204, 170)
        self.backgroundPalette.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(self.backgroundPalette)

        """Main layout & return to main menu button"""
        self.verticalLayout = QtGui.QVBoxLayout(self)

        self.buttonLayout = QtGui.QHBoxLayout(self)
        self.verticalLayout.addLayout(self.buttonLayout)
        self.returnButton = QtGui.QPushButton("  Return to the Main Menu  ", self)
        self.returnButton.clicked.connect(self.return_function)
        self.buttonLayout.addWidget(self.returnButton)
        self.buttonSpacer = QtGui.QSpacerItem(0, 0, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.buttonLayout.addItem(self.buttonSpacer)

        """Line Spacer and line"""
        self.lineSpacer = QtGui.QSpacerItem(40, 5, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.verticalLayout.addItem(self.lineSpacer)
        self.line = QtGui.QFrame(self)
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.verticalLayout.addWidget(self.line)

        """Text input label and edit"""
        self.Spacer = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(self.Spacer)
        self.inputLabel = QtGui.QLabel("Input text with coordinates here:")
        self.verticalLayout.addWidget(self.inputLabel)
        self.plainTextEdit = QtGui.QPlainTextEdit(self)
        self.verticalLayout.addWidget(self.plainTextEdit)

        """Coordinates output label and edit"""
        self.Spacer1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(self.Spacer1)
        self.outputLabel = QtGui.QLabel("Output coordinates magically appear here:")
        self.verticalLayout.addWidget(self.outputLabel)
        self.plainTextEdit_2 = QtGui.QPlainTextEdit(self)
        self.verticalLayout.addWidget(self.plainTextEdit_2)

        """Extract coordinates button"""
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.Spacer2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(self.Spacer2)
        self.extractButton = QtGui.QPushButton("  Extract Coordinates  ", self)
        self.extractButton.clicked.connect(self.extract_function)
        self.horizontalLayout.addWidget(self.extractButton)
项目:TWTools    作者:ZeX2    | 项目源码 | 文件源码
def setupUi(self):
        """Bruh"""
        self.setGeometry(50, 50, 300, 150)
        self.setWindowTitle("ZeZe's TWTools - Input Speeds")
        self.setWindowIcon(QtGui.QIcon(resource_path("images/icon.png")))

        """Background color"""
        self.backgroundPalette = QtGui.QPalette()
        self.backgroundColor = QtGui.QColor(217, 204, 170)
        self.backgroundPalette.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(self.backgroundPalette)

        """Form layout"""
        self.formLayout = QtGui.QFormLayout(self)
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)

        """World speed label & input box"""
        self.world_speedLabel = QtGui.QLabel("World Speed:", self)
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.world_speedLabel)

        self.world_speedBox = QtGui.QDoubleSpinBox(self)
        self.world_speedBox.setDecimals(1)
        self.world_speedBox.setMaximum(1000.0)
        self.world_speedBox.setSingleStep(0.5)
        self.world_speedBox.setProperty("value", 1.0)
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.world_speedBox)

        """Unit speed label & input box"""
        self.unit_speedLabel = QtGui.QLabel("Unit Speed:", self)
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.unit_speedLabel)

        self.unit_speedBox = QtGui.QDoubleSpinBox(self)
        self.unit_speedBox.setDecimals(1)
        self.unit_speedBox.setMaximum(1000.0)
        self.unit_speedBox.setSingleStep(0.5)
        self.unit_speedBox.setProperty("value", 1.0)
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.unit_speedBox)

        """Spacer"""
        self.Spacer = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.formLayout.setItem(2, QtGui.QFormLayout.FieldRole, self.Spacer)

        """Ok button"""
        self.okButton = QtGui.QPushButton("Ok", self)
        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.okButton)
        self.okButton.clicked.connect(self.get_data)
项目:LoLVRSpectate    作者:Fire-Proof    | 项目源码 | 文件源码
def setupUi(self, MainDialog):
        MainDialog.setObjectName("MainDialog")
        MainDialog.resize(242, 128)
        self.verticalLayout_2 = QtGui.QVBoxLayout(MainDialog)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtGui.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtGui.QLabel(MainDialog)
        font = QtGui.QFont()
        font.setPointSize(20)
        self.label.setFont(font)
        self.label.setAlignment(QtCore.Qt.AlignCenter)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setObjectName("formLayout")
        self.label_2 = QtGui.QLabel(MainDialog)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_2)
        self.labelLoLRunning = QtGui.QLabel(MainDialog)
        self.labelLoLRunning.setStyleSheet("color: rgb(255, 0, 0)")
        self.labelLoLRunning.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.labelLoLRunning.setObjectName("labelLoLRunning")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.labelLoLRunning)
        self.label_3 = QtGui.QLabel(MainDialog)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_3)
        self.labelVorpXRunning = QtGui.QLabel(MainDialog)
        self.labelVorpXRunning.setStyleSheet("color: rgb(255, 0, 0)")
        self.labelVorpXRunning.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.labelVorpXRunning.setObjectName("labelVorpXRunning")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.labelVorpXRunning)
        self.verticalLayout.addLayout(self.formLayout)
        self.pushButtonStart = QtGui.QPushButton(MainDialog)
        self.pushButtonStart.setObjectName("pushButtonStart")
        self.verticalLayout.addWidget(self.pushButtonStart)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.verticalLayout_2.addLayout(self.verticalLayout)

        self.retranslateUi(MainDialog)
        QtCore.QMetaObject.connectSlotsByName(MainDialog)
项目:CaptsLog    作者:jaehoonhwang    | 项目源码 | 文件源码
def setupUi(self, Form):
        """Setting up Log in UI Form
        """
        Form.setObjectName("Form")
        Form.setFixedSize(400, 300)

        self.formLayoutWidget = QtGui.QWidget(Form)
        self.formLayoutWidget.setGeometry(QtCore.QRect(70, 110, 251, 71))
        self.formLayoutWidget.setObjectName("formLayoutWidget")

        self.formLayout = QtGui.QFormLayout(self.formLayoutWidget)
        self.formLayout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
        self.formLayout.setContentsMargins(0, 0, 0, 0)
        self.formLayout.setObjectName("formLayout")

        self.Username = QtGui.QLabel(self.formLayoutWidget)
        self.Username.setObjectName("Username")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.Username)

        self.Password = QtGui.QLabel(self.formLayoutWidget)
        self.Password.setObjectName("Password")
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.Password)

        self.iUsername = QtGui.QLineEdit(self.formLayoutWidget)
        self.iUsername.setObjectName("iUsername")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.iUsername)

        self.iPassword = QtGui.QLineEdit(self.formLayoutWidget)
        self.iPassword.setObjectName("iPassword")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.iPassword)

        spacerItem = QtGui.QSpacerItem(
            20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.formLayout.setItem(1, QtGui.QFormLayout.LabelRole, spacerItem)

        self.Login = QtGui.QPushButton(Form)
        self.Login.setGeometry(QtCore.QRect(210, 220, 75, 23))
        self.Login.setObjectName("Login")

        self.Captslog = QtGui.QLabel(Form)
        self.Captslog.setGeometry(QtCore.QRect(90, 50, 221, 41))
        font = QtGui.QFont()
        font.setPointSize(30)
        font.setWeight(75)
        font.setBold(True)
        self.Captslog.setFont(font)
        self.Captslog.setObjectName("Captslog")

        self.ErrorMessage = QtGui.QLabel(Form)
        self.ErrorMessage.setGeometry(QtCore.QRect(120, 190, 151, 20))
        self.ErrorMessage.setText("")
        self.ErrorMessage.setAlignment(QtCore.Qt.AlignCenter)
        self.ErrorMessage.setObjectName("ErrorMessage")

        self.Signup = QtGui.QPushButton(Form)
        self.Signup.setGeometry(QtCore.QRect(100, 220, 75, 23))
        self.Signup.setObjectName("Signup")

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
项目:FreeCAD-PCB    作者:marmni    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        #
        self.listaBibliotek = QtGui.QComboBox()
        self.listaBibliotekInfo = QtGui.QLabel(' ')
        #
        self.positionX = QtGui.QDoubleSpinBox()
        self.positionX.setSingleStep(0.1)
        self.positionX.setRange(-1000, 1000)
        self.positionX.setSuffix(' mm')
        self.positionY = QtGui.QDoubleSpinBox()
        self.positionY.setSingleStep(0.1)
        self.positionY.setRange(-1000, 1000)
        self.positionY.setSuffix(' mm')
        self.positionZ = QtGui.QDoubleSpinBox()
        self.positionZ.setSingleStep(0.1)
        self.positionZ.setRange(-1000, 1000)
        self.positionZ.setSuffix(' mm')
        self.rotationRX = QtGui.QDoubleSpinBox()
        self.rotationRX.setSingleStep(0.1)
        self.rotationRX.setRange(-360, 360)
        self.rotationRX.setSuffix(' deg')
        self.rotationRY = QtGui.QDoubleSpinBox()
        self.rotationRY.setSingleStep(0.1)
        self.rotationRY.setRange(-360, 360)
        self.rotationRY.setSuffix(' deg')
        self.rotationRZ = QtGui.QDoubleSpinBox()
        self.rotationRZ.setSingleStep(0.1)
        self.rotationRZ.setRange(-360, 360)
        self.rotationRZ.setSuffix(' deg')
        #
        translationFrame = QtGui.QGroupBox(u'Translation:')
        translationFrameLay = QtGui.QFormLayout(translationFrame)
        translationFrameLay.addRow(QtGui.QLabel('X:'), self.positionX)
        translationFrameLay.addRow(QtGui.QLabel('Y:'), self.positionY)
        translationFrameLay.addRow(QtGui.QLabel('Z:'), self.positionZ)
        translationFrameLay.setContentsMargins(5, 5, 5, 5)
        #
        rotationFrame = QtGui.QGroupBox(u'Rotation:')
        rotationFrameLay = QtGui.QFormLayout(rotationFrame)
        rotationFrameLay.addRow(QtGui.QLabel('RX:'), self.rotationRX)
        rotationFrameLay.addRow(QtGui.QLabel('RY:'), self.rotationRY)
        rotationFrameLay.addRow(QtGui.QLabel('RZ:'), self.rotationRZ)
        rotationFrameLay.setContentsMargins(5, 5, 5, 5)
        #
        libraryFrame = QtGui.QGroupBox(u'Library:')
        libraryFrameLay = QtGui.QVBoxLayout(libraryFrame)
        libraryFrameLay.addWidget(self.listaBibliotek)
        libraryFrameLay.addWidget(self.listaBibliotekInfo)
        #
        self.resetButton = QtGui.QPushButton(u'Reset')
        self.resetButton.setMaximumWidth(60)
        #
        lay = QtGui.QGridLayout()
        lay.addWidget(libraryFrame, 0, 0, 1, 2)
        lay.addWidget(translationFrame, 1, 0, 1, 1)
        lay.addWidget(rotationFrame, 1, 1, 1, 1)
        lay.addItem(QtGui.QSpacerItem(1, 10), 2, 0, 1, 2)
        lay.addWidget(self.resetButton, 3, 1, 1, 1, QtCore.Qt.AlignRight)
        lay.setRowStretch(4, 5)
        self.setLayout(lay)
项目:smhr    作者:andycasey    | 项目源码 | 文件源码
def __init__(self, session, **kwargs):
        """
        A widget to show solve options when determining the stellar parameters.

        :param session:
            A session.
        """

        super(SolveOptionsDialog, self).__init__(**kwargs)

        self.session = session

        # Display dialog in center and set size policy.
        self.setGeometry(640, 480, 640, 480)
        self.move(QtGui.QApplication.desktop().screen().rect().center() \
            - self.rect().center())
        self.setWindowTitle("Solve options for stellar parameter determination")

        sp = QtGui.QSizePolicy(
            QtGui.QSizePolicy.MinimumExpanding, 
            QtGui.QSizePolicy.MinimumExpanding)
        sp.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sp)

        vbox = QtGui.QVBoxLayout(self)

        self.check_use_uncertainties_in_line_fits = QtGui.QCheckBox(self)
        self.check_use_uncertainties_in_line_fits.setText(
            "Use abundance uncertainties in line fits")
        vbox.addWidget(self.check_use_uncertainties_in_line_fits)

        vbox.addItem(QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, 
            QtGui.QSizePolicy.Expanding))

        hbox = QtGui.QHBoxLayout()
        self.btn_save_as_default = QtGui.QPushButton(self)
        self.btn_save_as_default.setText("Save settings as default")
        self.btn_save_as_default.clicked.connect(self.save_as_default)
        hbox.addWidget(self.btn_save_as_default)


        hbox.addItem(QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, 
            QtGui.QSizePolicy.Minimum))

        self.btn_apply = QtGui.QPushButton(self)
        self.btn_apply.setText("Apply")
        self.btn_apply.setDefault(True)
        self.btn_apply.clicked.connect(self.apply)
        hbox.addWidget(self.btn_apply)


        self.btn_cancel = QtGui.QPushButton(self)
        self.btn_cancel.setText("Cancel")
        self.btn_cancel.clicked.connect(self.close)
        hbox.addWidget(self.btn_cancel)
        vbox.addLayout(hbox)

        self.populate_widgets()

        return None
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def __init__(self, parent=None, mode=0):
        QtWidgets.QMainWindow.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = '0.1'
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'

        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.name = self.__class__.__name__
        self.location = ''
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)

        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)

        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_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',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {}
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = "0.1"
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'

        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)

        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)

        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_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',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {}
        #------------------------------
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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',
            '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)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version="0.1"
        self.help = "How to Use:\n1. Put source info in\n2. Click Process button\n3. Check result output\n4. Save memory info into a file."

        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage

        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)

        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)

        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_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', 
        }
        self.qui_user_dict = {}
        #------------------------------
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
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)
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def __init__(self, parent=None, mode=0):
        super_class.__init__(self, parent)
        #------------------------------
        # class variables
        #------------------------------
        self.version = "0.1"
        self.date = '2017.01.01'
        self.log = 'no version log in user class'
        self.help = 'no help guide in user class'

        self.uiList={} # for ui obj storage
        self.memoData = {} # key based variable data storage
        self.memoData['font_size_default'] = QtGui.QFont().pointSize()
        self.memoData['font_size'] = self.memoData['font_size_default']
        self.memoData['last_export'] = ''
        self.memoData['last_import'] = ''
        self.location = ""
        if getattr(sys, 'frozen', False):
            # frozen - cx_freeze
            self.location = sys.executable
        else:
            # unfrozen
            self.location = os.path.realpath(sys.modules[self.__class__.__module__].__file__)

        self.name = self.__class__.__name__
        self.iconPath = os.path.join(os.path.dirname(self.location),'icons',self.name+'.png')
        self.iconPix = QtGui.QPixmap(self.iconPath)
        self.icon = QtGui.QIcon(self.iconPath)
        self.fileType='.{0}_EXT'.format(self.name)

        #------------------------------
        # core function variable
        #------------------------------
        self.qui_core_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',
            'menu' : 'QMenu', 'menubar' : 'QMenuBar',
        }
        self.qui_user_dict = {}
        #------------------------------
项目:CNCGToolKit    作者:cineuse    | 项目源码 | 文件源码
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(465, 393)
        self.verticalLayout = QtGui.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(-1, 20, -1, 20)
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.icon_lb = QtGui.QLabel(Dialog)
        font = QtGui.QFont()
        font.setPointSize(20)
        self.icon_lb.setFont(font)
        self.icon_lb.setText("")
        self.icon_lb.setObjectName("icon_lb")
        self.horizontalLayout.addWidget(self.icon_lb)
        self.title_lb = QtGui.QLabel(Dialog)
        font = QtGui.QFont()
        font.setPointSize(20)
        self.title_lb.setFont(font)
        self.title_lb.setObjectName("title_lb")
        self.horizontalLayout.addWidget(self.title_lb)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.text_link_lb = QtGui.QLabel(Dialog)
        self.text_link_lb.setObjectName("text_link_lb")
        self.verticalLayout.addWidget(self.text_link_lb)
        self.textBrowser = QtGui.QTextBrowser(Dialog)
        self.textBrowser.setObjectName("textBrowser")
        self.verticalLayout.addWidget(self.textBrowser)
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.donate_btn = QtGui.QPushButton(Dialog)
        self.donate_btn.setObjectName("donate_btn")
        self.horizontalLayout_2.addWidget(self.donate_btn)
        self.verticalLayout.addLayout(self.horizontalLayout_2)
        self.verticalLayout.setStretch(2, 1)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
项目:nukeScripts    作者:mlavoy    | 项目源码 | 文件源码
def __init__(self, parent=None):
        self.publishData={}
        self.publishItems=[]
        self.selection=[]
        self.localDrive="E:"

        QtGui.QWidget.__init__(self, parent)
        #TreeA_Buttons
        self.PublishesHLayout = QtGui.QHBoxLayout()
        self.setLayout(self.PublishesHLayout)
        self.PublishesButtonsVLayout=QtGui.QVBoxLayout()
        #ServerRendersTree
        self.publishesTree = QtGui.QTreeWidget()
        self.publishesTree.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
        self.publishesTree.setObjectName("publishesTree")
        item=QtGui.QTreeWidgetItem()
        item.setText(0,"Publishes:")
        item.setText(1,"serverFrames:")
        item.setText(2,"localFrames:")
        self.publishesTree.setHeaderItem(item)
        self.publishesTree.setColumnCount(3)
        self.publishesTree.resizeColumnToContents(0)
        self.publishesTree.resizeColumnToContents(1)
        self.PublishesHLayout.addWidget(self.publishesTree)
        #frame widgets
        self.renderLocation = QtGui.QComboBox()
        self.renderLocation.insertItems(0,["server","local"])
        self.PublishesButtonsVLayout.addWidget(self.renderLocation)
        self.frameNthSize=QtGui.QLineEdit()
        self.frameNthSize.setText("10")
        self.PublishesButtonsVLayout.addWidget(self.frameNthSize)
        self.frameRange=QtGui.QLineEdit()
        self.frameRange.setText("")
        self.PublishesButtonsVLayout.addWidget(self.frameRange)
        self.phoneLabel = QtGui.QLabel()
        self.phoneLabel.setText("chunkSize")
        self.phoneLabel.setBuddy(self.frameNthSize)
        self.frameNthSize.setMaximumWidth(100)
        self.frameRange.setMaximumWidth(100)
        #TreeB_Buttons
        publishesTreeBtns = [
            ["print path", self.printPaths],
            ["copy local", self.copyLocal],
            ["printDependents", self.printDependentAovs],
            ["compareFiles", self.compareFiles],
            ["copyAllNodes", self.copyAllNodes],
        ]
        for btn in publishesTreeBtns:
            pushBtn = QtGui.QPushButton()
            pushBtn.setText(btn[0])
            pushBtn.clicked.connect(btn[1])
            self.PublishesButtonsVLayout.addWidget(pushBtn)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.PublishesButtonsVLayout.addItem(spacerItem)
        self.PublishesHLayout.addLayout(self.PublishesButtonsVLayout)

        self.getShotgunPublishes()
        self.buildTree()
        self.renderLocation.currentIndexChanged.connect(self.switchFilepaths)
项目:nukeScripts    作者:mlavoy    | 项目源码 | 文件源码
def __init__(self, parent=None):
        self.publishData={}
        self.publishItems=[]
        self.selection=[]
        self.localDrive="D:"

        QtGui.QWidget.__init__(self, parent)
        #TreeA_Buttons
        self.PublishesHLayout = QtGui.QHBoxLayout()
        self.setLayout(self.PublishesHLayout)
        self.PublishesButtonsVLayout=QtGui.QVBoxLayout()
        #ServerRendersTree
        self.publishesTree = QtGui.QTreeWidget()
        self.publishesTree.setSelectionMode(QtGui.QAbstractItemView.MultiSelection)
        self.publishesTree.setObjectName("publishesTree")
        item=QtGui.QTreeWidgetItem()
        item.setText(0,"Publishes:")
        item.setText(1,"serverFrames:")
        item.setText(2,"localFrames:")
        self.publishesTree.setHeaderItem(item)
        self.publishesTree.setColumnCount(3)
        self.publishesTree.resizeColumnToContents(0)
        self.publishesTree.resizeColumnToContents(1)
        self.PublishesHLayout.addWidget(self.publishesTree)
        #frame widgets
        self.renderLocation = QtGui.QComboBox()
        self.renderLocation.insertItems(0,["server","local"])
        self.PublishesButtonsVLayout.addWidget(self.renderLocation)
        self.frameNthSize=QtGui.QLineEdit()
        self.frameNthSize.setText("10")
        self.PublishesButtonsVLayout.addWidget(self.frameNthSize)
        self.frameRange=QtGui.QLineEdit()
        self.frameRange.setText("")
        self.PublishesButtonsVLayout.addWidget(self.frameRange)
        self.phoneLabel = QtGui.QLabel()
        self.phoneLabel.setText("chunkSize")
        self.phoneLabel.setBuddy(self.frameNthSize)
        self.frameNthSize.setMaximumWidth(100)
        self.frameRange.setMaximumWidth(100)
        #TreeB_Buttons
        publishesTreeBtns = [
            ["print path", self.printPaths],
            ["copy local", self.copyLocal],
            ["printDependents", self.printDependentAovs],
            ["compareFiles", self.compareFiles],
            ["copyAllNodes", self.copyAllNodes],
        ]
        for btn in publishesTreeBtns:
            pushBtn = QtGui.QPushButton()
            pushBtn.setText(btn[0])
            pushBtn.clicked.connect(btn[1])
            self.PublishesButtonsVLayout.addWidget(pushBtn)
        spacerItem = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding)
        self.PublishesButtonsVLayout.addItem(spacerItem)
        self.PublishesHLayout.addLayout(self.PublishesButtonsVLayout)

        self.getShotgunPublishes()
        self.buildTree()
        self.renderLocation.currentIndexChanged.connect(self.switchFilepaths)