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

Python QtWidgets.QDialog类代码示例

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

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



在下文中一共展示了QDialog类的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: accept

    def accept(self):
        styles = {}
        for key in self.valueItems.keys():
            styles[key] = unicode(self.valueItems[key].getValue())
        RenderingStyles.addAlgStylesAndSave(self.alg.commandLineName(), styles)

        QDialog.accept(self)
开发者ID:AM7000000,项目名称:QGIS,代码行数:7,代码来源:EditRenderingStylesDialog.py


示例3: __init__

 def __init__(self, alg, paramType=None, param=None):
     self.alg = alg
     self.paramType = paramType
     self.param = param
     QDialog.__init__(self)
     self.setModal(True)
     self.setupUi()
开发者ID:rskelly,项目名称:QGIS,代码行数:7,代码来源:ModelerParameterDefinitionDialog.py


示例4: __init__

    def __init__(self, parent=None, table=None, db=None):
        QDialog.__init__(self, parent)
        self.table = table
        self.db = self.table.database() if self.table and self.table.database() else db
        self.setupUi(self)

        self.buttonBox.accepted.connect(self.createGeomColumn)
开发者ID:GeoCat,项目名称:QGIS,代码行数:7,代码来源:dlg_add_geometry_column.py


示例5: show

 def show(self):
     QDialog.show(self)
     self.setWindowModality(0)
     if self.firstShow:
          inet = internet_on(proxyUrl=self.proxy, timeout=self.timeout)
          #filters
          if inet:
             self.poiThemes = dict( self.poi.listPoiThemes() )
             poiThemes = [""] + list(self.poiThemes.keys())
             poiThemes.sort()
             self.ui.filterPoiThemeCombo.addItems( poiThemes )
             self.poiCategories = dict( self.poi.listPoiCategories() )
             poiCategories = [""] + list(self.poiCategories.keys())
             poiCategories.sort()
             self.ui.filterPoiCategoryCombo.addItems( poiCategories )
             self.poiTypes = dict( self.poi.listPoitypes() )
             poiTypes = [""] + list(self.poiTypes.keys())
             poiTypes.sort()
             self.ui.filterPoiTypeCombo.addItems(  poiTypes )
             gemeentes = json.load( open(os.path.join(os.path.dirname(__file__), "data/gemeentenVL.json")) )
             self.NIScodes= { n["Naam"] : n["Niscode"] for n in gemeentes }
             gemeenteNamen = [n["Naam"] for n in gemeentes]
             gemeenteNamen.sort()
             self.ui.filterPoiNIS.addItems( gemeenteNamen )            
             #connect when inet on
             self.ui.filterPoiThemeCombo.activated.connect(self.onThemeFilterChange)
             self.ui.filterPoiCategoryCombo.activated.connect(self.onCategorieFilterChange)
             
             self.firstShow = False      
          else:
             self.bar.pushMessage(
               QCoreApplication.translate("geopunt4QgisPoidialog", "Waarschuwing "), 
               QCoreApplication.translate("geopunt4QgisPoidialog", "Kan geen verbing maken met het internet."), 
               level=Qgis.Warning, duration=3)
开发者ID:warrieka,项目名称:geopunt4Qgis,代码行数:34,代码来源:geopunt4QgisPoidialog.py


示例6: __init__

    def __init__(self, table, parent=None):
        QDialog.__init__(self, parent)
        self.table = table
        self.setupUi(self)

        self.db = self.table.database()

        m = TableFieldsModel(self)
        self.viewFields.setModel(m)

        m = TableConstraintsModel(self)
        self.viewConstraints.setModel(m)

        m = TableIndexesModel(self)
        self.viewIndexes.setModel(m)

        self.btnAddColumn.clicked.connect(self.addColumn)
        self.btnAddGeometryColumn.clicked.connect(self.addGeometryColumn)
        self.btnEditColumn.clicked.connect(self.editColumn)
        self.btnDeleteColumn.clicked.connect(self.deleteColumn)

        self.btnAddConstraint.clicked.connect(self.addConstraint)
        self.btnDeleteConstraint.clicked.connect(self.deleteConstraint)

        self.btnAddIndex.clicked.connect(self.createIndex)
        self.btnAddSpatialIndex.clicked.connect(self.createSpatialIndex)
        self.btnDeleteIndex.clicked.connect(self.deleteIndex)

        self.populateViews()
        self.checkSupports()
