• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python QtWidgets.QLineEdit类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中qgis.PyQt.QtWidgets.QLineEdit的典型用法代码示例。如果您正苦于以下问题:Python QLineEdit类的具体用法?Python QLineEdit怎么用?Python QLineEdit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了QLineEdit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self):
        QDialog.__init__(self)

        self.setWindowTitle(tr('Rectangle size'))

        self.width = QLineEdit()
        self.height = QLineEdit()

        width_val = QDoubleValidator()
        height_val = QDoubleValidator()

        self.width.setValidator(width_val)
        self.height.setValidator(height_val)

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        grid = QGridLayout()
        grid.addWidget(QLabel(tr('Give a size in m:')), 0, 0)
        grid.addWidget(QLabel(tr('Width:')), 1, 0)
        grid.addWidget(QLabel(tr('Height:')), 1, 1)
        grid.addWidget(self.width, 2, 0)
        grid.addWidget(self.height, 2, 1)
        grid.addWidget(buttons, 3, 0, 1, 2)

        self.setLayout(grid)
开发者ID:jeremyk6,项目名称:qdraw,代码行数:28,代码来源:drawtools.py


示例2: XYDialog

class XYDialog(QDialog):
    crs = None

    def __init__(self):
        QDialog.__init__(self)

        self.setWindowTitle(tr('XY Point drawing tool'))

        self.X = QLineEdit()
        self.Y = QLineEdit()

        X_val = QDoubleValidator()
        Y_val = QDoubleValidator()

        self.X.setValidator(X_val)
        self.Y.setValidator(Y_val)

        self.crsButton = QPushButton("Projection")
        self.crsButton.clicked.connect(self.changeCRS)
        self.crsLabel = QLabel("")

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        grid = QGridLayout()
        grid.addWidget(QLabel("X"), 0, 0)
        grid.addWidget(QLabel("Y"), 0, 1)
        grid.addWidget(self.X, 1, 0)
        grid.addWidget(self.Y, 1, 1)
        grid.addWidget(self.crsButton, 2, 0)
        grid.addWidget(self.crsLabel, 2, 1)
        grid.addWidget(buttons, 3, 0, 1, 2)

        self.setLayout(grid)

    def changeCRS(self):
        projSelector = QgsProjectionSelectionDialog()
        projSelector.exec_()
        self.crs = projSelector.crs()
        self.crsLabel.setText(self.crs.authid())

    def getPoint(self, crs):
        # fix_print_with_import
        print(crs)
        dialog = XYDialog()
        dialog.crs = crs
        dialog.crsLabel.setText(crs.authid())
        result = dialog.exec_()

        X = 0
        Y = 0
        if dialog.X.text().strip() and dialog.Y.text().strip():
            X = float(dialog.X.text())
            Y = float(dialog.Y.text())
        return ([QgsPointXY(X, Y), dialog.crs], result == QDialog.Accepted)
开发者ID:jeremyk6,项目名称:qdraw,代码行数:57,代码来源:drawtools.py


示例3: UserConfigDialog

class UserConfigDialog(QDialog):

    def __init__(self, parent = None):
        super(UserConfigDialog, self).__init__(parent)
        self.user = None
        self.email = None
        self.initGui()

    def initGui(self):
        self.setWindowTitle('GeoGig user configuration')
        verticalLayout = QVBoxLayout()

        horizontalLayout = QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        usernameLabel = QLabel('Username')
        self.usernameBox = QLineEdit()
        horizontalLayout.addWidget(usernameLabel)
        horizontalLayout.addWidget(self.usernameBox)
        verticalLayout.addLayout(horizontalLayout)

        horizontalLayout = QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        emailLabel = QLabel('User email')
        self.emailBox = QLineEdit()
        horizontalLayout.addWidget(emailLabel)
        horizontalLayout.addWidget(self.emailBox)
        verticalLayout.addLayout(horizontalLayout)

        self.groupBox = QGroupBox()
        self.groupBox.setTitle("User data")
        self.groupBox.setLayout(verticalLayout)

        layout = QVBoxLayout()
        layout.addWidget(self.groupBox)

        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        layout.addWidget(self.buttonBox)

        self.setLayout(layout)

        self.buttonBox.accepted.connect(self.okPressed)
        self.buttonBox.rejected.connect(self.cancelPressed)

        self.resize(400, 200)

    def okPressed(self):
        self.user = self.usernameBox.text()
        self.email = self.emailBox.text()
        self.close()

    def cancelPressed(self):
        self.user = None
        self.email = None
        self.close()
