当前位置: 首页>>代码示例>>Python>>正文


Python QDesktopServices.openUrl方法代码示例

本文整理汇总了Python中qgis.PyQt.QtGui.QDesktopServices.openUrl方法的典型用法代码示例。如果您正苦于以下问题:Python QDesktopServices.openUrl方法的具体用法?Python QDesktopServices.openUrl怎么用?Python QDesktopServices.openUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在qgis.PyQt.QtGui.QDesktopServices的用法示例。


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

示例1: open_map_features

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
 def open_map_features():
     """
     Open MapFeatures
     """
     desktop_service = QDesktopServices()
     desktop_service.openUrl(
         QUrl("http://wiki.openstreetmap.org/wiki/Mapfeatures"))
开发者ID:3liz,项目名称:QuickOSM,代码行数:9,代码来源:QuickOSMWidget.py

示例2: open_doc_overpass

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
 def open_doc_overpass():
     """
     Open Overpass's documentation
     """
     url = "http://wiki.openstreetmap.org/wiki/Overpass_API/Language_Guide"
     desktop_service = QDesktopServices()
     desktop_service.openUrl(QUrl(url))
开发者ID:3liz,项目名称:QuickOSM,代码行数:9,代码来源:query_dialog.py

示例3: openLink

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
 def openLink(self, url):
     if url.toString() == "log":
         self.close()
         logDock = iface.mainWindow().findChild(QDockWidget, 'MessageLog')
         logDock.show()
     else:
         QDesktopServices.openUrl(url)
开发者ID:cz172638,项目名称:QGIS,代码行数:9,代码来源:MessageDialog.py

示例4: openScriptFileExtEditor

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
 def openScriptFileExtEditor(self):
     tabWidget = self.tabEditorWidget.currentWidget()
     path = tabWidget.path
     import subprocess
     try:
         subprocess.Popen([os.environ['EDITOR'], path])
     except KeyError:
         QDesktopServices.openUrl(QUrl.fromLocalFile(path))
开发者ID:CS-SI,项目名称:QGIS,代码行数:10,代码来源:console.py

示例5: openHelp

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
    def openHelp(self):
        locale = QgsApplication.locale()

        if locale in ['uk']:
            QDesktopServices.openUrl(
                QUrl('https://github.com/alexbruy/photo2shape'))
        else:
            QDesktopServices.openUrl(
                QUrl('https://github.com/alexbruy/photo2shape'))
开发者ID:alexbruy,项目名称:photo2shape,代码行数:11,代码来源:aboutdialog.py

示例6: openHelp

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
    def openHelp(self):
        locale = QgsApplication.locale()

        if locale in ['uk']:
            QDesktopServices.openUrl(
                QUrl(self.home))
        else:
            QDesktopServices.openUrl(
                QUrl(self.home))
开发者ID:alexbruy,项目名称:qconsolidate,代码行数:11,代码来源:aboutdialog.py

示例7: exportAsPDF

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
    def exportAsPDF(self):

        paths = super().exportAsPDF()

        if self.isMulti:
            info = u"Les relevés ont été enregistrés dans le répertoire :\n%s\n\nOuvrir le dossier ?" % self.targetDir
            openFolder = QDesktopServices()
            openFolder.openUrl(QUrl('file:///%s' % self.targetDir))

        return paths
开发者ID:rldhont,项目名称:QgisCadastrePlugin,代码行数:12,代码来源:cadastre_export_dialog.py

示例8: showHelp

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
    def showHelp(self):
        """Shows the help page."""

        locale = QSettings().value('locale/userLocale')[0:2]
        help_file = self.plugin_dir + '/help/help_{}.html'.format(locale)

        if os.path.exists(help_file):
            QDesktopServices.openUrl(QUrl('file:///'+ help_file))
        else:
            QDesktopServices.openUrl(QUrl(
                'file:///'+ self.plugin_dir + '/help/help.html')
                )
