Python PyQt4.QtGui 模块,QFormLayout() 实例源码

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

项目:olive-gui    作者:dturevski    | 项目源码 | 文件源码
def __init__(self, Lang):
        form = QtGui.QFormLayout()
        self.comboColor = QtGui.QComboBox()
        self.comboColor.addItems(model.COLORS)
        form.addRow(Lang.value('PP_Color'), self.comboColor)

        self.piece_types = sorted(model.FairyHelper.glyphs.iterkeys())
        self.comboType = QtGui.QComboBox()
        self.comboType.addItems(
            [x + ' (' + model.FairyHelper.glyphs[x]['name'] + ')' for x in self.piece_types])
        form.addRow(Lang.value('PP_Type'), self.comboType)

        vbox = QtGui.QVBoxLayout()
        vbox.addLayout(form, 1)
        vbox.addWidget(QtGui.QLabel(Lang.value('PP_Fairy_properties')))

        self.checkboxes = [QtGui.QCheckBox(x) for x in model.FAIRYSPECS]
        for box in self.checkboxes:
            vbox.addWidget(box)

        self.mainWidget = QtGui.QWidget()
        self.mainWidget.setLayout(vbox)
        super(AddFairyPieceDialog, self).__init__(Lang)

        self.setWindowTitle(Lang.value('MI_Add_piece'))
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtGui.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtGui.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtGui.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtGui.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = QtGui.QVBoxLayout()
        if type == "form":
            the_layout = QtGui.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)    
        elif type == "grid":
            the_layout = QtGui.QGridLayout()
        elif type == "hbox":
            the_layout = QtGui.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtGui.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:universal_tool_template.py    作者:shiningdesign    | 项目源码 | 文件源码
def quickLayout(self, type, ui_name=""):
        the_layout = ''
        if type in ("form", "QFormLayout"):
            the_layout = QtWidgets.QFormLayout()
            the_layout.setLabelAlignment(QtCore.Qt.AlignLeft)
            the_layout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)    
        elif type in ("grid", "QGridLayout"):
            the_layout = QtWidgets.QGridLayout()
        elif type in ("hbox", "QHBoxLayout"):
            the_layout = QtWidgets.QHBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        else:        
            the_layout = QtWidgets.QVBoxLayout()
            the_layout.setAlignment(QtCore.Qt.AlignTop)
        if ui_name != "":
            self.uiList[ui_name] = the_layout
        return the_layout
项目:Smart-Grid-Analytics    作者:Merit-Research    | 项目源码 | 文件源码
def fileWidget(self, parent):
        main_widget = QtGui.QWidget(parent)
        layout = QtGui.QFormLayout()

        file_label = QtGui.QLabel("Results file: ", main_widget)
        file_label.setFont(QtGui.QFont("Arial", 10, QtGui.QFont.Bold))
        file_browse = QtGui.QPushButton('Browse...')
        file_browse.clicked.connect(self.browseFile)
        self.file_edit = QtGui.QLineEdit(main_widget)        
        start_label = QtGui.QLabel("Start Date: ", main_widget)
        self.start_date = QtGui.QDateTimeEdit(main_widget)
        end_label = QtGui.QLabel("End Date: ", main_widget)
        self.end_date = QtGui.QDateTimeEdit(main_widget)

        layout.addRow(file_label)
        layout.addRow(file_browse, self.file_edit)
        layout.addRow(start_label, self.start_date)
        layout.addRow(end_label, self.end_date)

        main_widget.setLayout(layout)
        return main_widget

    # Creates the options panel to toggle smoothing and anomalies
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def __init__(self, parent=None, selectionMode=PoolSelectionMode.FromDatabase):
        wiz.SardanaBasePage.__init__(self, parent)
        self.setSelectionMode(selectionMode)

        self['pool'] = self._getPool

        self.setSubTitle('Please select the Pool instance')

        panel = self.getPanelWidget()

        layout = QtGui.QFormLayout()

        self.poolCB = QtGui.QComboBox(panel)
        self.poolCB.setDuplicatesEnabled(False)
        self.poolCB.setEditable(False)

        layout.addRow("&Pool instance", self.poolCB)

        panel.setLayout(layout)

        self.connect(self.poolCB,
                     QtCore.SIGNAL('currentIndexChanged(int)'),
                     QtCore.SIGNAL('completeChanged()'))
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def __init__(self, parent=None):
        wiz.SardanaBasePage.__init__(self, parent)

        self['sardana'] = self._getSardana

        self.setSubTitle('Please select the Sardana instance')

        panel = self.getPanelWidget()

        layout = QtGui.QFormLayout()

        self.sardanaCB = QtGui.QComboBox(panel)
        self.sardanaCB.setDuplicatesEnabled(False)
        self.sardanaCB.setEditable(False)

        layout.addRow("&Sardana instance", self.sardanaCB)

        panel.setLayout(layout)

        self.connect(self.sardanaCB,
                     QtCore.SIGNAL('currentIndexChanged(int)'),
                     QtCore.SIGNAL('completeChanged()'))