开发者ID:boundlessgeo,项目名称:qgis-geogiglight-plugin,代码行数:56,代码来源:userconfigdialog.py


示例4: __init__

 def __init__(self, parent, tree, providerName, param):
     QTreeWidgetItem.__init__(self, parent)
     self.providereName = providerName
     self.param = param
     self.tree = tree
     self.setText(0, param.description)
     self.paramName = settingName(providerName, param.name)
     if isinstance(param.defaultValue, bool):
         self.value = QSettings().value(self.paramName, defaultValue=param.defaultValue, type=bool)
         if self.value:
             self.setCheckState(1, Qt.Checked)
         else:
             self.setCheckState(1, Qt.Unchecked)
     elif isinstance(param.defaultValue, list):
         self.combo = QComboBox()
         for element in param.defaultValue:
             self.combo.addItem(element)
         self.tree.setItemWidget(self, 1, self.combo)
         self.value = QSettings().value(self.paramName, defaultValue=param.defaultValue[0])
         idx = self.combo.findText(self.value)
         self.combo.setCurrentIndex(idx)
     elif param.description == "Password":
         self.passwordField = QLineEdit()
         self.passwordField.setEchoMode(QLineEdit.Password);
         #self.passwordField.setStyleSheet("QLineEdit { border: none }");
         self.value = QSettings().value(self.paramName, defaultValue=param.defaultValue)
         self.passwordField.setText(str(self.value))
         self.tree.setItemWidget(self, 1, self.passwordField)
     elif param.action is not None:
         layout = QHBoxLayout()
         layout.setMargin(0)
         layout.setSpacing(0)
         self.textbox = QLineEdit()
         self.value = QSettings().value(self.paramName, defaultValue=param.defaultValue)
         self.textbox.setText(str(self.value))
         layout.addWidget(self.textbox)
         self.button = QToolButton()
         self.button.setText(param.actionText)
         self.button.clicked.connect(param.action)
         layout.addWidget(self.button)
         self.widget = QWidget()
         self.widget.setLayout(layout)
         self.tree.setItemWidget(self, 1, self.widget)
     else:
         self.textbox = QLineEdit()
         #self.textbox.setStyleSheet("QLineEdit { border: none }");
         self.tree.setItemWidget(self, 1, self.textbox)
         self.value = QSettings().value(self.paramName, defaultValue=param.defaultValue)
         self.textbox.setText(str(self.value))
开发者ID:boundlessgeo,项目名称:qgis-baselayers-plugin,代码行数:49,代码来源:configdialog.py


示例5: on_addMappingBtn_clicked

    def on_addMappingBtn_clicked(self):
        lastRow = self.attributeTable.rowCount()
        self.attributeTable.insertRow(lastRow)
        combo = QComboBox(self.attributeTable)
        combo.addItem("String", QVariant.String)
        combo.addItem("Integer", QVariant.Int)
        combo.addItem("Real", QVariant.Double)
        combo.addItem("Date/Time", QVariant.DateTime)
        self.attributeTable.setCellWidget(lastRow, 1, combo)

        lineEdit = QLineEdit(self.attributeTable)
        # exclude id, fid and _xml from allowed field names
        lineEdit.setValidator(QRegExpValidator(QRegExp("(?!(id|fid|_xml_)).*")))
        self.attributeTable.setCellWidget(lastRow, 0, lineEdit)

        self.attributeTable.setItem(lastRow, 2, QTableWidgetItem())
开发者ID:Oslandia,项目名称:gml_application_schema_toolbox,代码行数:16,代码来源:load_wizard_xml.py