开发者ID:AM7000000,项目名称:QGIS,代码行数:30,代码来源:dlg_table_properties.py


示例7: accept

    def accept(self):
        layer = self.get_current_layer()
        label = self.autoLabelCheckBox.isChecked()
        layerout = self.layerNameLine.text()
        self.UnitsComboBox.setCurrentIndex(self.UnitsComboBox.findData(layer.crs().mapUnits()))
        distance = self.distanceSpinBox.value()
        startpoint = self.startSpinBox.value()
        endpoint = self.endSpinBox.value()
        selected_only = self.selectOnlyRadioBtn.isChecked()
        force = self.forceLastCheckBox.isChecked()
        fo_fila = self.force_fl_CB.isChecked()
        divide = self.divideSpinBox.value()
        decimal = self.decimalSpinBox.value()

        projection_setting_key = "Projections/defaultBehaviour"
        old_projection_setting = self.qgisSettings.value(projection_setting_key)
        self.qgisSettings.setValue(projection_setting_key, "useGlobal")
        self.qgisSettings.sync()

        points_along_line(
            layerout,
            startpoint,
            endpoint,
            distance,
            label,
            layer,
            selected_only,
            force,
            fo_fila,
            divide,
            decimal)
        self.qgisSettings.setValue(projection_setting_key, old_projection_setting)
        QDialog.accept(self)
开发者ID:mach0,项目名称:qchainage,代码行数:33,代码来源:qchainagedialog.py


示例8: __init__

    def __init__(self):
        """Constructor for the dialog.
        
        """

        QDialog.__init__(self)                               
                        
        self.setupUi(self)

        self.comboBox.addItem('ESRI shape file')
        self.comboBox.addItem('Comma separated value (CSV)')
        self.comboBox.addItem('SQLite database')
        self.comboBox.addItem('Copy complete database')
        # self.comboBox.addItem('INSPIRE')
        self.comboBox.currentIndexChanged.connect(self.seler)

        self.comboBox_2.addItem(';')
        self.comboBox_2.addItem(',')
        self.comboBox_2.addItem('tab')

        self.tabWidget.setTabEnabled(0, False)
        self.tabWidget.setTabEnabled(1, False)

        self.seler()

        self.toolButton.clicked.connect(self.filer)
开发者ID:IZSVenezie,项目名称:VetEpiGIS-Tool,代码行数:26,代码来源:export.py


示例9: __init__

	def __init__(self, parent=None):
		QDialog.__init__(self, parent)
		self.setupUi(self)

		self.titleBoldBtn.hide()
		self.titleItalicBtn.hide()
		self.labelsBoldBtn.hide()
		self.labelsItalicBtn.hide()

		# remove fonts matplotlib doesn't load
		for index in range(self.titleFontCombo.count()-1, -1, -1):
			found = False
			family = unicode( self.titleFontCombo.itemText( index ) )
			try:
				props = self.findFont( {'family':family} )
				if family == props['family']:
					found = True
			except Exception:
				pass
			if not found:
				self.titleFontCombo.removeItem( index )
				self.labelsFontCombo.removeItem( index )

		self.initProps()

		self.titleColorBtn.clicked.connect(self.chooseTitleColor)
		self.labelsColorBtn.clicked.connect(self.chooseLabelsColor)
		self.pointsColorBtn.clicked.connect(self.choosePointsColor)
		self.pointsReplicasColorBtn.clicked.connect(self.choosePointsReplicasColor)
		self.linesColorBtn.clicked.connect(self.chooseLinesColor)
		self.linesThrendColorBtn.clicked.connect(self.chooseLinesThrendColor)
开发者ID:faunalia,项目名称:ps-speed,代码行数:31,代码来源:graph_settings_dialog.py


示例10: __init__

 def __init__(self, model):
     QDialog.__init__(self)
     # Set up the user interface from Designer.
     self.ui = uic.loadUi(ui_file, self)
     self.resultModel = model
     self.constraintTableView.setModel(self.resultModel)
     self.constraintTableView.resizeColumnsToContents()
开发者ID:lutraconsulting,项目名称:qgis-constraint-checker-plugin,代码行数:7,代码来源:constraint_results_dialog.py