项目:OpenCouture-Dev    作者:9-9-0    | 项目源码 | 文件源码
def setUI(self):
        # Set Essentials #
        self.setWindowTitle('OpenCouture - Profiles')
        self.setGeometry(0, 0, self.width, self.height)
        self.setWindowIcon(QtGui.QIcon('Icon.png'))

        # Set Labels and Input Boxes #
        # NOTE: Decide on scope of labels and input boxes, how will they persist for multiple profiles...? Need to choose a data structure
        box_1_layout = QtGui.QFormLayout()
        #self.lbl_first_name = QtGui.QLabel(self)
        #self.lbl_first_name.move(25, 50)
        #self.lbl_first_name.setText("First Name")
        self.qle_first_name = QtGui.QLineEdit(self)
        box_1_layout.addRow("First Name", self.qle_first_name)
        #lbl_first_name = QtGui.QLabel(self)
        #lbl_first_name.move(60, 40)
        #lbl_first_name.setText("First Name")

        #self.lbl_last_name = QtGui.QLabel(self)
        #self.lbl_last_name.move(25, 75)
        #self.lbl_last_name.setText("Last Name")
        #self.lbl_email_address = QtGui.QLabel(self)
        #self.lbl_email_address.move(25, 100)
        #self.lbl_email_address.setText("Email Address")

        self.setLayout(box_1_layout)
        self.center()
        self.show()
项目:i3-manager    作者:erayaydin    | 项目源码 | 文件源码
def refreshModes(self):
        tabs = self.ui.modesTab
        tabs.clear()
        for modeKey in self.modes:
            tabContent = QtGui.QWidget()
            modeKeyboardTable = QtGui.QTableWidget(tabContent)
            modeKeyboardTable.setGeometry(QtCore.QRect(10, 10, 700, 350))
            modeKeyboardTable.setObjectName("mode"+modeKey+"KeyboardTable")
            modeKeyboardTable.setColumnCount(3)
            modeKeyboardTable.setRowCount(0)
            item = QtGui.QTableWidgetItem("Hotkey")
            modeKeyboardTable.setHorizontalHeaderItem(0, item)
            item = QtGui.QTableWidgetItem("Action")
            modeKeyboardTable.setHorizontalHeaderItem(1, item)
            item = QtGui.QTableWidgetItem("Remove")
            modeKeyboardTable.setHorizontalHeaderItem(2, item)

            table = modeKeyboardTable
            row = 0
            for modeHotkey in self.config['mode'][modeKey]:
                table.insertRow(row)
                table.setItem(row, 0, QtGui.QTableWidgetItem(modeHotkey['key']))
                table.setItem(row, 1, QtGui.QTableWidgetItem(modeHotkey['action']))
                removeBtn = QtGui.QPushButton(table)
                removeBtn.setText('Remove')
                table.setCellWidget(row, 2, removeBtn)
                row += 1

            modeFormLayoutWidget1 = QtGui.QWidget(tabContent)
            modeFormLayoutWidget1.setGeometry(QtCore.QRect(10, 370, 211, 22))
            modeFormLayoutWidget1.setObjectName("mode"+modeKey+"FormLayoutWidget1")
            modeFormLayout1 = QtGui.QFormLayout(modeFormLayoutWidget1)
            modeFormLayout1.setMargin(0)
            modeFormLayout1.setObjectName("mode"+modeKey+"FormLayout1")
            modeFormLabel = QtGui.QLabel(modeFormLayoutWidget1)
            modeFormLabel.setText("Hotkey")
            modeFormLayout1.setWidget(0, QtGui.QFormLayout.LabelRole, modeFormLabel)
            keyboardHotkey = QtGui.QLineEdit(modeFormLayoutWidget1)
            keyboardHotkey.setObjectName("mode"+modeKey+"keyboardHotkey")
            modeFormLayout1.setWidget(0, QtGui.QFormLayout.FieldRole, keyboardHotkey)
            modeFormLayoutWidget2 = QtGui.QWidget(tabContent)
            modeFormLayoutWidget2.setGeometry(QtCore.QRect(230, 370, 421, 22))
            modeFormLayout2 = QtGui.QFormLayout(modeFormLayoutWidget2)
            modeFormLayout2.setFieldGrowthPolicy(QtGui.QFormLayout.AllNonFixedFieldsGrow)
            modeFormLayout2.setMargin(0)
            keyboardAction = QtGui.QLineEdit(modeFormLayoutWidget2)
            keyboardAction.setObjectName("mode"+modeKey+"keyboardAction")
            modeFormLayout2.setWidget(0, QtGui.QFormLayout.FieldRole, keyboardAction)
            modeFormLabel2 = QtGui.QLabel(modeFormLayoutWidget2)
            modeFormLabel2.setText("Action")
            modeFormLayout2.setWidget(0, QtGui.QFormLayout.LabelRole, modeFormLabel2)
            btnKeyboardInsert = QtGui.QPushButton(tabContent)
            btnKeyboardInsert.setGeometry(QtCore.QRect(660, 370, 55, 21))
            btnKeyboardInsert.setText("Insert")
            tabs.addTab(tabContent, modeKey)
项目: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 = {}
        #------------------------------
项目:Smart-Grid-Analytics    作者:Merit-Research    | 项目源码 | 文件源码
def optionsWidget(self, parent):
        main_widget = QtGui.QWidget(parent)
        layout = QtGui.QFormLayout()

        self.options_label = QtGui.QLabel("Options:", main_widget)
        self.options_label.setFont(QtGui.QFont("Arial", 10, QtGui.QFont.Bold))
        #self.options_label.setAlignment(QtCore.Qt.AlignCenter)
        self.smooth_box = QtGui.QCheckBox("Smooth data (minutes):    ", main_widget)
        self.smooth_box.stateChanged.connect(self.smoothToggled)
        self.smooth_spin = QtGui.QSpinBox(main_widget)
        self.smooth_spin.setSingleStep(5)
        self.smooth_spin.setValue(0)
        self.smooth_spin.setDisabled(True)
        self.anomaly_box = QtGui.QCheckBox("Show anomalies (minutes)", main_widget)
        self.anomaly_box.stateChanged.connect(self.anomalyToggled)
        self.anomaly_spin = QtGui.QSpinBox(main_widget)
        self.smooth_spin.setSingleStep(5)
        self.anomaly_spin.setValue(0)
        self.anomaly_spin.setDisabled(True)
        #reset = QtGui.QPushButton("Reset", main_widget)
        #reset.clicked.connect(self.resetOptions)
        update = QtGui.QPushButton("Update Graph", main_widget)
        update.clicked.connect(self.updateGraph)

        layout.addRow(self.options_label)
        layout.addRow(self.smooth_box, self.smooth_spin)
        layout.addRow(self.anomaly_box, self.anomaly_spin)
        layout.addRow(update)

        main_widget.setLayout(layout)
        return main_widget

    #==================== HELPER FUNCTIONS ====================#
    # These functions do the actual work of the program.
    # Most are called in response to an event triggered by the main window, while
    # others are helper functions which perform a simple task.

    # Return true if the given filename is valid, false otherwise
