python类QLineEdit()的实例源码

ParameterPanel.py 文件源码 项目:PipeLine 作者: draknova 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def initUI(self):
        # Define Layout
        self._layout = QtGui.QHBoxLayout()
        self._layout.setContentsMargins(0,0,0,0)
        self._layout.setSpacing(5)
        self.setLayout(self._layout)

        # Create Elements
        self._label = QtGui.QPushButton(self._parameter.label())
        self._field = QtGui.QLineEdit(str(self._parameter.value()))
        self._slider = ParameterSlider()

        self._layout.addWidget(self._label)
        self._layout.addWidget(self._field)   
        self._layout.addWidget(self._slider)
interface.py 文件源码 项目:PipeLine 作者: draknova 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self,parent=None):
        super(MainMenu,self).__init__(parent)    

        self.setNativeMenuBar(False)
        self.setFixedHeight(24)

        self._home = self.addMenu("Home")
        self._project = self.addMenu("Project")
        self._windows = self.addMenu("Windows")
        self._help = self.addMenu("Help")

        self._home.addAction("Home Screen")
        self._home.addAction("Show")
        self._home.addAction("Render")
        self._home.addAction("Daily")
        self._home.addAction("Review")

        self._project.addAction("Monster Trucks")
        self._project.addAction("Sputnik")
        self._project.addAction("Monster Trucks")
        self._project.addAction("Monster Trucks")

        self._windows.addAction("Node Editor")
        self._windows.addAction("Render Manager")
        self._windows.addAction("Console")
        self._windows.addAction("Script Editor")


        w = QtGui.QWidget()
        w.show()

        self._cornerWidget = QtGui.QWidget()
        self._cornerWidgetLayout = QtGui.QHBoxLayout()
        self._cornerWidget.setLayout(self._cornerWidgetLayout)
        self._cornerWidgetLayout.setContentsMargins(1,1,1,1)
        button = QtGui.QLineEdit("Search")
        self._cornerWidgetLayout.addWidget(button)

        self.setCornerWidget(self._cornerWidget,QtCore.Qt.TopRightCorner)
maxparenting_example.py 文件源码 项目:qtinwin 作者: alfalfasprossen 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def build_ui(self):
        self.setLayout(QtGui.QVBoxLayout())
        self.label = QtGui.QLabel("some label")
        self.btn = QtGui.QPushButton("button")
        self.lineedit = QtGui.QLineEdit()
        self.textedit = QtGui.QTextEdit()

        self.grp = QtGui.QGroupBox("group box grid layout")
        self.grp.setLayout(QtGui.QGridLayout())
        self.chkbx_1 = QtGui.QCheckBox("chkbx_1")
        self.chkbx_2 = QtGui.QCheckBox("chkbx_2l")
        self.chkbx_2.setDisabled(True)
        self.chkbx_3 = QtGui.QCheckBox("chkbx_2r")
        self.chkbx_4 = QtGui.QCheckBox("chkbx_3")
        self.chkbx_5 = QtGui.QCheckBox("chkbx_4")
        self.grp.layout().addWidget(self.chkbx_1, 0, 0)
        self.grp.layout().addWidget(self.chkbx_2, 1, 0)
        self.grp.layout().addWidget(self.chkbx_3, 1, 1)
        self.grp.layout().addWidget(self.chkbx_4, 2, 0)
        self.grp.layout().addWidget(self.chkbx_5, 3, 0)
        self.grp.layout().setColumnStretch(2,1)

        self.lrbox = QtGui.QHBoxLayout()
        self.lrbox.addWidget(self.textedit)
        self.lrbox.addWidget(self.grp)

        self.layout().addWidget(self.label)
        self.layout().addWidget(self.btn)
        self.layout().addWidget(self.lineedit)
        self.layout().addLayout(self.lrbox)
maxnativedialog_example.py 文件源码 项目:qtinwin 作者: alfalfasprossen 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def build_ui(self):
        self.setLayout(QtGui.QVBoxLayout())
        self.label = QtGui.QLabel("some label")
        self.btn = QtGui.QPushButton("button")
        self.lineedit = QtGui.QLineEdit()
        self.textedit = QtGui.QTextEdit()

        self.grp = QtGui.QGroupBox("group box grid layout")
        self.grp.setLayout(QtGui.QGridLayout())
        self.chkbx_1 = QtGui.QCheckBox("chkbx_1")
        self.chkbx_2 = QtGui.QCheckBox("chkbx_2l")
        self.chkbx_2.setDisabled(True)
        self.chkbx_3 = QtGui.QCheckBox("chkbx_2r")
        self.chkbx_4 = QtGui.QCheckBox("chkbx_3")
        self.chkbx_5 = QtGui.QCheckBox("chkbx_4")
        self.grp.layout().addWidget(self.chkbx_1, 0, 0)
        self.grp.layout().addWidget(self.chkbx_2, 1, 0)
        self.grp.layout().addWidget(self.chkbx_3, 1, 1)
        self.grp.layout().addWidget(self.chkbx_4, 2, 0)
        self.grp.layout().addWidget(self.chkbx_5, 3, 0)
        self.grp.layout().setColumnStretch(2,1)

        self.lrbox = QtGui.QHBoxLayout()
        self.lrbox.addWidget(self.textedit)
        self.lrbox.addWidget(self.grp)

        self.layout().addWidget(self.label)
        self.layout().addWidget(self.btn)
        self.layout().addWidget(self.lineedit)
        self.layout().addLayout(self.lrbox)
ToDoList.py 文件源码 项目:nuke 作者: Kagarrache 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def setupUi(self):
        self.setAutoFillBackground(True)
        hLayout = QtGui.QHBoxLayout(self)
        self.setLayout(hLayout)
        self.taskNameWidget = QtGui.QLineEdit(self.task.name)
        self.priorityWidget = PriorityWidget()
        self.priorityWidget.setValue(self.task.priority)
        self.statusWidget = StatusWidgetBar()
        self.statusWidget.setCurrentIndex(self.task.status)
        self.deleteWidget = DeleteWidget('delete')

        hLayout.addWidget(self.taskNameWidget)
        hLayout.addWidget(self.priorityWidget)
        hLayout.addWidget(self.statusWidget)
        hLayout.addWidget(self.deleteWidget)
config.py 文件源码 项目:kite 作者: pyrocko 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def setAttributes(self):
        for attr in self.attributes:
            qw = self.__getattribute__(attr)
            if isinstance(qw, QtGui.QCheckBox):
                value = qw.isChecked()
            elif isinstance(qw, QtGui.QLineEdit):
                value = str(qw.text())
            else:
                value = qw.value()

            config.__setattr__(attr, value)

        config.saveConfig()
createbitmap.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def dialog():

    w=QtGui.QWidget()

    box = QtGui.QVBoxLayout()
    w.setLayout(box)
    w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)

    l=QtGui.QLabel("String" )
    box.addWidget(l)
    w.anz = QtGui.QLineEdit()
    w.anz.setText('OK')
    box.addWidget(w.anz)

    l=QtGui.QLabel("Degree" )
    box.addWidget(l)
    w.degree = QtGui.QLineEdit()
    w.degree.setText('0')
    box.addWidget(w.degree)

    w.r=QtGui.QPushButton("run")
    box.addWidget(w.r)
    w.r.pressed.connect(lambda :_run(w))

    w.progressbar=QtGui.QProgressBar()
    box.addWidget(w.progressbar)


    w.show()
    return w
miki.py 文件源码 项目:freecad-nurbs 作者: microelly2 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def testme():

    layout='''
    VerticalLayoutTab:
    #   id:'main'
        QtGui.QLabel:
            setText:"***   N U R B S     E D I T O R   ***"
        VerticalLayout:
            HorizontalLayout:
                QtGui.QLabel:
                    setText: "huhuwas 1 3"
                QtGui.QLabel:
                    setText: "huhuwas 2 3"
                QtGui.QLabel:
                    setText: "huhuwas 3 3"
            HorizontalLayout:
                QtGui.QLabel:
                    setText:"Action "
                QtGui.QPushButton:
                    setText: "Run Action"
                VerticalLayout:
                    QtGui.QLineEdit:
                        setText:"edit Axample"
                    QtGui.QLineEdit:
                        setText:"edit B"
                QtGui.QLineEdit:
                    setText:"horizel "
        HorizontalLayout:
            QtGui.QLineEdit:
                setText:"AA"
            QtGui.QLineEdit:
                setText:"BB"

    '''


    miki=Miki()
    app.root=miki

    miki.parse2(layout)
    miki.run(layout)
