本文整理汇总了Python中qgis.PyQt.QtCore.qVersion方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.qVersion方法的具体用法?Python QtCore.qVersion怎么用?Python QtCore.qVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.PyQt.QtCore
的用法示例。
在下文中一共展示了QtCore.qVersion方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from qgis.PyQt import QtCore [as 别名]
# 或者: from qgis.PyQt.QtCore import qVersion [as 别名]
def __init__(self, iface):
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QSettings().value("locale/userLocale")[0:2]
localePath = os.path.join(self.plugin_dir, 'i18n', 'opeNoise_{}.qm'.format(locale))
if os.path.exists(localePath):
self.translator = QTranslator()
self.translator.load(localePath)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
# noinspection PyMethodMayBeStatic
示例2: __init__
# 需要导入模块: from qgis.PyQt import QtCore [as 别名]
# 或者: from qgis.PyQt.QtCore import qVersion [as 别名]
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize processing provider
self.provider = DataPlotlyProvider(plugin_version=DataPlotly.VERSION)
# initialize locale
locale = QSettings().value('locale/userLocale', 'en_US')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'DataPlotly_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
self.dock_widget = None
self.show_dock_action = None
self.menu = None
self.toolbar = None
self.plot_item_metadata = PlotLayoutItemMetadata()
self.plot_item_gui_metadata = None
QgsApplication.layoutItemRegistry().addLayoutItemType(self.plot_item_metadata)
# noinspection PyMethodMayBeStatic
示例3: __init__
# 需要导入模块: from qgis.PyQt import QtCore [as 别名]
# 或者: from qgis.PyQt.QtCore import qVersion [as 别名]
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'GoogleEarthEnginePlugin_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
self.menu_name_plugin = self.tr("Google Earth Engine Plugin")
# Create and register the ee data provider
provider.register_data_provider()
# noinspection PyMethodMayBeStatic
示例4: __init__
# 需要导入模块: from qgis.PyQt import QtCore [as 别名]
# 或者: from qgis.PyQt.QtCore import qVersion [as 别名]
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'DsgTools_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
# Create the dialog (after translation) and keep reference
# Declare instance attributes
self.actions = []
self.menu = '&DSGTools'
self.toolbar = self.iface.addToolBar(u'DsgTools')
self.toolbar.setObjectName(u'DsgTools')
self.dsgTools = None
self.menuBar = self.iface.mainWindow().menuBar()
self.provider = DSGToolsProcessingAlgorithmProvider()
# noinspection PyMethodMayBeStatic
示例5: __init__
# 需要导入模块: from qgis.PyQt import QtCore [as 别名]
# 或者: from qgis.PyQt.QtCore import qVersion [as 别名]
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgisInterface
"""
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'HydroSEDPlugin_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
# Declare instance attributes
self.actions = []
self.menu = self.tr(u'&Hydro-SED')
# TODO: We are going to let the user set this up in a future iteration
self.toolbar = self.iface.addToolBar(u'HydroSEDPlugin')
self.toolbar.setObjectName(u'HydroSEDPlugin')
#print "** INITIALIZING HydroSEDPlugin"
self.pluginIsActive = False
self.dockwidget = None
# noinspection PyMethodMayBeStatic
示例6: __init__
# 需要导入模块: from qgis.PyQt import QtCore [as 别名]
# 或者: from qgis.PyQt.QtCore import qVersion [as 别名]
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
# Save reference to the QGIS interface
self.iface = iface
self.canvas = iface.mapCanvas()
# initialize plugin directory
self.plugin_dir = os.path.dirname(__file__)
# initialize locale
locale = QSettings().value('locale/userLocale')[0:2]
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'go2mapillary_{}.qm'.format(locale))
if os.path.exists(locale_path):
self.translator = QTranslator()
self.translator.load(locale_path)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
# Declare instance attributes
self.actions = []
self.menu = self.tr(u'&go2mapillary')
# TODO: We are going to let the user set this up in a future iteration
self.toolbar = self.iface.addToolBar(u'go2mapillary')
self.toolbar.setObjectName(u'go2mapillary')
#print "** INITIALIZING go2mapillary"
self.pluginIsActive = False
self.dockwidget = None
# noinspection PyMethodMayBeStatic
示例7: __init__
# 需要导入模块: from qgis.PyQt import QtCore [as 别名]
# 或者: from qgis.PyQt.QtCore import qVersion [as 别名]
def __init__(self, iface):
"""Constructor.
:param iface: An interface instance that will be passed to this class
which provides the hook by which you can manipulate the QGIS
application at run time.
:type iface: QgsInterface
"""
# Save reference to the QGIS interface
self.iface = iface
# initialize plugin directory
self.plugin_dir = get_file_dir(__file__)
# initialize locale
self.translator = QTranslator()
self.locale = Locale.get_locale()
locale_path = os.path.join(
self.plugin_dir,
'i18n',
'QuickMapServices_{}.qm'.format(self.locale))
if os.path.exists(locale_path):
r = self.translator.load(locale_path)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
self.custom_translator = CustomTranslator()
QCoreApplication.installTranslator(self.custom_translator)
# Create the dialog (after translation) and keep reference
self.info_dlg = AboutDialog()
# Check Contrib and User dirs
try:
ExtraSources.check_extra_dirs()
except:
error_message = self.tr('Extra dirs for %s can\'t be created: %s %s') % (PluginSettings.product_name(),
sys.exc_type,
sys.exc_value)
self.iface.messageBar().pushMessage(self.tr('Error'),
error_message,
level=QgsMessageBar.CRITICAL)
# Declare instance attributes
self.service_actions = []
self.service_layers = [] # TODO: id and smart remove
self._scales_list = None
# noinspection PyMethodMayBeStatic