本文整理汇总了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"))
示例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))
示例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)
示例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))
示例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'))
示例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))
示例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
示例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')
)
示例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))
示例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'))
示例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))
示例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)
示例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"))
示例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))
示例15: openLink
# 需要导入模块: from qgis.PyQt.QtGui import QDesktopServices [as 别名]
# 或者: from qgis.PyQt.QtGui.QDesktopServices import openUrl [as 别名]
def openLink(self, url):
QDesktopServices.openUrl(url)