toolwidget.py 文件源码 项目:LCInterlocking 作者: execuc 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def create_item(self, widget_config, grid, row_index):
        widget_config.widget_title = QtGui.QLabel(self.form)
        widget_config.widget_title.setText("%s : " % widget_config.show_name)

        if widget_config.type == float and not hasattr(widget_config, 'step'):
            widget_config.widget = QtGui.QLabel(self.form)
            widget_config.widget.setText("%f" % self.get_property_value(widget_config.name))
        elif widget_config.type == float:
            widget_config.widget = QtGui.QDoubleSpinBox(self.form)
            widget_config.widget.setDecimals(widget_config.decimals)
            widget_config.widget.setSingleStep(widget_config.step)
            widget_config.widget.setMinimum(widget_config.interval_value[0])
            widget_config.widget.setValue(self.get_property_value(widget_config.name))
            widget_config.widget.setMaximum(widget_config.interval_value[-1])
        elif widget_config.type == bool:
            widget_config.widget = QtGui.QCheckBox("", self.form)
            state = QtCore.Qt.Checked if self.get_property_value(widget_config.name) == True else QtCore.Qt.Unchecked
            widget_config.widget.setCheckState(state)
        elif widget_config.type == list:
            widget_config.widget = QtGui.QComboBox(self.form)
            widget_config.widget.addItems(widget_config.interval_value)
            default_value_index = 0
            for str_value in widget_config.interval_value:
                if self.get_property_value(widget_config.name) == str_value:
                    break
                default_value_index += 1
            if default_value_index == len(widget_config.interval_value):
                raise ValueError("Default value not found for list" + widget_config.name)
            widget_config.widget.setCurrentIndex(default_value_index)
            widget_config.widget.currentIndexChanged.connect(self.listchangeIndex)
        elif widget_config.type == str:
            widget_config.widget = QtGui.QLineEdit(self.form)
            widget_config.widget.setText(self.get_property_value(widget_config.name))
        else:
            raise ValueError("Undefined widget type")

        grid.addWidget(widget_config.widget_title, row_index, 0)
        grid.addWidget(widget_config.widget, row_index, 1)
findWidget_UIs.py 文件源码 项目:CNCGToolKit 作者: cineuse 项目源码 文件源码 阅读 15 收藏 0 点赞 0 评论 0
def setupUi(self, findReplace):
        findReplace.setObjectName("findReplace")
        findReplace.resize(246, 101)
        self.verticalLayout = QtGui.QVBoxLayout(findReplace)
        self.verticalLayout.setObjectName("verticalLayout")
        self.gridLayout = QtGui.QGridLayout()
        self.gridLayout.setObjectName("gridLayout")
        self.replace_le = QtGui.QLineEdit(findReplace)
        self.replace_le.setObjectName("replace_le")
        self.gridLayout.addWidget(self.replace_le, 1, 0, 1, 1)
        self.find_le = QtGui.QLineEdit(findReplace)
        self.find_le.setObjectName("find_le")
        self.gridLayout.addWidget(self.find_le, 0, 0, 1, 1)
        self.find_btn = QtGui.QPushButton(findReplace)
        self.find_btn.setObjectName("find_btn")
        self.gridLayout.addWidget(self.find_btn, 0, 1, 1, 1)
        self.replace_btn = QtGui.QPushButton(findReplace)
        self.replace_btn.setObjectName("replace_btn")
        self.gridLayout.addWidget(self.replace_btn, 1, 1, 1, 1)
        self.replaceAll_btn = QtGui.QPushButton(findReplace)
        self.replaceAll_btn.setObjectName("replaceAll_btn")
        self.gridLayout.addWidget(self.replaceAll_btn, 2, 1, 1, 1)
        self.verticalLayout.addLayout(self.gridLayout)

        self.retranslateUi(findReplace)
        QtCore.QMetaObject.connectSlotsByName(findReplace)
        findReplace.setTabOrder(self.find_le, self.replace_le)
        findReplace.setTabOrder(self.replace_le, self.find_btn)
        findReplace.setTabOrder(self.find_btn, self.replace_btn)
        findReplace.setTabOrder(self.replace_btn, self.replaceAll_btn)
ui_setupAPI.py 文件源码 项目:HexAPIStreamingTools 作者: JeffHoogland 项目源码 文件源码 阅读 16 收藏 0 点赞 0 评论 0
def setupUi(self, setupAPI):
        setupAPI.setObjectName("setupAPI")
        setupAPI.resize(374, 188)
        self.verticalLayout = QtGui.QVBoxLayout(setupAPI)
        self.verticalLayout.setObjectName("verticalLayout")
        self.apiFileLocationDisplay = QtGui.QLineEdit(setupAPI)
        self.apiFileLocationDisplay.setDragEnabled(True)
        self.apiFileLocationDisplay.setReadOnly(True)
        self.apiFileLocationDisplay.setObjectName("apiFileLocationDisplay")
        self.verticalLayout.addWidget(self.apiFileLocationDisplay)
        self.groupBox = QtGui.QGroupBox(setupAPI)
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.groupBox)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.portSpin = QtGui.QSpinBox(self.groupBox)
        self.portSpin.setMinimum(1000)
        self.portSpin.setMaximum(10000)
        self.portSpin.setProperty("value", 1234)
        self.portSpin.setObjectName("portSpin")
        self.verticalLayout_2.addWidget(self.portSpin)
        self.verticalLayout.addWidget(self.groupBox)
        self.selectAPIFileButton = QtGui.QPushButton(setupAPI)
        self.selectAPIFileButton.setObjectName("selectAPIFileButton")
        self.verticalLayout.addWidget(self.selectAPIFileButton)
        self.addAPIEntryButton = QtGui.QPushButton(setupAPI)
        self.addAPIEntryButton.setObjectName("addAPIEntryButton")
        self.verticalLayout.addWidget(self.addAPIEntryButton)

        self.retranslateUi(setupAPI)
        QtCore.QMetaObject.connectSlotsByName(setupAPI)
settingsdialog.py 文件源码 项目:pcbre 作者: pcbre 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, model, attr, traits):
        self.widget = QtGui.QLineEdit()
        self.model = model
        self.attr = attr
        self.traits = traits

        self.widget.setText(self.traits.fmt(getattr(self.model, self.attr)))
        self.widget.setValidator(self.traits.validator())
settingsdialog.py 文件源码 项目:pcbre 作者: pcbre 项目源码 文件源码 阅读 73 收藏 0 点赞 0 评论 0
def __init__(self, model, attr):
        self.widget = QtGui.QLineEdit()
        self.model = model
        self.attr = attr

        self.value = getattr(self.model, self.attr)
        self.widget.setValidator(QtGui.QIntValidator())