项目:PH5    作者:PIC-IRIS    | 项目源码 | 文件源码
def __init__(self, parent, typeStr, unitStr, defaultSize):
        self.parent = parent
        QtGui.QDialog.__init__(self)
        mainbox = QtGui.QVBoxLayout(self)
        (w, h) = defaultSize
        if 'save' not in typeStr:
            notice = "The selected size %s x %s\n" + \
                    "Due to each printer's configuration,\n" + \
                    "user may need to adjust the size of the image \n" + \
                    "so that it will fit the paper."
            mainbox.addWidget( QtGui.QLabel(notice % (w, h), self) )  
            w, h = w-0.5, h-0.5

        formLayout = QtGui.QFormLayout(); mainbox.addLayout(formLayout)
        self.type = typeStr

        self.widthCtrl = QtGui.QLineEdit(self)
        self.widthCtrl.setText(str(w))
        formLayout.addRow('Width (%s)' % unitStr, self.widthCtrl) 

        self.heightCtrl = QtGui.QLineEdit(self)
        self.heightCtrl.setText(str(h))
        formLayout.addRow('Height (%s)' % unitStr, self.heightCtrl)

        formatDir = plt.gcf().canvas.get_supported_filetypes()
        if 'save' in typeStr: 
            formats =[]
            for f in formatDir.keys():
                formats.append("%s: %s" % (f, formatDir[f]))

            svgindex = formats.index("svg: %s" % formatDir['svg'] )
            self.fileFormatCtrl = QtGui.QComboBox(self)
            self.fileFormatCtrl.addItems(formats)
            self.fileFormatCtrl.setCurrentIndex(svgindex)
            formLayout.addRow("File Format", self.fileFormatCtrl) 

        # allow to select option of showing legend in saved graphic or printed graphic
        self.legendCkbox = QtGui.QCheckBox(self)
        self.legendCkbox.setChecked(True)
        formLayout.addRow("Legend", self.legendCkbox)

        okLbl = 'Save' if 'save' in typeStr else 'Print'
        self.OKBtn = QtGui.QPushButton(okLbl, self)
        self.OKBtn.clicked.connect(self.accept)

        self.cancelBtn = QtGui.QPushButton('Cancel', self)
        self.cancelBtn.clicked.connect(self.reject)

        formLayout.addRow(self.OKBtn, self.cancelBtn)
        self.resize(250,100)