示例6: setupUi

    def setupUi(self, PostNAS_SearchDialogBase):
        PostNAS_SearchDialogBase.setObjectName(_fromUtf8("PostNAS_SearchDialogBase"))
        PostNAS_SearchDialogBase.resize(501, 337)
        self.gridLayout = QGridLayout(PostNAS_SearchDialogBase)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.treeWidget = QTreeWidget(PostNAS_SearchDialogBase)
        self.treeWidget.setSelectionMode(QAbstractItemView.ExtendedSelection)
        self.treeWidget.setHeaderHidden(True)
        self.treeWidget.setObjectName(_fromUtf8("treeWidget"))
        self.treeWidget.headerItem().setText(0, _fromUtf8("1"))
        self.gridLayout.addWidget(self.treeWidget, 1, 0, 1, 3)
        self.lineEdit = QLineEdit(PostNAS_SearchDialogBase)
        self.lineEdit.setObjectName(_fromUtf8("lineEdit"))
        self.gridLayout.addWidget(self.lineEdit, 0, 0, 1, 3)
        self.showButton = QToolButton(PostNAS_SearchDialogBase)
        self.showButton.setEnabled(False)
        icon = QtGui.QIcon()
        icon.addPixmap(QPixmap(_fromUtf8(":/plugins/PostNAS_Search/search_16x16.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.showButton.setIcon(icon)
        self.showButton.setObjectName(_fromUtf8("showButton"))
        self.gridLayout.addWidget(self.showButton, 2, 2, 1, 1)
        self.resetButton = QToolButton(PostNAS_SearchDialogBase)
        self.resetButton.setEnabled(False)
        icon1 = QIcon()
        icon1.addPixmap(QtGui.QPixmap(_fromUtf8(":/plugins/PostNAS_Search/marker-delete.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        self.resetButton.setIcon(icon1)
        self.resetButton.setObjectName(_fromUtf8("resetButton"))
        self.gridLayout.addWidget(self.resetButton, 2, 1, 1, 1)

        self.retranslateUi(PostNAS_SearchDialogBase)
        QtCore.QMetaObject.connectSlotsByName(PostNAS_SearchDialogBase)
开发者ID:Kreis-Unna,项目名称:PostNAS_Search,代码行数:31,代码来源:PostNAS_SearchDialogBase.py


示例7: initGui

    def initGui(self):
        hlayout = QHBoxLayout()
        layout = QVBoxLayout()
        self.searchBox = QLineEdit()
        self.searchBox.returnPressed.connect(self.search)
        self.searchBox.setPlaceholderText("[Enter search string and press enter to search for maps]")
        hlayout.addWidget(self.searchBox)

        self.button = QToolButton()
        self.button.setText("Search")
        self.button.clicked.connect(self.search)
        self.button.adjustSize()
        self.searchBox.setFixedHeight(self.button.height())
        hlayout.addWidget(self.button)
        layout.addLayout(hlayout)

        w = QFrame()
        self.browser = QWebView()
        w.setStyleSheet("QFrame{border:1px solid rgb(0, 0, 0);}")
        innerlayout = QHBoxLayout()
        innerlayout.setSpacing(0)
        innerlayout.setMargin(0)
        innerlayout.addWidget(self.browser)
        w.setLayout(innerlayout)
        layout.addWidget(w)
        self.setLayout(layout)

        self.browser.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
        self.browser.settings().setUserStyleSheetUrl(QUrl("file://" + resourceFile("search.css").replace("\\", "/")))
        self.browser.linkClicked.connect(self.linkClicked)
        self.resize(600, 500)
        self.setWindowTitle("Search stories")
开发者ID:boundlessgeo,项目名称:qgis-mapstory-plugin,代码行数:32,代码来源:searchdialog.py


示例8: FileDirectorySelector

class FileDirectorySelector(QWidget):

    def __init__(self, parent=None, selectFile=False):
        QWidget.__init__(self, parent)

        # create gui
        self.btnSelect = QToolButton()
        self.btnSelect.setText('…')
        self.lineEdit = QLineEdit()
        self.hbl = QHBoxLayout()
        self.hbl.setMargin(0)
        self.hbl.setSpacing(0)
        self.hbl.addWidget(self.lineEdit)
        self.hbl.addWidget(self.btnSelect)

        self.setLayout(self.hbl)

        self.canFocusOut = False
        self.selectFile = selectFile

        self.setFocusPolicy(Qt.StrongFocus)
        self.btnSelect.clicked.connect(self.select)

    def select(self):
        lastDir = ''
        if not self.selectFile:
            selectedPath = QFileDialog.getExistingDirectory(None,
                                                            self.tr('Select directory'), lastDir,
                                                            QFileDialog.ShowDirsOnly)
        else:
            selectedPath, selected_filter = QFileDialog.getOpenFileName(None,
                                                                        self.tr('Select file'), lastDir, self.tr('All files (*.*)')
                                                                        )

        if not selectedPath:
            return

        self.lineEdit.setText(selectedPath)
        self.canFocusOut = True

    def text(self):
        return self.lineEdit.text()

    def setText(self, value):
        self.lineEdit.setText(value)
开发者ID:mj10777,项目名称:QGIS,代码行数:45,代码来源:ConfigDialog.py


示例9: RectangleDialog

class RectangleDialog(QDialog):
    crs = None

    def __init__(self):
        QDialog.__init__(self)

        self.setWindowTitle(tr('Rectangle size'))

        self.width = QLineEdit()
        self.height = QLineEdit()

        width_val = QDoubleValidator()
        height_val = QDoubleValidator()

        self.width.setValidator(width_val)
        self.height.setValidator(height_val)

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        grid = QGridLayout()
        grid.addWidget(QLabel(tr('Give a size in m:')), 0, 0)
        grid.addWidget(QLabel(tr('Width:')), 1, 0)
        grid.addWidget(QLabel(tr('Height:')), 1, 1)
        grid.addWidget(self.width, 2, 0)
        grid.addWidget(self.height, 2, 1)
        grid.addWidget(buttons, 3, 0, 1, 2)

        self.setLayout(grid)

    def getSize(self):
        dialog = RectangleDialog()
        result = dialog.exec_()

        width = 0
        height = 0
        if dialog.width.text().strip() and dialog.height.text().strip():
            width = float(dialog.width.text())
            height = float(dialog.height.text())
        return (width, height, result == QDialog.Accepted)
开发者ID:jeremyk6,项目名称:qdraw,代码行数:42,代码来源:drawtools.py


示例10: NewRemoteDialog

class NewRemoteDialog(QDialog):

    def __init__(self, name = None, url = None, parent = None):
        super(NewRemoteDialog, self).__init__(parent)
        self.ok = False
        self.name = name
        self.url = url
        self.initGui()

    def initGui(self):
        self.setWindowTitle('New connection')
        layout = QVBoxLayout()
        buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Close)

        horizontalLayout = QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        nameLabel = QLabel('Name')
        nameLabel.setMinimumWidth(120)
        nameLabel.setMaximumWidth(120)
        self.nameBox = QLineEdit()
        if self.name is not None:
            self.nameBox.setText(self.name)
        horizontalLayout.addWidget(nameLabel)
        horizontalLayout.addWidget(self.nameBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        urlLabel = QLabel('URL')
        urlLabel.setMinimumWidth(120)
        urlLabel.setMaximumWidth(120)
        self.urlBox = QLineEdit()
        if self.url is not None:
            self.urlBox.setText(self.url)
        horizontalLayout.addWidget(urlLabel)
        horizontalLayout.addWidget(self.urlBox)
        layout.addLayout(horizontalLayout)


        layout.addWidget(buttonBox)
        self.setLayout(layout)

        buttonBox.accepted.connect(self.okPressed)
        buttonBox.rejected.connect(self.cancelPressed)

        self.resize(400, 200)

    def okPressed(self):
        self.name = self.nameBox.text()
        self.url = self.urlBox.text()
        self.ok = True
        self.close()

    def cancelPressed(self):
        self.name = None
        self.url = None
        self.close()
开发者ID:boundlessgeo,项目名称:qgis-geogiglight-plugin,代码行数:59,代码来源:remotesdialog.py


示例11: initGui

    def initGui(self):
        self.setWindowTitle('New connection')
        layout = QVBoxLayout()
        buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Close)

        horizontalLayout = QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        nameLabel = QLabel('Name')
        nameLabel.setMinimumWidth(120)
        nameLabel.setMaximumWidth(120)
        self.nameBox = QLineEdit()
        if self.name is not None:
            self.nameBox.setText(self.name)
        horizontalLayout.addWidget(nameLabel)
        horizontalLayout.addWidget(self.nameBox)
        layout.addLayout(horizontalLayout)

        horizontalLayout = QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        urlLabel = QLabel('URL')
        urlLabel.setMinimumWidth(120)
        urlLabel.setMaximumWidth(120)
        self.urlBox = QLineEdit()
        if self.url is not None:
            self.urlBox.setText(self.url)
        horizontalLayout.addWidget(urlLabel)
        horizontalLayout.addWidget(self.urlBox)
        layout.addLayout(horizontalLayout)


        layout.addWidget(buttonBox)
        self.setLayout(layout)

        buttonBox.accepted.connect(self.okPressed)
        buttonBox.rejected.connect(self.cancelPressed)

        self.resize(400, 200)
开发者ID:boundlessgeo,项目名称:qgis-geogiglight-plugin,代码行数:39,代码来源:remotesdialog.py


示例12: initGui

    def initGui(self):
        self.setWindowTitle('GeoGig user configuration')
        verticalLayout = QVBoxLayout()

        horizontalLayout = QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        usernameLabel = QLabel('Username')
        self.usernameBox = QLineEdit()
        horizontalLayout.addWidget(usernameLabel)
        horizontalLayout.addWidget(self.usernameBox)
        verticalLayout.addLayout(horizontalLayout)

        horizontalLayout = QHBoxLayout()
        horizontalLayout.setSpacing(30)
        horizontalLayout.setMargin(0)
        emailLabel = QLabel('User email')
        self.emailBox = QLineEdit()
        horizontalLayout.addWidget(emailLabel)
        horizontalLayout.addWidget(self.emailBox)
        verticalLayout.addLayout(horizontalLayout)

        self.groupBox = QGroupBox()
        self.groupBox.setTitle("User data")
        self.groupBox.setLayout(verticalLayout)

        layout = QVBoxLayout()
        layout.addWidget(self.groupBox)

        self.buttonBox = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel)
        layout.addWidget(self.buttonBox)

        self.setLayout(layout)

        self.buttonBox.accepted.connect(self.okPressed)
        self.buttonBox.rejected.connect(self.cancelPressed)

        self.resize(400, 200)
开发者ID:boundlessgeo,项目名称:qgis-geogiglight-plugin,代码行数:38,代码来源:userconfigdialog.py


示例13: RefPanel

class RefPanel(QWidget):

    refChanged = pyqtSignal()

    def __init__(self, repo, ref = None):
        super(RefPanel, self).__init__(None)
        self.repo = repo
        self.ref = ref
        self.horizontalLayout = QHBoxLayout(self)
        self.horizontalLayout.setSpacing(2)
        self.horizontalLayout.setMargin(0)
        self.text = QLineEdit()
        self.text.setEnabled(False)
        if ref is not None:
            self.text.setText(ref.humantext())
        self.text.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
        self.horizontalLayout.addWidget(self.text)
        self.pushButton = QToolButton()
        self.pushButton.setText("...")
        self.pushButton.clicked.connect(self.showSelectionDialog)
        self.pushButton.setEnabled(self.repo is not None)
        self.horizontalLayout.addWidget(self.pushButton)
        self.setLayout(self.horizontalLayout)

    def showSelectionDialog(self):
        from geogig.gui.dialogs.historyviewer import HistoryViewerDialog
        dialog = HistoryViewerDialog(self.repo)
        dialog.exec_()
        ref = dialog.ref
        if ref:
            commit = Commit.fromref(self.repo, ref)
            self.setRef(commit)

    def setRepo(self, repo):
        self.repo = repo
        self.pushButton.setEnabled(True)
        self.setRef(Commitish(repo, repo.HEAD))

    def setRef(self, ref):
        self.ref = ref
        self.text.setText(ref.humantext())
        self.refChanged.emit()

    def getRef(self):
        return self.ref
开发者ID:boundlessgeo,项目名称:qgis-geogiglight-plugin,代码行数:45,代码来源:geogigref.py


示例14: __init__

    def __init__(self, iface, gtype):
        QDialog.__init__(self)

        self.setWindowTitle(self.tr('Drawing'))

        self.name = QLineEdit()

        if gtype == 'point' or gtype == 'XYpoint':
            gtype = 'Point'
        elif gtype == 'line':
            gtype = 'LineString'
        else:
            gtype = 'Polygon'

        # change here by QgsMapLayerComboBox()
        self.layerBox = QComboBox()
        self.layers = []
        for layer in QgsProject.instance().mapLayers().values():
            if layer.providerType() == "memory":
                # ligne suivante à remplacer par if layer.geometryType() == :
                if gtype in layer.dataProvider().dataSourceUri()[:26]: #  must be of the same type of the draw
                    if 'field='+self.tr('Drawings')+':string(255,0)' in layer.dataProvider().dataSourceUri()[-28:]: # must have its first field named Drawings, string type
                        self.layers.append(layer)
                        self.layerBox.addItem(layer.name())

        self.addLayer = QCheckBox(self.tr('Add to an existing layer'))
        self.addLayer.toggled.connect(self.addLayerChecked)

        buttons = QDialogButtonBox(
            QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
        buttons.accepted.connect(self.accept)
        buttons.rejected.connect(self.reject)

        vbox = QVBoxLayout()
        vbox.addWidget(QLabel(self.tr("Give a name to the feature:")))
        vbox.addWidget(self.name)
        vbox.addWidget(self.addLayer)
        vbox.addWidget(self.layerBox)
        if len(self.layers) == 0:
            self.addLayer.setEnabled(False)
            self.layerBox.setEnabled(False)
        vbox.addWidget(buttons)
        self.setLayout(vbox)

        self.layerBox.setEnabled(False)
        self.name.setFocus()
开发者ID:jeremyk6,项目名称:qdraw,代码行数:46,代码来源:qdrawlayerdialog.py


示例15: __init__

    def __init__(self, parent=None):
        QWidget.__init__(self, parent)

        # create gui
        self.btnSelect = QToolButton()
        self.btnSelect.setText('…')
        self.lineEdit = QLineEdit()
        self.hbl = QHBoxLayout()
        self.hbl.setMargin(0)
        self.hbl.setSpacing(0)
        self.hbl.addWidget(self.lineEdit)
        self.hbl.addWidget(self.btnSelect)

        self.setLayout(self.hbl)

        self.canFocusOut = False

        self.setFocusPolicy(Qt.StrongFocus)
        self.btnSelect.clicked.connect(self.select)
开发者ID:mj10777,项目名称:QGIS,代码行数:19,代码来源:ConfigDialog.py


示例16: __init__

 def __init__(self, repo, ref = None):
     super(RefPanel, self).__init__(None)
     self.repo = repo
     self.ref = ref
     self.horizontalLayout = QHBoxLayout(self)
     self.horizontalLayout.setSpacing(2)
     self.horizontalLayout.setMargin(0)
     self.text = QLineEdit()
     self.text.setEnabled(False)
     if ref is not None:
         self.text.setText(ref.humantext())
     self.text.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
     self.horizontalLayout.addWidget(self.text)
     self.pushButton = QToolButton()
     self.pushButton.setText("...")
     self.pushButton.clicked.connect(self.showSelectionDialog)
     self.pushButton.setEnabled(self.repo is not None)
     self.horizontalLayout.addWidget(self.pushButton)
     self.setLayout(self.horizontalLayout)
开发者ID:boundlessgeo,项目名称:qgis-geogiglight-plugin,代码行数:19,代码来源:geogigref.py


示例17: __init__

 def __init__(self, param, row, col, dialog):
     super(BatchInputSelectionPanel, self).__init__(None)
     self.param = param
     self.dialog = dialog
     self.row = row
     self.col = col
     self.horizontalLayout = QHBoxLayout(self)
     self.horizontalLayout.setSpacing(0)
     self.horizontalLayout.setMargin(0)
     self.text = QLineEdit()
     self.text.setObjectName("text")
     self.text.setMinimumWidth(300)
     self.setValue("")
     self.text.editingFinished.connect(self.textEditingFinished)
     self.text.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
     self.horizontalLayout.addWidget(self.text)
     self.pushButton = QPushButton()
     self.pushButton.setText("...")
     self.pushButton.clicked.connect(self.showPopupMenu)
     self.horizontalLayout.addWidget(self.pushButton)
     self.setLayout(self.horizontalLayout)
开发者ID:borysiasty,项目名称:QGIS,代码行数:21,代码来源:BatchInputSelectionPanel.py


示例18: __init__

 def __init__(self, param, row, col, panel):
     super(BatchInputSelectionPanel, self).__init__(None)
     self.param = param
     self.panel = panel
     self.table = self.panel.tblParameters
     self.row = row
     self.col = col
     self.horizontalLayout = QHBoxLayout(self)
     self.horizontalLayout.setSpacing(0)
     self.horizontalLayout.setMargin(0)
     self.text = QLineEdit()
     self.text.setMinimumWidth(300)
     self.text.setText('')
     self.text.setSizePolicy(QSizePolicy.Expanding,
                             QSizePolicy.Expanding)
     self.horizontalLayout.addWidget(self.text)
     self.pushButton = QPushButton()
     self.pushButton.setText('...')
     self.pushButton.clicked.connect(self.showPopupMenu)
     self.horizontalLayout.addWidget(self.pushButton)
     self.setLayout(self.horizontalLayout)
开发者ID:fritsvanveen,项目名称:QGIS,代码行数:21,代码来源:BatchInputSelectionPanel.py


示例19: __init__

 def __init__(self, output, alg, row, col, panel):
     super(BatchOutputSelectionPanel, self).__init__(None)
     self.alg = alg
     self.row = row
     self.col = col
     self.output = output
     self.panel = panel
     self.table = self.panel.tblParameters
     self.horizontalLayout = QHBoxLayout(self)
     self.horizontalLayout.setSpacing(2)
     self.horizontalLayout.setMargin(0)
     self.text = QLineEdit()
     self.text.setText('')
     self.text.setMinimumWidth(300)
     self.text.setSizePolicy(QSizePolicy.Expanding,
                             QSizePolicy.Expanding)
     self.horizontalLayout.addWidget(self.text)
     self.pushButton = QPushButton()
     self.pushButton.setText('…')
     self.pushButton.clicked.connect(self.showSelectionDialog)
     self.horizontalLayout.addWidget(self.pushButton)
     self.setLayout(self.horizontalLayout)
开发者ID:blazek,项目名称:QGIS,代码行数:22,代码来源:BatchOutputSelectionPanel.py


示例20: setupUi

 def setupUi(self):
     self.valueItems = {}
     self.dependentItems = {}
     self.resize(650, 450)
     self.buttonBox = QDialogButtonBox()
     self.buttonBox.setOrientation(Qt.Horizontal)
     self.buttonBox.setStandardButtons(QDialogButtonBox.Cancel
                                       | QDialogButtonBox.Ok)
     self.infoText = QTextEdit()
     numbers = self.getAvailableValuesOfType(ParameterNumber, OutputNumber)
     text = self.tr('You can refer to model values in your formula, using '
                    'single-letter variables, as follows:\n', 'CalculatorModelerParametersDialog')
     ichar = 97
     if numbers:
         for number in numbers:
             text += chr(ichar) + '->' + self.resolveValueDescription(number) + '\n'
             ichar += 1
     else:
         text += self.tr('\n - No numerical variables are available.', 'CalculatorModelerParametersDialog')
     self.infoText.setText(text)
     self.infoText.setEnabled(False)
     self.formulaText = QLineEdit()
     if hasattr(self.formulaText, 'setPlaceholderText'):
         self.formulaText.setPlaceholderText(self.tr('[Enter your formula here]', 'CalculatorModelerParametersDialog'))
     if self._algName is not None:
         alg = self.model.algs[self._algName]
         self.formulaText.setText(alg.params[FORMULA])
     self.setWindowTitle(self.tr('Calculator', 'CalculatorModelerParametersDialog'))
     self.verticalLayout = QVBoxLayout()
     self.verticalLayout.setSpacing(2)
     self.verticalLayout.setMargin(0)
     self.verticalLayout.addWidget(self.infoText)
     self.verticalLayout.addWidget(self.formulaText)
     self.verticalLayout.addWidget(self.buttonBox)
     self.setLayout(self.verticalLayout)
     self.buttonBox.accepted.connect(self.okPressed)
     self.buttonBox.rejected.connect(self.cancelPressed)
     QMetaObject.connectSlotsByName(self)
开发者ID:fritsvanveen,项目名称:QGIS,代码行数:38,代码来源:CalculatorModelerAlgorithm.py



注:本文中的qgis.PyQt.QtWidgets.QLineEdit类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python QtWidgets.QMenu类代码示例发布时间:2022-05-26
下一篇:
Python QtWidgets.QLabel类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap