python类QLineEdit()的实例源码

sequana_gui.py 文件源码 项目:sequana 作者: sequana 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def __init__(self, run_button, combobox):
        super(SequanaFactory, self).__init__("sequana", run_button)
        self._imported_config = None
        self._choice_button = combobox

        # Some widgets to be used: a file browser for paired files
        fastq_filter = "Fastq file (*.fastq *.fastq.gz *.fq *.fq.gz)"
        self._sequana_paired_tab = FileBrowser(paired=True, file_filter=fastq_filter)
        self._sequana_readtag_label2 = QW.QLabel("Read tag (e.g. _[12].fastq)")
        self._sequana_readtag_lineedit2 = QW.QLineEdit("_R[12]_")

        # Set the file browser input_directory tab
        self._sequana_directory_tab = FileBrowser(directory=True)
        self._sequana_readtag_label = QW.QLabel("Read tag (e.g. _[12].fastq)")
        self._sequana_readtag_lineedit = QW.QLineEdit("_R[12]_")
        self._sequana_pattern_label = QW.QLabel(
            "<div><i>Optional</i> pattern (e.g., Samples_1?/*fastq.gz)</div>")
        self._sequana_pattern_lineedit = QW.QLineEdit()

        # triggers/connectors
        self._sequana_directory_tab.clicked_connect(self._switch_off_run)
        self._choice_button.activated.connect(self._switch_off_run)
        self._sequana_paired_tab.clicked_connect(self._switch_off_run)
snakemake.py 文件源码 项目:sequana 作者: sequana 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def read_settings(self):
        settings = QtCore.QSettings(self._application, self._section)
        for key in settings.allKeys():
            value = settings.value(key)
            try:
                # This is required to skip the tab_position key/value
                this = getattr(self.ui, key)
            except:
                continue
            if isinstance(this, QW.QLineEdit):
                this.setText(value)
            elif isinstance(this, QW.QSpinBox):
                this.setValue(int(value))
            elif isinstance(this, QW.QCheckBox):
                if value in ['false', False, "False"]:
                    this.setChecked(False)
                else:
                    this.setChecked(True)
            elif isinstance(this, FileBrowser):
                this.set_filenames(value)
            else:
                print('could not handle : %s' % this)
        # The last tab position
        self._tab_pos = settings.value("tab_position", 0, type=int)
        self.ui.tabs.setCurrentIndex(self._tab_pos)
snakemake.py 文件源码 项目:sequana 作者: sequana 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def get_settings(self):
        # get all items to save in settings
        items = {}
        names = self._get_widget_names()
        for name in names:
            widget = getattr(self.ui, name)
            if isinstance(widget, QW.QLineEdit):
                value = widget.text()
            elif isinstance(widget, QW.QSpinBox):
                value = widget.value()
            elif isinstance(widget, QW.QCheckBox):
                value = widget.isChecked()
            elif isinstance(widget, QW.QSpinBox):
                value = widget.value()
            elif isinstance(widget, FileBrowser):
                value = widget.get_filenames()
            else:
                raise NotImplementedError("for developers")
            items[name] = value
        items["tab_position"] = self.ui.tabs.currentIndex()
        return items
session.py 文件源码 项目:axopy 作者: ucdrascal 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def __init__(self, configurations=None, parent=None):
        super(SessionInfoWidget, self).__init__(parent=parent)

        main_layout = QtWidgets.QVBoxLayout()
        self.setLayout(main_layout)

        form_layout = QtWidgets.QFormLayout()
        form_layout.setFormAlignment(QtCore.Qt.AlignVCenter)
        main_layout.addLayout(form_layout)

        if configurations is not None:
            self._config_combo_box = QtWidgets.QComboBox()
            form_layout.addRow("Configuration", self._config_combo_box)

            for config in configurations:
                self._config_combo_box.addItem(config)

        self._subject_line_edit = QtWidgets.QLineEdit()
        form_layout.addRow("Subject", self._subject_line_edit)

        self._button = QtWidgets.QPushButton("Start")
        main_layout.addWidget(self._button)

        self._button.clicked.connect(self._on_button_click)
