本文整理匯總了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