项目:PH5    作者:PIC-IRIS    | 项目源码 | 文件源码
def __init__(self, parent, availTables, arrays, shotLines, offsets, das):

        QtGui.QWidget.__init__(self)
        self.setWindowTitle("Select Tables")
        self.parent = parent
        mainLayout = QtGui.QVBoxLayout(self)

        mainLayout.addWidget(QtGui.QLabel('What table do you want to get info from?'))

        formLayout = QtGui.QFormLayout() ; mainLayout.addLayout(formLayout)

        self.tableCtrl = QtGui.QComboBox(self)
        self.tableCtrl.clear()
        self.tableCtrl.addItems( [''] + availTables )
        formLayout.addRow("Table", self.tableCtrl)
        self.tableCtrl.currentIndexChanged.connect(self.OnSelectTable)

        self.arrayCtrl = QtGui.QComboBox(self)
        self.arrayCtrl.clear()
        self.arrayCtrl.addItems( [''] + arrays )
        formLayout.addRow("Array", self.arrayCtrl)

        self.shotLineCtrl = QtGui.QComboBox(self)
        self.shotLineCtrl.clear()
        self.shotLineCtrl.addItems( [''] + shotLines )
        formLayout.addRow("ShotLine", self.shotLineCtrl) 

        self.offsetCtrl = QtGui.QComboBox(self)
        self.offsetCtrl.clear()
        self.offsetCtrl.addItems( [''] + offsets )
        formLayout.addRow("Offset (array_event)", self.offsetCtrl)         

        self.dasCtrl = QtGui.QComboBox(self)
        self.dasCtrl.clear()
        self.dasCtrl.addItems( [''] + das )
        formLayout.addRow("Das", self.dasCtrl)

        btnLayout = QtGui.QHBoxLayout() ; mainLayout.addLayout(btnLayout)

        btnLayout.stretch(1)
        submitBtn = QtGui.QPushButton('Submit', self)
        submitBtn.clicked.connect(self.OnSubmit)
        btnLayout.addWidget(submitBtn)
        btnLayout.stretch(1)
        cancelBtn = QtGui.QPushButton('Cancel', self)
        cancelBtn.clicked.connect(self.OnCancel)
        btnLayout.addWidget(cancelBtn)
        btnLayout.stretch(1)

        #self.setLayout(mainLayout)
        self._disableCtrls()
        self.show()
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def __init__(self, parent=None):
        wiz.SardanaBasePage.__init__(self, parent)

        self.setSubTitle('Please select the Tango Host')
        self._valid = False

        self._regExp0 = QtCore.QRegExp("^[0-9a-zA-Z]{,50}")
        self._regValid0 = QtGui.QRegExpValidator(self._regExp0, self)

        self._regExp1 = QtCore.QRegExp("^[0-9]{,50}")
        self._regValid1 = QtGui.QRegExpValidator(self._regExp1, self)

        self._panel = self.getPanelWidget()

        layout = QtGui.QFormLayout()
        self.hostEdit = QtGui.QLineEdit()
        self.hostEdit.setValidator(self._regValid0)

        self.portEdit = QtGui.QLineEdit()
        self.portEdit.setValidator(self._regValid1)
        self.checkButton = QtGui.QPushButton("Check")

        layout.addRow("&Host", self.hostEdit)
        layout.addRow("&Port", self.portEdit)
        layout.addRow("", self.checkButton)
        self.checkButton.hide()
        host, port = self.get_default_tango_host()

        self.hostEdit.setText(host)
        self.portEdit.setText(port)

        self._panel.setLayout(layout)

        self['db'] = self._getDatabase
        self['port'] = self._getPort
        self['host'] = self._getHost

        self.connect(self.hostEdit, QtCore.SIGNAL(
            'textEdited(const QString &)'), self._letterChanged)
        self.connect(self.portEdit, QtCore.SIGNAL(
            'textEdited(const QString &)'), self._letterChanged)
        self.connect(self.checkButton, QtCore.SIGNAL(
            'clicked()'), self.checkData)

        self.checkData()
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def __init__(self, parent=None):
        wiz.SardanaBasePage.__init__(self, parent)
        self.setSubTitle('Please type the name for the new Sardana instance')
        self._valid = False

        panel = self.getPanelWidget()

        layout = QtGui.QFormLayout()

        self.nameEdit = QtGui.QLineEdit()
        self.nameEdit.setText("MySardana")

        self._regExp = QtCore.QRegExp("^[0-9a-zA-Z]{,50}")
        self._regValid = QtGui.QRegExpValidator(self._regExp, self)

        self.nameEdit.setValidator(self._regValid)

        self.checkButton = QtGui.QPushButton("Check")
        self.checkButton.hide()

        layout.addRow("&Name", self.nameEdit)
        layout.addRow("", self.checkButton)

        panel.setLayout(layout)

        self.connect(self.nameEdit, QtCore.SIGNAL(
            'textEdited(const QString &)'), self._letterChanged)
        self.connect(self.checkButton, QtCore.SIGNAL(
            'clicked()'), self.checkData)
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QWizardPage.__init__(self, parent)
        self.setPixmap(QtGui.QWizard.WatermarkPixmap,
                       QtGui.QPixmap(":/watermark.jpg"))
        self._layout = QtGui.QFormLayout()
        self._sardanaNameLabel = QtGui.QLabel()
        self._hostNameLabel = QtGui.QLabel()
        self._portLabel = QtGui.QLabel()
        self._poollsLabel = QtGui.QLabel()
        self._mssLabel = QtGui.QLabel()
        self._layout.addRow(self._set_style(
            QtGui.QLabel("Sardana:")), self._sardanaNameLabel)
        self._layout.addRow(self._set_style(
            QtGui.QLabel("Host:")), self._hostNameLabel)
        self._layout.addRow(self._set_style(
            QtGui.QLabel("Port:")), self._portLabel)
        self._layout.addRow(self._set_style(
            QtGui.QLabel("")), QtGui.QLabel(""))
        self._layout.addRow(self._set_style(
            QtGui.QLabel("Pools:")), self._poollsLabel)
        self._layout.addRow(self._set_style(
            QtGui.QLabel("MacroServers:")), self._mssLabel)
        self._checkBox = QtGui.QCheckBox(
            "Start local server automatically\neven if no starter is present")
        self._checkBox.setChecked(True)
        self._layout.addRow(self._checkBox)
        self._poolListText = ""
        self._msListText = ""
        self.setLayout(self._layout)
        # self.setCommitPage(True)
        self.setTitle('Confirmation.')
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def __init__(self, parent=None):
        QtGui.QWizardPage.__init__(self, parent)
        self.setPixmap(QtGui.QWizard.WatermarkPixmap,
                       QtGui.QPixmap(":/watermark.jpg"))
        self._layout = QtGui.QFormLayout()
        self.setCommitPage(True)
        self.setTitle('Confirmation')