axisCtrlTemplate_pyside.py 文件源码 项目:NeoAnalysis 作者: neoanalysis 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(186, 154)
        Form.setMaximumSize(QtCore.QSize(200, 16777215))
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 7, 0, 1, 2)
        self.linkCombo = QtGui.QComboBox(Form)
        self.linkCombo.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
        self.linkCombo.setObjectName("linkCombo")
        self.gridLayout.addWidget(self.linkCombo, 7, 2, 1, 2)
        self.autoPercentSpin = QtGui.QSpinBox(Form)
        self.autoPercentSpin.setEnabled(True)
        self.autoPercentSpin.setMinimum(1)
        self.autoPercentSpin.setMaximum(100)
        self.autoPercentSpin.setSingleStep(1)
        self.autoPercentSpin.setProperty("value", 100)
        self.autoPercentSpin.setObjectName("autoPercentSpin")
        self.gridLayout.addWidget(self.autoPercentSpin, 2, 2, 1, 2)
        self.autoRadio = QtGui.QRadioButton(Form)
        self.autoRadio.setChecked(True)
        self.autoRadio.setObjectName("autoRadio")
        self.gridLayout.addWidget(self.autoRadio, 2, 0, 1, 2)
        self.manualRadio = QtGui.QRadioButton(Form)
        self.manualRadio.setObjectName("manualRadio")
        self.gridLayout.addWidget(self.manualRadio, 1, 0, 1, 2)
        self.minText = QtGui.QLineEdit(Form)
        self.minText.setObjectName("minText")
        self.gridLayout.addWidget(self.minText, 1, 2, 1, 1)
        self.maxText = QtGui.QLineEdit(Form)
        self.maxText.setObjectName("maxText")
        self.gridLayout.addWidget(self.maxText, 1, 3, 1, 1)
        self.invertCheck = QtGui.QCheckBox(Form)
        self.invertCheck.setObjectName("invertCheck")
        self.gridLayout.addWidget(self.invertCheck, 5, 0, 1, 4)
        self.mouseCheck = QtGui.QCheckBox(Form)
        self.mouseCheck.setChecked(True)
        self.mouseCheck.setObjectName("mouseCheck")
        self.gridLayout.addWidget(self.mouseCheck, 6, 0, 1, 4)
        self.visibleOnlyCheck = QtGui.QCheckBox(Form)
        self.visibleOnlyCheck.setObjectName("visibleOnlyCheck")
        self.gridLayout.addWidget(self.visibleOnlyCheck, 3, 2, 1, 2)
        self.autoPanCheck = QtGui.QCheckBox(Form)
        self.autoPanCheck.setObjectName("autoPanCheck")
        self.gridLayout.addWidget(self.autoPanCheck, 4, 2, 1, 2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
axisCtrlTemplate_pyside.py 文件源码 项目:NeoAnalysis 作者: neoanalysis 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(186, 154)
        Form.setMaximumSize(QtCore.QSize(200, 16777215))
        self.gridLayout = QtGui.QGridLayout(Form)
        self.gridLayout.setContentsMargins(0, 0, 0, 0)
        self.gridLayout.setSpacing(0)
        self.gridLayout.setObjectName("gridLayout")
        self.label = QtGui.QLabel(Form)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 7, 0, 1, 2)
        self.linkCombo = QtGui.QComboBox(Form)
        self.linkCombo.setSizeAdjustPolicy(QtGui.QComboBox.AdjustToContents)
        self.linkCombo.setObjectName("linkCombo")
        self.gridLayout.addWidget(self.linkCombo, 7, 2, 1, 2)
        self.autoPercentSpin = QtGui.QSpinBox(Form)
        self.autoPercentSpin.setEnabled(True)
        self.autoPercentSpin.setMinimum(1)
        self.autoPercentSpin.setMaximum(100)
        self.autoPercentSpin.setSingleStep(1)
        self.autoPercentSpin.setProperty("value", 100)
        self.autoPercentSpin.setObjectName("autoPercentSpin")
        self.gridLayout.addWidget(self.autoPercentSpin, 2, 2, 1, 2)
        self.autoRadio = QtGui.QRadioButton(Form)
        self.autoRadio.setChecked(True)
        self.autoRadio.setObjectName("autoRadio")
        self.gridLayout.addWidget(self.autoRadio, 2, 0, 1, 2)
        self.manualRadio = QtGui.QRadioButton(Form)
        self.manualRadio.setObjectName("manualRadio")
        self.gridLayout.addWidget(self.manualRadio, 1, 0, 1, 2)
        self.minText = QtGui.QLineEdit(Form)
        self.minText.setObjectName("minText")
        self.gridLayout.addWidget(self.minText, 1, 2, 1, 1)
        self.maxText = QtGui.QLineEdit(Form)
        self.maxText.setObjectName("maxText")
        self.gridLayout.addWidget(self.maxText, 1, 3, 1, 1)
        self.invertCheck = QtGui.QCheckBox(Form)
        self.invertCheck.setObjectName("invertCheck")
        self.gridLayout.addWidget(self.invertCheck, 5, 0, 1, 4)
        self.mouseCheck = QtGui.QCheckBox(Form)
        self.mouseCheck.setChecked(True)
        self.mouseCheck.setObjectName("mouseCheck")
        self.gridLayout.addWidget(self.mouseCheck, 6, 0, 1, 4)
        self.visibleOnlyCheck = QtGui.QCheckBox(Form)
        self.visibleOnlyCheck.setObjectName("visibleOnlyCheck")
        self.gridLayout.addWidget(self.visibleOnlyCheck, 3, 2, 1, 2)
        self.autoPanCheck = QtGui.QCheckBox(Form)
        self.autoPanCheck.setObjectName("autoPanCheck")
        self.gridLayout.addWidget(self.autoPanCheck, 4, 2, 1, 2)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
elevationgrid.py 文件源码 项目:reconstruction 作者: microelly2 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def dialog(points):
    print "dialog ",points.Label

    w=QtGui.QWidget()
    w.source=points

    box = QtGui.QVBoxLayout()
    w.setLayout(box)
    w.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)




    l=QtGui.QLabel("Model" )
    box.addWidget(l)
    w.mode = QtGui.QListWidget()
    w.mode.addItems( ['linear','thin_plate', 'cubic','inverse','multiquadric','gaussian' ,'quintic' ])
    box.addWidget(w.mode)

    l=QtGui.QLabel("count grid lines" )
    box.addWidget(l)
    w.grid = QtGui.QLineEdit()
    w.grid.setText('20')
    box.addWidget(w.grid)

    l=QtGui.QLabel("z-scale factor" )
    box.addWidget(l)
    w.zfac = QtGui.QLineEdit()
    w.zfac.setText('10')
    box.addWidget(w.zfac)

    l=QtGui.QLabel("z-max " )
    box.addWidget(l)
    w.zmax = QtGui.QLineEdit()
    w.zmax.setText('0')
    box.addWidget(w.zmax)


    w.matplot=QtGui.QCheckBox("show Matplot")
    box.addWidget(w.matplot)

    w.colormap=QtGui.QCheckBox("show colors")
    box.addWidget(w.colormap)


#   h=QtGui.QDial()
#   h.setMaximum(100)
#   h.setMinimum(0)
#   w.ha=h

#   box.addWidget(h)

    w.r=QtGui.QPushButton("run")
    box.addWidget(w.r)
    w.r.pressed.connect(lambda :srun(w))


    w.show()
    return w
log_in.py 文件源码 项目:CaptsLog 作者: jaehoonhwang 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
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)
PCBdataBase.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self, sql, parent=None):
        QtGui.QDialog.__init__(self, parent)
        self.setWindowTitle(u'Import database')
        self.sql = sql

        # file
        self.filePath = QtGui.QLineEdit('')
        self.filePath.setReadOnly(True)

        filePathButton = QtGui.QPushButton('...')
        self.connect(filePathButton, QtCore.SIGNAL("clicked()"), self.chooseFile)

        filePathFrame = QtGui.QFrame()
        filePathFrame.setObjectName('lay_path_widget')
        filePathFrame.setStyleSheet('''#lay_path_widget {background-color:#fff; border:1px solid rgb(199, 199, 199); padding: 5px;}''')
        filePathLayout = QtGui.QHBoxLayout(filePathFrame)
        filePathLayout.addWidget(QtGui.QLabel(u'File:\t'))
        filePathLayout.addWidget(self.filePath)
        filePathLayout.addWidget(filePathButton)
        filePathLayout.setContentsMargins(0, 0, 0, 0)

        # tabs
        self.tabs = QtGui.QTabWidget()
        self.tabs.setTabPosition(QtGui.QTabWidget.West)
        self.tabs.setObjectName('tabs_widget')
        self.tabs.addTab(self.tabCategories(), u'Categories')
        self.tabs.addTab(self.tabModels(), u'Models')
        self.tabs.setTabEnabled(1, False)
        self.connect(self.tabs, QtCore.SIGNAL("currentChanged (int)"), self.activeModelsTab)

        # buttons
        buttons = QtGui.QDialogButtonBox()
        buttons.addButton("Cancel", QtGui.QDialogButtonBox.RejectRole)
        buttons.addButton("Import", QtGui.QDialogButtonBox.AcceptRole)
        self.connect(buttons, QtCore.SIGNAL("accepted()"), self, QtCore.SLOT("accept()"))
        self.connect(buttons, QtCore.SIGNAL("rejected()"), self, QtCore.SLOT("reject()"))

        buttonsFrame = QtGui.QFrame()
        buttonsFrame.setObjectName('lay_path_widget')
        buttonsFrame.setStyleSheet('''#lay_path_widget {background-color:#fff; border:1px solid rgb(199, 199, 199); padding: 5px;}''')
        buttonsLayout = QtGui.QHBoxLayout(buttonsFrame)
        buttonsLayout.addWidget(buttons)
        buttonsLayout.setContentsMargins(0, 0, 0, 0)

        # main layout
        lay = QtGui.QGridLayout(self)
        lay.addWidget(filePathFrame, 0, 0, 1, 1)
        lay.addWidget(self.tabs, 1, 0, 1, 1)
        lay.addWidget(buttonsFrame, 2, 0, 1, 1)
        lay.setRowStretch(1, 10)
        lay.setContentsMargins(5, 5, 5, 5)