示例11: __init__

    def __init__(self, iface):
        QDialog.__init__(self, iface.mainWindow())
        self.iface = iface
        # Set up the user interface from Designer.
        self.setupUi(self)
                
        self.populateLayers()
        
        spaced_distance_list = ['1','2','3','4','5']        
        self.spaced_pts_comboBox.clear()
        for distance in spaced_distance_list:
            self.spaced_pts_comboBox.addItem(distance)
        self.spaced_pts_comboBox.setEnabled(False)
        
        self.middle_pts_radioButton.setChecked(1)
        self.spaced_pts_radioButton.setChecked(0)
        
        self.middle_pts_radioButton.toggled.connect(self.method_update)
        self.spaced_pts_radioButton.toggled.connect(self.method_update)

        self.receiver_layer_pushButton.clicked.connect(self.outFile)        
        self.buttonBox = self.buttonBox.button( QDialogButtonBox.Ok )


        self.progressBar.setValue(0)
开发者ID:Arpapiemonte,项目名称:openoise,代码行数:25,代码来源:do_CreateReceiverPoints.py


示例12: __init__

 def __init__(self, repo, layer=None):
     self.repo = repo
     self.layer = layer
     self.ref = None
     QDialog.__init__(self, config.iface.mainWindow(),
                            Qt.WindowSystemMenuHint | Qt.WindowTitleHint)
     execute(self.initGui)
开发者ID:boundlessgeo,项目名称:qgis-geogiglight-plugin,代码行数:7,代码来源:historyviewer.py


示例13: __init__

    def __init__(self, parent):
        QDialog.__init__(self, parent)
        self.setWindowTitle(QCoreApplication.translate("SettingsDialogPythonConsole", "Settings Python Console"))
        self.parent = parent
        self.setupUi(self)

        self.listPath = []
        self.lineEdit.setReadOnly(True)

        self.restoreSettings()
        self.initialCheck()

        self.addAPIpath.setIcon(QIcon(":/images/themes/default/symbologyAdd.svg"))
        self.addAPIpath.setToolTip(QCoreApplication.translate("PythonConsole", "Add API path"))
        self.removeAPIpath.setIcon(QIcon(":/images/themes/default/symbologyRemove.svg"))
        self.removeAPIpath.setToolTip(QCoreApplication.translate("PythonConsole", "Remove API path"))

        self.preloadAPI.stateChanged.connect(self.initialCheck)
        self.addAPIpath.clicked.connect(self.loadAPIFile)
        self.removeAPIpath.clicked.connect(self.removeAPI)
        self.compileAPIs.clicked.connect(self._prepareAPI)

        self.resetFontColor.setIcon(QIcon(":/images/themes/default/console/iconResetColorConsole.png"))
        self.resetFontColor.setIconSize(QSize(18, 18))
        self.resetFontColorEditor.setIcon(QIcon(":/images/themes/default/console/iconResetColorConsole.png"))
        self.resetFontColorEditor.setIconSize(QSize(18, 18))
        self.resetFontColor.clicked.connect(self._resetFontColor)
        self.resetFontColorEditor.clicked.connect(self._resetFontColorEditor)
开发者ID:AM7000000,项目名称:QGIS,代码行数:28,代码来源:console_settings.py


示例14: __init__

    def __init__(self, iface,layer_name):
        QDialog.__init__(self, iface.mainWindow())
        self.iface = iface
        # Set up the user interface from Designer.
        self.setupUi(self)

        self.layer_name = layer_name
        
        # start definition
        self.POWER_P_emission_comboBoxes_dict = {'POWER_P_gen' : self.POWER_P_L_gen_comboBox, 
                                    'POWER_P_day' : self.POWER_P_L_day_comboBox, 
                                    'POWER_P_eve' : self.POWER_P_L_eve_comboBox, 
                                    'POWER_P_nig' : self.POWER_P_L_nig_comboBox
                                    }

        self.all_emission_comboBoxes = [self.POWER_P_L_gen_comboBox, self.POWER_P_L_day_comboBox, self.POWER_P_L_eve_comboBox, self.POWER_P_L_nig_comboBox]
           
        self.source_checkBoxes = [self.POWER_P_L_gen_checkBox,self.POWER_P_L_day_checkBox,self.POWER_P_L_eve_checkBox,self.POWER_P_L_nig_checkBox]
           
        self.source_POWER_P_period_checkBoxes = [self.POWER_P_L_day_checkBox,self.POWER_P_L_eve_checkBox,self.POWER_P_L_nig_checkBox]
        # end definitions        
        
        self.source_fields_update() 

        for source_checkBox in self.source_checkBoxes:
            source_checkBox.setChecked(0)
            source_checkBox.toggled.connect(self.source_checkBox_update)
            
        self.POWER_P_L_gen_checkBox.toggled.connect(self.source_checkBox_update)
        
        self.setToolTips()
        
        self.reload_settings()
开发者ID:Arpapiemonte,项目名称:openoise,代码行数:33,代码来源:do_SourceDetailsPts.py


示例15: __init__

    def __init__(self, inLayer, outDb, outUri, parent=None):
        QDialog.__init__(self, parent)
        self.inLayer = inLayer
        self.db = outDb
        self.outUri = outUri
        self.setupUi(self)

        supportCom = self.db.supportsComment()
        if not supportCom:
            self.chkCom.setVisible(False)
            self.editCom.setVisible(False)

        self.default_pk = "id"
        self.default_geom = "geom"

        self.mode = self.ASK_FOR_INPUT_MODE if self.inLayer is None else self.HAS_INPUT_MODE

        # used to delete the inlayer whether created inside this dialog
        self.inLayerMustBeDestroyed = False

        self.populateSchemas()
        self.populateTables()
        self.populateLayers()
        self.populateEncodings()

        # updates of UI
        self.setupWorkingMode(self.mode)
        self.cboSchema.currentIndexChanged.connect(self.populateTables)
        self.widgetSourceSrid.setCrs(QgsProject.instance().crs())
        self.widgetTargetSrid.setCrs(QgsProject.instance().crs())
        self.updateInputLayer()
开发者ID:alexbruy,项目名称:QGIS,代码行数:31,代码来源:dlg_import_vector.py


示例16: __init__

    def __init__(self, title, message, errors, username, parent=None):
        QDialog.__init__(self, parent)
        self.setWindowTitle(title)

        self.verticalLayout = QVBoxLayout(self)

        self.label = QLabel(message, self)
        self.verticalLayout.addWidget(self.label)

        self.plainTextEdit = QPlainTextEdit(self)
        self.plainTextEdit.setPlainText(errors)
        self.plainTextEdit.setReadOnly(True)
        self.verticalLayout.addWidget(self.plainTextEdit)

        self.buttonBox = QDialogButtonBox(self)
        self.buttonBox.setOrientation(Qt.Horizontal)
        self.buttonBox.setStandardButtons(QDialogButtonBox.Close)
        self.verticalLayout.addWidget(self.buttonBox)
        self.reportButton = self.buttonBox.addButton(self.tr("Report error"), QDialogButtonBox.ActionRole)

        self.reportButton.clicked.connect(self.__reportError)
        self.buttonBox.accepted.connect(self.accept)
        self.buttonBox.rejected.connect(self.reject)

        self.username = username
        self.metadata = MetaData()
开发者ID:qgiscloud,项目名称:qgis-cloud-plugin,代码行数:26,代码来源:error_report_dialog.py


示例17: __init__

    def __init__(self, iface):

        self.supportedPaperSizes = ['A0', 'A1', 'A2', 'A3', 'A4', 'A5', 'A6', 'A7', 'A8']  # ISO A series
        self.paperSizesPresent = []
        self.presetScales = ['200', '500', '1 000', '1 250', '2 500', '5 000', '10 000', '25 000', '50 000', '100 000']

        self.iface = iface
        QDialog.__init__(self)
        # Set up the user interface from Designer.
        self.ui = uic.loadUi(ui_file, self)

        # Set up the list of templates
        s = QtCore.QSettings()
        self.identifiable_only = s.value("SelectorTools/ProjectSelector/identifiableOnly", True, type=bool)
        self.templateFileRoot = s.value("SelectorTools/TemplateSelector/templateRoot", '', type=str)
        if len(self.templateFileRoot) == 0 or not os.path.isdir(self.templateFileRoot):
            raise TemplateSelectorException('\'%s\' is not a valid template file root folder.' % self.templateFileRoot)
        self.populateTemplateTypes()
        self.populatePoiLayers()
        self.onPoiLayerChanged()

        self.onTemplateTypeChanged()
        self.plugin_dir = os.path.dirname(__file__)

        # Replacement map
        self.ui.suitableForComboBox.addItem('<custom>')
        self.user = os.environ.get('username', '[user]')
        self.replaceMap = {
            'author': "Compiled by {} on [%concat(day($now ),'/',month($now),'/',year($now))%]".format(self.user)
        }
        self.ui.autofit_btn.clicked.connect(self.autofit_map)
        self.ui.suitableForComboBox.currentIndexChanged.connect(self.specify_dpi)
        self.ui.suitableForComboBox.editTextChanged.connect(self.text_changed)
        self.ui.poiLayerComboBox.currentIndexChanged.connect(self.onPoiLayerChanged)
