Python qgis.PyQt.QtCore.qVersion() Examples
The following are 7
code examples of qgis.PyQt.QtCore.qVersion().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
qgis.PyQt.QtCore
, or try the search function
.
Example #1
Source File: opeNoise.py From openoise-map with GNU General Public License v3.0 | 6 votes |
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
Example #2
Source File: data_plotly.py From DataPlotly with GNU General Public License v2.0 | 5 votes |
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
Example #3
Source File: ee_plugin.py From qgis-earthengine-plugin with MIT License | 5 votes |
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
Example #4
Source File: dsg_tools.py From DsgTools with GNU General Public License v2.0 | 5 votes |
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
Example #5
Source File: HydroSEDPlugin.py From WMF with GNU General Public License v3.0 | 4 votes |
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
Example #6
Source File: mapillary_explorer.py From go2mapillary with GNU General Public License v3.0 | 4 votes |
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
Example #7
Source File: quick_map_services.py From quickmapservices with GNU General Public License v2.0 | 4 votes |
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