builtin.py 文件源码 项目:pyree-old 作者: DrLuke 项目源码 文件源码 阅读 43 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
        super(FileWatch, self).__init__(*args, **kwargs)

        self.filePath = ""
        self.lastEdited = 0
        self.fileContent = ""

        self.propertiesWidget = QWidget()

        self.vlayout = QVBoxLayout()
        self.lineEdit = QLineEdit()
        self.lineEdit.textChanged.connect(self.lineEditTextChanges)

        self.vlayout.addWidget(self.lineEdit)
        self.vlayout.addItem(QSpacerItem(40, 20, QSizePolicy.Minimum, QSizePolicy.Expanding))

        self.propertiesWidget.setLayout(self.vlayout)

        self.timer = QTimer()
        self.timer.timeout.connect(self.checkFileChange)
        self.timer.start(200)
adventure.py 文件源码 项目:networkzero 作者: tjguk 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super(Adventure, self).__init__(parent)

        #
        # Top-half of the
        #
        self.image_panel = QtWidgets.QLabel()
        self.image_panel.setAlignment(QtCore.Qt.AlignCenter)
        self.image = QtGui.QPixmap("image.jpg")
        self.image_panel.setPixmap(self.image)

        self.text_panel = QtWidgets.QTextEdit()
        self.text_panel.setReadOnly(True)
        self.text_panel.setTextBackgroundColor(QtGui.QColor("blue"))
        self.text_panel.setHtml("""<h1>Hello, World!</h1>

        <p>You are in a spacious ballroom with the sound of music playing all around you.</p>
        """)

        self.data_panel = QtWidgets.QTextEdit()
        self.data_panel.setReadOnly(True)

        self.input = QtWidgets.QLineEdit()

        layout = QtWidgets.QVBoxLayout()
        layout.addWidget(self.image_panel, 1)
        hlayout = QtWidgets.QHBoxLayout()
        hlayout.addWidget(self.text_panel, 3)
        hlayout.addWidget(self.data_panel, 1)
        layout.addLayout(hlayout, 1)
        layout.addWidget(self.input)

        self.setLayout(layout)
        self.setWindowTitle("Westpark Adventure")
textbox.py 文件源码 项目:VIRTUAL-PHONE 作者: SumanKanrar-IEM 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def initUI(self):
        self.setWindowTitle(self.title)
        self.setGeometry(self.left, self.top, self.width, self.height)

        # Create textbox
        self.textbox = QLineEdit(self)
        self.textbox.move(20, 20)
        self.textbox.resize(280,40)

        # Create a button in the window
        self.button = QPushButton('Show text', self)
        self.button.move(20,80)

        # connect button to function on_click
        self.button.clicked.connect(self.on_click)
        self.show()
LineEdit.py 文件源码 项目:VIRTUAL-PHONE 作者: SumanKanrar-IEM 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def init_ui(self):
        self.le = QtWidgets.QLineEdit()
        self.b1 = QtWidgets.QPushButton('Clear')
        self.b2 = QtWidgets.QPushButton('Print')

        v_box = QtWidgets.QVBoxLayout()
        v_box.addWidget(self.le)
        v_box.addWidget(self.b1)
        v_box.addWidget(self.b2)

        self.setLayout(v_box)
        self.setWindowTitle('PyQt5 Lesson 7')

        self.b1.clicked.connect(self.btn_clk)
        self.b2.clicked.connect(self.btn_clk)

        self.show()
Ui_Login.py 文件源码 项目:Crawler_UI_New 作者: crystalhsj 项目源码 文件源码 阅读 70 收藏 0 点赞 0 评论 0
def setupUi(self, Login):
        Login.setObjectName("Login")
        Login.resize(300, 400)
        Login.setMinimumSize(QtCore.QSize(300, 400))
        Login.setMaximumSize(QtCore.QSize(300, 400))
        self.pushButton = QtWidgets.QPushButton(Login)
        self.pushButton.setGeometry(QtCore.QRect(100, 320, 99, 27))
        self.pushButton.setObjectName("pushButton")
        self.label_2 = QtWidgets.QLabel(Login)
        self.label_2.setGeometry(QtCore.QRect(28, 190, 68, 17))
        self.label_2.setObjectName("label_2")
        self.lineEdit_2 = QtWidgets.QLineEdit(Login)
        self.lineEdit_2.setGeometry(QtCore.QRect(120, 190, 151, 27))
        self.lineEdit_2.setEchoMode(QtWidgets.QLineEdit.Password)
        self.lineEdit_2.setObjectName("lineEdit_2")
        self.label = QtWidgets.QLabel(Login)
        self.label.setGeometry(QtCore.QRect(28, 120, 68, 17))
        self.label.setObjectName("label")
        self.lineEdit = QtWidgets.QLineEdit(Login)
        self.lineEdit.setGeometry(QtCore.QRect(120, 120, 151, 27))
        self.lineEdit.setObjectName("lineEdit")

        self.retranslateUi(Login)
        QtCore.QMetaObject.connectSlotsByName(Login)
extra_widgets.py 文件源码 项目:plexdesktop 作者: coryo 项目源码 文件源码 阅读 34 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__(parent)
        """style is relying on object names so make sure they are set
           before registering widgets"""
        self.setObjectName('HubSearch')

        search_action = QtWidgets.QAction(self)
        search_action.setObjectName('search_action')
        close_action = QtWidgets.QAction(self)
        close_action.setObjectName('close_action')
        close_action.triggered.connect(self.cancel.emit)
        close_action.triggered.connect(self.clear)

        self.addAction(search_action, QtWidgets.QLineEdit.LeadingPosition)
        self.addAction(close_action, QtWidgets.QLineEdit.TrailingPosition)

        plexdesktop.style.Style.Instance().widget.register(search_action, 'glyphicons-search')
        plexdesktop.style.Style.Instance().widget.register(close_action, 'cancel')
extra_widgets.py 文件源码 项目:plexdesktop 作者: coryo 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, parent=None):
        super().__init__(parent)
        self.setWindowTitle('Manual Add Server')
        self.form = QtWidgets.QFormLayout(self)
        self.secure = QtWidgets.QCheckBox()
        self.address = QtWidgets.QLineEdit()
        self.port = QtWidgets.QLineEdit('32400')
        self.token = QtWidgets.QLineEdit()
        self.form.addRow(QtWidgets.QLabel('HTTPS?'), self.secure)
        self.form.addRow(QtWidgets.QLabel('Address'), self.address)
        self.form.addRow(QtWidgets.QLabel('Port'), self.port)
        self.form.addRow(QtWidgets.QLabel('Access Token (optional)'), self.token)
        self.buttons = QtWidgets.QDialogButtonBox(
            QtWidgets.QDialogButtonBox.Ok | QtWidgets.QDialogButtonBox.Cancel, QtCore.Qt.Horizontal, self)
        self.form.addRow(self.buttons)
        self.buttons.rejected.connect(self.reject)
        self.buttons.accepted.connect(self.accept)
configwindow.py 文件源码 项目:dxf2gcode 作者: cnc-club 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def __init__(self, text, size_min = None, size_max = None, parent = None):
        """
        Initialization of the CfgLineEdit class (text edit, one line).
        @param text: text string associated with the line edit
        @param size_min: min length (int)
        @param size_max: max length (int)
        """
        QWidget.__init__(self, parent)

        self.lineedit = QLineEdit(parent)

        self.setSpec({'minimum': size_min, 'maximum': size_max, 'comment': ''})
        if size_min is not None:
            self.size_min = size_min
        else:
            self.size_min = 0

        self.label = QLabel(text, parent)
        self.layout = QVBoxLayout(parent)

        self.layout.addWidget(self.label)
        self.layout.addWidget(self.lineedit)
        self.setLayout(self.layout)
        self.layout.setSpacing(1) #Don't use too much space, it makes the option window too big otherwise
users_management_window.py 文件源码 项目:Enibar 作者: ENIB 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self):
        super().__init__()
        self.layout = QtWidgets.QGridLayout()
        self.setStyleSheet("QPushButton{margin:0.5em 0 0 0;padding:0.25em 1em}")

        self.username_label = QtWidgets.QLabel("Nom d'utilisateur:", self)
        self.password_label = QtWidgets.QLabel("Mot de passe:", self)
        self.username_input = QtWidgets.QLineEdit(self)
        self.password_input = QtWidgets.QLineEdit(self)
        self.password_input.setEchoMode(QtWidgets.QLineEdit.Password)
        self.cancel_button = QtWidgets.QPushButton("Annuler", self)
        self.validation_button = QtWidgets.QPushButton("Ajouter", self)

        self.layout.addWidget(self.username_label, 0, 0)
        self.layout.addWidget(self.username_input, 1, 0, 1, 0)
        self.layout.addWidget(self.password_label, 2, 0)
        self.layout.addWidget(self.password_input, 3, 0, 1, 0)
        self.layout.addWidget(self.validation_button, 4, 0)
        self.layout.addWidget(self.cancel_button, 4, 1)

        self.cancel_button.setAutoDefault(False)
        self.setLayout(self.layout)

        self.cancel_button.clicked.connect(self.reject)
        self.validation_button.clicked.connect(self.accept)
memwrite.py 文件源码 项目:vivisect-py3 作者: bat-serjo 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self):
        super(MemNavWidget, self).__init__()

        self.expr_entry = QtWidgets.QLineEdit()
        self.esize_entry = QtWidgets.QLineEdit()

        hbox1 = QtWidgets.QHBoxLayout()
        hbox1.setContentsMargins(2, 2, 2, 2)
        hbox1.setSpacing(4)
        hbox1.addWidget(self.expr_entry)
        hbox1.addWidget(self.esize_entry)

        self.setLayout(hbox1)

        self.expr_entry.returnPressed.connect(self.emitUserChangedSignal)
        self.esize_entry.returnPressed.connect(self.emitUserChangedSignal)
gpvdm_select.py 文件源码 项目:gpvdm 作者: roderickmackenzie 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self,file_box=False):
        QWidget.__init__(self)
        self.hbox=QHBoxLayout()
        self.edit=QLineEdit()
        self.button=QPushButton()
        self.button.setFixedSize(25, 25)
        self.button.setText("...")
        self.hbox.addWidget(self.edit)
        self.hbox.addWidget(self.button)

        self.hbox.setContentsMargins(0, 0, 0, 0)
        self.edit.setStyleSheet("QLineEdit { border: none }");

        if file_box==True:
            self.button.clicked.connect(self.callback_button_click)

        self.setLayout(self.hbox)
QColorPicker.py 文件源码 项目:gpvdm 作者: roderickmackenzie 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def __init__(self,r,g,b):
        QWidget.__init__(self)
        self.r=r
        self.g=g
        self.b=b
        self.hbox=QHBoxLayout()
        self.edit=QLineEdit()
        self.button=QPushButton()
        self.button.setFixedSize(25, 25)
        self.button.setText("...")
        self.hbox.addWidget(self.edit)
        self.hbox.addWidget(self.button)

        self.hbox.setContentsMargins(0, 0, 0, 0)
        self.update_color()


        self.button.clicked.connect(self.callback_button_click)

        self.setLayout(self.hbox)