开发者ID:lutraconsulting,项目名称:qgis-moor-tools-plugin,代码行数:34,代码来源:templateselectordialog.py


示例18: reject

 def reject(self):
     #QMessageBox.warning(self.iface.mainWindow(), "VoGIS-Profiltool", "REJECTED")
     QgsMessageLog.logMessage("reject: {0}".format(self.exaggeration_edited), "VoGis", Qgis.Info)
     if self.exaggeration_edited is True:
         self.exaggeration_edited = False
         return
     QDialog.reject(self)
开发者ID:BergWerkGIS,项目名称:VoGIS-Profil-Tool,代码行数:7,代码来源:vogisprofiltoolplot.py


示例19: __init__

    def __init__(self, iface):
        QDialog.__init__(self, iface.mainWindow())
        self.setAttribute(Qt.WA_DeleteOnClose)
        self.iface = iface
        self.setupUi(self)

        # binaries
        self.leGdalBinPath.setText(Utils.getGdalBinPath())
        self.btnSetBinPath.clicked.connect(self.setBinPath)
        self.bin_tooltip_label.setPixmap(QPixmap(':/icons/tooltip.png'))
        self.bin_tooltip_label.setToolTip(self.tr(u"""\
A list of colon-separated (Linux and MacOS) or
semicolon-separated (Windows) paths to both binaries
and python executables.

MacOS users usually need to set it to something like
/Library/Frameworks/GDAL.framework/Versions/1.8/Programs"""))

        # python modules
        self.leGdalPymodPath.setText(Utils.getGdalPymodPath())
        self.btnSetPymodPath.clicked.connect(self.setPymodPath)
        self.pymod_tooltip_label.setPixmap(QPixmap(':/icons/tooltip.png'))
        self.pymod_tooltip_label.setToolTip(self.tr(u"""\
A list of colon-separated (Linux and MacOS) or
semicolon-separated (Windows) paths to python modules."""))

        # help
        self.leGdalHelpPath.setText(Utils.getHelpPath())
        self.btnSetHelpPath.clicked.connect(self.setHelpPath)
        self.help_tooltip_label.setPixmap(QPixmap(':/icons/tooltip.png'))
        self.help_tooltip_label.setToolTip(self.tr(u"""\
Useful to open local GDAL documentation instead of online help
when pressing on the tool dialog's Help button."""))
开发者ID:naihil,项目名称:QGIS,代码行数:33,代码来源:doSettings.py


示例20: __init__

    def __init__(self, parent, plugin):
        QDialog.__init__(self, parent)
        self.setupUi(self)
        self.plugin = plugin
        self.mResult = ""
        self.progressBar.setRange(0, 0)
        self.progressBar.setFormat("%p%")
        self.labelName.setText(plugin["name"])
        self.buttonBox.clicked.connect(self.abort)

        url = QUrl(plugin["download_url"])

        fileName = plugin["filename"]
        tmpDir = QDir.tempPath()
        tmpPath = QDir.cleanPath(tmpDir + "/" + fileName)
        self.file = QFile(tmpPath)

        self.request = QNetworkRequest(url)
        authcfg = repositories.all()[plugin["zip_repository"]]["authcfg"]
        if authcfg and isinstance(authcfg, str):
            if not QgsAuthManager.instance().updateNetworkRequest(
                    self.request, authcfg.strip()):
                self.mResult = self.tr(
                    "Update of network request with authentication "
                    "credentials FAILED for configuration '{0}'").format(authcfg)
                self.request = None

        if self.request is not None:
            self.reply = QgsNetworkAccessManager.instance().get(self.request)
            self.reply.downloadProgress.connect(self.readProgress)
            self.reply.finished.connect(self.requestFinished)

            self.stateChanged(4)
开发者ID:GeoCat,项目名称:QGIS,代码行数:33,代码来源:qgsplugininstallerinstallingdialog.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python QtWidgets.QDialogButtonBox类代码示例发布时间:2022-05-26
下一篇:
Python QtWidgets.QComboBox类代码示例发布时间: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