本文整理汇总了Python中qgis.core.QgsApplication.reportStyleSheet方法的典型用法代码示例。如果您正苦于以下问题:Python QgsApplication.reportStyleSheet方法的具体用法?Python QgsApplication.reportStyleSheet怎么用?Python QgsApplication.reportStyleSheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.core.QgsApplication
的用法示例。
在下文中一共展示了QgsApplication.reportStyleSheet方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from qgis.core import QgsApplication [as 别名]
# 或者: from qgis.core.QgsApplication import reportStyleSheet [as 别名]
def __init__(self, parent=None, iface = None):
"""Constructor
:param parent: Parent object
:type parent: QWidget
:param iface: A QGIS interface instance.
:type iface: QgsInterface
"""
super(SOSClientDialog, self).__init__(parent)
settings = QtCore.QSettings ()
self.iface = iface
self.reply = None
self.service = None
self.filterRequest = None
self.createTimeManagerLayer = False
self.addLayerToTimeManager = lambda *a,**k: None
# Set up the user interface from Designer.
self.setupUi(self)
#Ayuda
self.btnBox.helpRequested.connect(lambda: showPluginHelp(filename="help/index"))
# Botón Añadir y Editar y añadir
self.btnAdd.setDefaultAction (self.actionAdd)
self.btnAdd.addAction(self.actionEditRequest)
self.btnBox.addButton(self.btnAdd, QtGui.QDialogButtonBox.ActionRole)
self.btnAdd.setEnabled(False)
#Guardar y cargar lista de servidores
self.btnSave.setVisible (False)
self.btnLoad.setVisible (False)
#Visor de información del servidor
self.htmlView.document().setDefaultStyleSheet(QgsApplication.reportStyleSheet())
self.htmlView.customContextMenuRequested.connect (lambda point, widget=self.htmlView, actions = [self.actionShowXML]: addContextMenuActions (point,widget, actions))
#Acciones de selección para listas
self.lstProperties.addAction(self.actionSelectAllProperties)
self.lstProperties.addAction(self.actionSelectNoneProperties)
self.lstProperties.addAction(self.actionSelectInvertProperties)
self.lstFeatures.addAction(self.actionSelectAllFeatures)
self.lstFeatures.addAction(self.actionSelectNoneFeatures)
self.lstFeatures.addAction(self.actionSelectInvertFeatures)
self.lstProcedures.addAction(self.actionSelectAllProcedures)
self.lstProcedures.addAction(self.actionSelectNoneProcedures)
self.lstProcedures.addAction(self.actionSelectInvertProcedures)
#Filtros
self.grpFilterSpatial.setEnabled (False)
self.lblSpatialFilterWarning.setVisible (False)
self.grpFilterTemporal.setEnabled (False)
self.grpFilterScalar.setEnabled (False)
#Listar conexiones
self.populateConnectionList ()
#Directorio de trabajo
self.workDirName.setText(settings.value("SOSClient/workDir", QtCore.QDir.tempPath(), type=str))
self.workDirName.textChanged.connect (lambda value : settings.setValue("SOSClient/workDir", value))
示例2: show_xml
# 需要导入模块: from qgis.core import QgsApplication [as 别名]
# 或者: from qgis.core.QgsApplication import reportStyleSheet [as 别名]
def show_xml(self):
"""show XML request / response"""
crd = XMLDialog()
request_html = highlight_xml(self.context, self.catalog.request)
response_html = highlight_xml(self.context, self.catalog.response)
style = QgsApplication.reportStyleSheet()
crd.txtbrXMLRequest.clear()
crd.txtbrXMLResponse.clear()
crd.txtbrXMLRequest.document().setDefaultStyleSheet(style)
crd.txtbrXMLResponse.document().setDefaultStyleSheet(style)
crd.txtbrXMLRequest.setHtml(request_html)
crd.txtbrXMLResponse.setHtml(response_html)
crd.exec_()
示例3: show_metadata
# 需要导入模块: from qgis.core import QgsApplication [as 别名]
# 或者: from qgis.core.QgsApplication import reportStyleSheet [as 别名]
def show_metadata(self):
"""show record metadata"""
if not self.treeRecords.selectedItems():
return
item = self.treeRecords.currentItem()
if not item:
return
identifier = get_item_data(item, 'identifier')
try:
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
cat = CatalogueServiceWeb(self.catalog_url, timeout=self.timeout,
username=self.catalog_username,
password=self.catalog_password)
cat.getrecordbyid(
[self.catalog.records[identifier].identifier])
except ExceptionReport as err:
QApplication.restoreOverrideCursor()
QMessageBox.warning(self, self.tr('GetRecords error'),
self.tr('Error getting response: {0}').format(err))
return
except KeyError as err:
QMessageBox.warning(self,
self.tr('Record parsing error'),
self.tr('Unable to locate record identifier'))
QApplication.restoreOverrideCursor()
return
QApplication.restoreOverrideCursor()
record = cat.records[identifier]
record.xml_url = cat.request
crd = RecordDialog()
metadata = render_template('en', self.context,
record, 'record_metadata_dc.html')
style = QgsApplication.reportStyleSheet()
crd.textMetadata.document().setDefaultStyleSheet(style)
crd.textMetadata.setHtml(metadata)
crd.exec_()
示例4: connection_info
# 需要导入模块: from qgis.core import QgsApplication [as 别名]
# 或者: from qgis.core.QgsApplication import reportStyleSheet [as 别名]
def connection_info(self):
"""show connection info"""
current_text = self.cmbConnectionsServices.currentText()
key = '/MetaSearch/%s' % current_text
self.catalog_url = self.settings.value('%s/url' % key)
# connect to the server
if not self._get_csw():
return
QApplication.restoreOverrideCursor()
if self.catalog: # display service metadata
self.btnCapabilities.setEnabled(True)
metadata = render_template('en', self.context,
self.catalog,
'service_metadata.html')
style = QgsApplication.reportStyleSheet()
self.textMetadata.clear()
self.textMetadata.document().setDefaultStyleSheet(style)
self.textMetadata.setHtml(metadata)