tab.py 文件源码 项目:gpvdm 作者: roderickmackenzie 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def callback_edit(self, file_name,token,widget):
        if type(widget)==QLineEdit:
            a=undo_list_class()
            a.add([file_name, token, inp_get_token_value(self.file_name, token),widget])
            inp_update_token_value(file_name, token, widget.text())
        elif type(widget)==gtkswitch:
            inp_update_token_value(file_name, token, widget.get_value())
        elif type(widget)==leftright:
            inp_update_token_value(file_name, token, widget.get_value())
        elif type(widget)==gpvdm_select:
            inp_update_token_value(file_name, token, widget.text())
        elif type(widget)==QComboBox:
            inp_update_token_value(file_name, token, widget.itemText(widget.currentIndex()))
        elif type(widget)==QComboBoxLang:
            inp_update_token_value(file_name, token, widget.currentText_english())
        elif type(widget)==QColorPicker:
            inp_update_token_array(file_name, token, [str(widget.r),str(widget.g),str(widget.b)])
        elif type(widget)==QChangeLog:
            a=undo_list_class()
            a.add([file_name, token, inp_get_token_value(self.file_name, token),widget])
            inp_update_token_array(file_name, token, widget.toPlainText().split("\n"))

        help_window().help_set_help(["document-save-as","<big><b>Saved to disk</b></big>\n"])

        self.changed.emit()
LeftBarBarChart.py 文件源码 项目:pyqt5 作者: yurisnm 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def init_ui(self):
        self.layout_inputs = QVBoxLayout()
        self.setLayout(self.layout_inputs)
        for i in range(self.amount):
            value = QLineEdit()
            value.textChanged.connect(self.keep_valid)
            # value.textChanged.connect(self.parent.input_changed)
            value.setText('0')
            value.setInputMask('9999999')
            value.setCursorPosition(0)
            self.inputs.append(value)
            self.layout_inputs.addWidget(value)
        l = QVBoxLayout()
        l.addSpacing(1)
        l.addStretch(-1)
        self.layout_inputs.addLayout(l)
LeftBarBarChart.py 文件源码 项目:pyqt5 作者: yurisnm 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def update_tab(self, amount):
        if amount>self.amount:
            for i in range(amount-self.amount):
                value = QLineEdit()
                value.textChanged.connect(self.keep_valid)
                # value.textChanged.connect(self.parent.input_changed)
                value.setText('0')
                value.setInputMask('9999999')
                value.setCursorPosition(0)
                self.inputs.append(value)
                self.layout_inputs.insertWidget(0,value)
        else:
            for i in range(amount,self.amount):

                self.layout_inputs.removeWidget(self.inputs[-1])
                self.inputs[-1].hide()
                self.inputs[-1].close()
                self.inputs.remove(self.inputs[-1])
        self.amount = amount
ui_window.py 文件源码 项目:Mac-Python-3.X 作者: L1nwatch 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def setupUi(self, Window):
        Window.setObjectName("Window")
        Window.resize(640, 480)
        self.verticalLayout = QtWidgets.QVBoxLayout(Window)
        self.verticalLayout.setObjectName("verticalLayout")
        self.webView = QtWebKitWidgets.QWebView(Window)
        self.webView.setUrl(QtCore.QUrl("http://webkit.org/"))
        self.webView.setObjectName("webView")
        self.verticalLayout.addWidget(self.webView)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.formLayout = QtWidgets.QFormLayout()
        self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.ExpandingFieldsGrow)
        self.formLayout.setObjectName("formLayout")
        self.elementLabel = QtWidgets.QLabel(Window)
        self.elementLabel.setObjectName("elementLabel")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.elementLabel)
        self.elementLineEdit = QtWidgets.QLineEdit(Window)
        self.elementLineEdit.setObjectName("elementLineEdit")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.elementLineEdit)
        self.horizontalLayout.addLayout(self.formLayout)
        self.highlightButton = QtWidgets.QPushButton(Window)
        self.highlightButton.setObjectName("highlightButton")
        self.horizontalLayout.addWidget(self.highlightButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.elementLabel.setBuddy(self.elementLineEdit)

        self.retranslateUi(Window)
        QtCore.QMetaObject.connectSlotsByName(Window)


问题


面经


文章

微信
公众号

扫码关注公众号