开发者ID:DelazJ,项目名称:MapsPrinter,代码行数:14,代码来源:maps_printer.py

示例9: show_help

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
def show_help(message=None):
    """Open an help message in the user's browser

    :param message: An optional message object to display in the dialog.
    :type message: Message.Message
    """

    help_path = mktemp('.html')
    with open(help_path, 'wb+') as f:
        help_html = get_help_html(message)
        f.write(help_html.encode('utf8'))
        path_with_protocol = 'file://' + help_path
        QDesktopServices.openUrl(QUrl(path_with_protocol))
开发者ID:inasafe,项目名称:inasafe,代码行数:15,代码来源:help.py

示例10: openHelp

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
    def openHelp(self):
        overrideLocale = QSettings().value('locale/overrideFlag', False, bool)
        if not overrideLocale:
            locale = QLocale.system().name()[:2]
        else:
            locale = QSettings().value('locale/userLocale', '')

        if locale in ['uk']:
            QDesktopServices.openUrl(
                QUrl('https://github.com/alexbruy/qscatter'))
        else:
            QDesktopServices.openUrl(
                QUrl('https://github.com/alexbruy/qscatter'))
开发者ID:alexbruy,项目名称:qscatter,代码行数:15,代码来源:aboutdialog.py

示例11: run_sketch_line

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
    def run_sketch_line(network, ref):
        """
        Run an action with two values for sketchline

        @param network:network of the bus
        @type network:str
        @param ref:ref of the bus
        @type ref:str
        """
        if network == '' or ref == '':
            iface.messageBar().pushMessage(
                tr('Sorry, this field is empty for this entity.'),
                level=Qgis.Warning,
                duration=7)
        else:
            var = QDesktopServices()
            url = 'http://www.overpass-api.de/api/sketch-line?' \
                  'network=' + network + '&ref=' + ref
            var.openUrl(QUrl(url))
开发者ID:3liz,项目名称:QuickOSM,代码行数:21,代码来源:actions.py

示例12: __reportError

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
 def __reportError(self):
     body = ("Please provide any additional information here:\n\n\n"
             "If you encountered an upload error, if possible please attach a zip file containing a minimal extract of the dataset, as well as the QGIS project file.\n\n\n"
             "Technical information:\n%s\n\n"
             "Versions:\n"
             " QGIS: %s\n"
             " Python: %s\n"
             " OS: %s\n"
             " QGIS Cloud Plugin: %s\n\n"
             "Username: %s\n") % (
                 self.plainTextEdit.toPlainText(),
                 Qgis.QGIS_VERSION,
                 sys.version.replace("\n", " "),
                 platform.platform(),
                 self.metadata.version(),
                 self.username)
     url = QUrl()
     url.toEncoded("mailto:[email protected]?subject=%s&body=%s" % (
             urllib.parse.quote(self.windowTitle()),
             urllib.parse.quote(body)),
     )
     QDesktopServices.openUrl(url)
开发者ID:qgiscloud,项目名称:qgis-cloud-plugin,代码行数:24,代码来源:error_report_dialog.py

示例13: giveHelp

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
 def giveHelp(self):
     self.showInfo('Giving help')
     QDesktopServices.openUrl(QUrl.fromLocalFile(
                      self.plugin_dir + "/help/html/index.html"))
开发者ID:havatv,项目名称:qgisstandarddeviationalellipseplugin,代码行数:6,代码来源:SDEllipse_dialog.py

示例14: openResult

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
 def openResult(self, item, column):
     QDesktopServices.openUrl(QUrl.fromLocalFile(item.filename))
开发者ID:rouault,项目名称:Quantum-GIS,代码行数:4,代码来源:ResultsDock.py

示例15: openLink

# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
 def openLink(self, url):
     QDesktopServices.openUrl(url)
开发者ID:rouault,项目名称:Quantum-GIS,代码行数:4,代码来源:ResultsDock.py


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