项目:sardana    作者:sardana-org    | 项目源码 | 文件源码
def setupUi(self):
        self._imageSize = [100, 100]
        self._formLayout = QtGui.QFormLayout(self)
        self._organizationLabel = QtGui.QLabel("Organization:")
        self._formLayout.setWidget(
            0, QtGui.QFormLayout.LabelRole, self._organizationLabel)
        self._organizationLabelText = QtGui.QLabel(self)
        self._organizationLabelText.setFrameShape(QtGui.QFrame.Panel)
        self._organizationLabelText.setFrameShadow(QtGui.QFrame.Sunken)
        self._organizationLabelText.setWordWrap(False)
        self._formLayout.setWidget(
            0, QtGui.QFormLayout.FieldRole, self._organizationLabelText)
        self._familyLabel = QtGui.QLabel("Family:")
        self._formLayout.setWidget(
            1, QtGui.QFormLayout.LabelRole, self._familyLabel)
        self._familyLabelText = QtGui.QLabel(self)
        self._familyLabelText.setFrameShape(QtGui.QFrame.Panel)
        self._familyLabelText.setFrameShadow(QtGui.QFrame.Sunken)
        self._familyLabelText.setWordWrap(False)
        self._formLayout.setWidget(
            1, QtGui.QFormLayout.FieldRole, self._familyLabelText)
        self._modelLabel = QtGui.QLabel("Model:")
        self._formLayout.setWidget(
            2, QtGui.QFormLayout.LabelRole, self._modelLabel)
        self._modelLabelText = QtGui.QLabel(self)
        self._modelLabelText.setFrameShape(QtGui.QFrame.Panel)
        self._modelLabelText.setFrameShadow(QtGui.QFrame.Sunken)
        self._modelLabelText.setWordWrap(False)
        self._formLayout.setWidget(
            2, QtGui.QFormLayout.FieldRole, self._modelLabelText)
        self._descriptionLabel = QtGui.QLabel("Description:")
        self._formLayout.setWidget(
            3, QtGui.QFormLayout.LabelRole, self._descriptionLabel)
        self._descriptionLabelText = QtGui.QLabel(self)
        self._descriptionLabelText.setFrameShape(QtGui.QFrame.Panel)
        self._descriptionLabelText.setFrameShadow(QtGui.QFrame.Sunken)
        self._descriptionLabelText.setWordWrap(True)
        self._descriptionLabelText.setAlignment(QtCore.Qt.AlignTop)
        self._formLayout.setWidget(
            3, QtGui.QFormLayout.FieldRole, self._descriptionLabelText)
        self._imageLabel = QtGui.QLabel("Image:")
        self._formLayout.setWidget(
            4, QtGui.QFormLayout.LabelRole, self._imageLabel)
        self._deviceLogo = QtGui.QLabel(self)
        self._deviceLogo.setPixmap(taurus.qt.qtgui.resource.getThemePixmap(
            "image-missing").scaled(*self._imageSize))
        self._deviceLogo.pixmap()
        self._deviceLogo.setAlignment(QtCore.Qt.AlignHCenter)
        self._formLayout.setWidget(
            4, QtGui.QFormLayout.FieldRole, self._deviceLogo)
项目:darkc0de-old-stuff    作者:tuwid    | 项目源码 | 文件源码
def setupUi(self, About):
        About.setObjectName("About")
        About.resize(400, 300)
        self.verticalLayout = QtGui.QVBoxLayout(About)
        self.verticalLayout.setObjectName("verticalLayout")
        self.imagelabel = QtGui.QLabel(About)
        self.imagelabel.setObjectName("imagelabel")
        self.verticalLayout.addWidget(self.imagelabel)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setObjectName("formLayout")
        self.label_7 = QtGui.QLabel(About)
        self.label_7.setObjectName("label_7")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_7)
        self.label_8 = QtGui.QLabel(About)
        self.label_8.setObjectName("label_8")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.label_8)
        self.label = QtGui.QLabel(About)
        self.label.setObjectName("label")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label)
        self.label_4 = QtGui.QLabel(About)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.label_4)
        self.label_2 = QtGui.QLabel(About)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_2)
        self.label_5 = QtGui.QLabel(About)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.label_5)
        self.label_3 = QtGui.QLabel(About)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label_3)
        self.label_6 = QtGui.QLabel(About)
        self.label_6.setObjectName("label_6")
        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.label_6)
        self.horizontalLayout.addLayout(self.formLayout)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.buttonBox = QtGui.QDialogButtonBox(About)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(About)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), About.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), About.reject)
        QtCore.QMetaObject.connectSlotsByName(About)
项目:darkc0de-old-stuff    作者:tuwid    | 项目源码 | 文件源码
def setupUi(self, About):
        About.setObjectName("About")
        About.resize(400, 300)
        self.verticalLayout = QtGui.QVBoxLayout(About)
        self.verticalLayout.setObjectName("verticalLayout")
        self.imagelabel = QtGui.QLabel(About)
        self.imagelabel.setObjectName("imagelabel")
        self.verticalLayout.addWidget(self.imagelabel)
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.formLayout = QtGui.QFormLayout()
        self.formLayout.setObjectName("formLayout")
        self.label_7 = QtGui.QLabel(About)
        self.label_7.setObjectName("label_7")
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label_7)
        self.label_8 = QtGui.QLabel(About)
        self.label_8.setObjectName("label_8")
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.label_8)
        self.label = QtGui.QLabel(About)
        self.label.setObjectName("label")
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label)
        self.label_4 = QtGui.QLabel(About)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.label_4)
        self.label_2 = QtGui.QLabel(About)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(2, QtGui.QFormLayout.LabelRole, self.label_2)
        self.label_5 = QtGui.QLabel(About)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.label_5)
        self.label_3 = QtGui.QLabel(About)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.label_3)
        self.label_6 = QtGui.QLabel(About)
        self.label_6.setObjectName("label_6")
        self.formLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.label_6)
        self.horizontalLayout.addLayout(self.formLayout)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.buttonBox = QtGui.QDialogButtonBox(About)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.verticalLayout.addWidget(self.buttonBox)

        self.retranslateUi(About)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), About.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), About.reject)
        QtCore.QMetaObject.connectSlotsByName(About)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, MainWindow):
        MainWindow.setObjectName(_fromUtf8("MainWindow"))
        MainWindow.resize(245, 167)
        self.centralwidget = QtGui.QWidget(MainWindow)
        self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
        self.formLayout = QtGui.QFormLayout(self.centralwidget)
        self.formLayout.setObjectName(_fromUtf8("formLayout"))
        self.label = QtGui.QLabel(self.centralwidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.LabelRole, self.label)
        self.steps = QtGui.QSpinBox(self.centralwidget)
        self.steps.setMinimum(-10000)
        self.steps.setMaximum(10000)
        self.steps.setProperty("value", 10)
        self.steps.setObjectName(_fromUtf8("steps"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.FieldRole, self.steps)
        self.label_2 = QtGui.QLabel(self.centralwidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.LabelRole, self.label_2)
        self.delay = QtGui.QSpinBox(self.centralwidget)
        self.delay.setMinimum(1)
        self.delay.setMaximum(1000)
        self.delay.setProperty("value", 10)
        self.delay.setObjectName(_fromUtf8("delay"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.FieldRole, self.delay)
        self.pushButton_2 = QtGui.QPushButton(self.centralwidget)
        self.pushButton_2.setAutoRepeat(True)
        self.pushButton_2.setObjectName(_fromUtf8("pushButton_2"))
        self.formLayout.setWidget(4, QtGui.QFormLayout.LabelRole, self.pushButton_2)
        self.pushButton = QtGui.QPushButton(self.centralwidget)
        self.pushButton.setAutoRepeat(False)
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.formLayout.setWidget(2, QtGui.QFormLayout.SpanningRole, self.pushButton)
        self.pushButton_3 = QtGui.QPushButton(self.centralwidget)
        self.pushButton_3.setAutoRepeat(True)
        self.pushButton_3.setObjectName(_fromUtf8("pushButton_3"))
        self.formLayout.setWidget(4, QtGui.QFormLayout.FieldRole, self.pushButton_3)
        self.line = QtGui.QFrame(self.centralwidget)
        self.line.setFrameShape(QtGui.QFrame.HLine)
        self.line.setFrameShadow(QtGui.QFrame.Sunken)
        self.line.setObjectName(_fromUtf8("line"))
        self.formLayout.setWidget(3, QtGui.QFormLayout.SpanningRole, self.line)
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.takeSteps)
        QtCore.QObject.connect(self.pushButton_2, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.stepBackward)
        QtCore.QObject.connect(self.pushButton_3, QtCore.SIGNAL(_fromUtf8("clicked()")), MainWindow.stepForward)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
项目:pslab-desktop-apps    作者:fossasia    | 项目源码 | 文件源码
def setupUi(self, Form):
        Form.setObjectName(_fromUtf8("Form"))
        Form.resize(216, 338)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
        Form.setSizePolicy(sizePolicy)
        Form.setStyleSheet(_fromUtf8(""))
        self.verticalLayout = QtGui.QVBoxLayout(Form)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.frame = QtGui.QFrame(Form)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.frame.sizePolicy().hasHeightForWidth())
        self.frame.setSizePolicy(sizePolicy)
        self.frame.setStyleSheet(_fromUtf8(""))
        self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtGui.QFrame.Raised)
        self.frame.setObjectName(_fromUtf8("frame"))
        self.formLayout = QtGui.QFormLayout(self.frame)
        self.formLayout.setObjectName(_fromUtf8("formLayout"))
        self.progress = QtGui.QProgressBar(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.progress.sizePolicy().hasHeightForWidth())
        self.progress.setSizePolicy(sizePolicy)
        self.progress.setStyleSheet(_fromUtf8(""))
        self.progress.setProperty("value", 0)
        self.progress.setObjectName(_fromUtf8("progress"))
        self.formLayout.setWidget(0, QtGui.QFormLayout.SpanningRole, self.progress)
        self.pushButton = QtGui.QPushButton(self.frame)
        self.pushButton.setMinimumSize(QtCore.QSize(0, 50))
        self.pushButton.setStyleSheet(_fromUtf8(""))
        self.pushButton.setObjectName(_fromUtf8("pushButton"))
        self.formLayout.setWidget(1, QtGui.QFormLayout.SpanningRole, self.pushButton)
        self.frame_2 = QtGui.QFrame(self.frame)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.frame_2.sizePolicy().hasHeightForWidth())
        self.frame_2.setSizePolicy(sizePolicy)
        self.frame_2.setFrameShape(QtGui.QFrame.StyledPanel)
        self.frame_2.setFrameShadow(QtGui.QFrame.Raised)
        self.frame_2.setObjectName(_fromUtf8("frame_2"))
        self.horizontalLayout = QtGui.QHBoxLayout(self.frame_2)
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.VLabel = QtGui.QLabel(self.frame_2)
        self.VLabel.setObjectName(_fromUtf8("VLabel"))
        self.horizontalLayout.addWidget(self.VLabel)
        self.ILabel = QtGui.QLabel(self.frame_2)
        self.ILabel.setObjectName(_fromUtf8("ILabel"))
        self.horizontalLayout.addWidget(self.ILabel)
        self.formLayout.setWidget(2, QtGui.QFormLayout.SpanningRole, self.frame_2)
        self.verticalLayout.addWidget(self.frame)

        self.retranslateUi(Form)
        QtCore.QObject.connect(self.pushButton, QtCore.SIGNAL(_fromUtf8("clicked(bool)")), Form.start)
        QtCore.QMetaObject.connectSlotsByName(Form)