PCBcreateBoard.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        reload(PCBconf)

        QtGui.QWidget.__init__(self, parent)
        freecadSettings = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/PCB")

        self.form = self
        self.form.setWindowTitle(u"Create PCB")
        self.form.setWindowIcon(QtGui.QIcon(":/data/img/board.png"))
        #
        self.gruboscPlytki = QtGui.QDoubleSpinBox(self)
        self.gruboscPlytki.setSingleStep(0.1)
        self.gruboscPlytki.setValue(freecadSettings.GetFloat("boardThickness", 1.5))
        self.gruboscPlytki.setSuffix(u" mm")
        #
        self.pcbBorder = QtGui.QLineEdit('')
        self.pcbBorder.setReadOnly(True)

        pickPcbBorder = pickSketch(self.pcbBorder)
        #
        self.pcbHoles = QtGui.QLineEdit('')
        self.pcbHoles.setReadOnly(True)

        pickPcbHoles = pickSketch(self.pcbHoles)
        #
        self.pcbColor = kolorWarstwy()
        self.pcbColor.setColor(self.pcbColor.PcbColorToRGB(PCBconf.PCB_COLOR))
        self.pcbColor.setToolTip(u"Click to change color")
        #
        lay = QtGui.QGridLayout()
        lay.addWidget(QtGui.QLabel(u'Border:'), 0, 0, 1, 1)
        lay.addWidget(self.pcbBorder, 0, 1, 1, 1)
        lay.addWidget(pickPcbBorder, 0, 2, 1, 1)
        lay.addWidget(QtGui.QLabel(u'Holes:'), 1, 0, 1, 1)
        lay.addWidget(self.pcbHoles, 1, 1, 1, 1)
        lay.addWidget(pickPcbHoles, 1, 2, 1, 1)
        lay.addWidget(QtGui.QLabel(u'Thickness:'), 2, 0, 1, 1)
        lay.addWidget(self.gruboscPlytki, 2, 1, 1, 2)
        lay.addWidget(QtGui.QLabel(u'Color:'), 3, 0, 1, 1)
        lay.addWidget(self.pcbColor, 3, 1, 1, 2)
        #
        self.setLayout(lay)
PCBexportDrillingMap.py 文件源码 项目:FreeCAD-PCB 作者: marmni 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        QtGui.QDialog.__init__(self, parent)

        self.setWindowTitle(u"Create drilling map")
        #
        # Output file format
        self.formatList = QtGui.QComboBox()
        for i, j in exportList.items():
            self.formatList.addItem(j['name'], i)

        # Output directory
        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)
        # buttons
        saveButton = QtGui.QPushButton(u"Export")
        self.connect(saveButton, QtCore.SIGNAL("clicked ()"), self, QtCore.SLOT("accept()"))

        closeButton = QtGui.QPushButton(u"Close")
        self.connect(closeButton, QtCore.SIGNAL("clicked ()"), self, QtCore.SLOT('close()'))

        packageFooter = QtGui.QHBoxLayout()
        packageFooter.addStretch(10)
        packageFooter.addWidget(saveButton)
        packageFooter.addWidget(closeButton)
        packageFooter.setContentsMargins(10, 0, 10, 10)
        # header
        icon = QtGui.QLabel('')
        icon.setPixmap(QtGui.QPixmap(":/data/img/drill-icon.png"))

        headerWidget = QtGui.QWidget()
        headerWidget.setStyleSheet("padding: 10px; border-bottom: 1px solid #dcdcdc; background-color:#FFF;")
        headerLay = QtGui.QGridLayout(headerWidget)
        headerLay.addWidget(icon, 0, 0, 1, 1)
        headerLay.setContentsMargins(0, 0, 0, 0)
        ########
        centerLay = QtGui.QGridLayout()
        centerLay.addWidget(QtGui.QLabel(u'Output file format:'), 0, 0, 1, 1)
        centerLay.addWidget(self.formatList, 0, 1, 1, 2)
        centerLay.addWidget(QtGui.QLabel(u'Output directory:'), 1, 0, 1, 1)
        centerLay.addWidget(self.pathToFile, 1, 1, 1, 1)
        centerLay.addWidget(zmianaSciezki, 1, 2, 1, 1)
        centerLay.setContentsMargins(10, 20, 10, 20)

        mainLay = QtGui.QVBoxLayout(self)
        mainLay.addWidget(headerWidget)
        mainLay.addLayout(centerLay)
        mainLay.addStretch(10)
        mainLay.addLayout(packageFooter)
        mainLay.setContentsMargins(0, 0, 0, 0)
        #
        self.formatList.setCurrentIndex(self.formatList.findData('dxf'))


问题


面经


文章

微信
公众号

扫码关注公众号