本文整理汇总了Python中qgis.PyQt.QtCore.QObject类的典型用法代码示例。如果您正苦于以下问题:Python QObject类的具体用法?Python QObject怎么用?Python QObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, collection_manager, collection_id):
QObject.__init__(self)
self._collection_manager = collection_manager
self._collection_id = collection_id
self.install_status = False
self.error_message = None
self.killed = False
示例2: __init__
def __init__(self):
"""Constructor for the metadataDbIO object."""
QObject.__init__(self)
# path to sqlite db path
self.metadata_db_path = None
self.setup_metadata_db_path()
self.connection = None
示例3: __init__
def __init__(
self,
osm_file,
layers=OSM_LAYERS,
white_list_column=WHITE_LIST,
delete_empty_layers=False,
load_only=False,
osm_conf=None):
self.__osmFile = osm_file
self.__layers = layers
if not white_list_column:
white_list_column = {
'multilinestrings': None,
'points': None,
'lines': None,
'multipolygons': None}
self.__whiteListColumn = white_list_column
self.__deleteEmptyLayers = delete_empty_layers
self.__loadOnly = load_only
# If an osm_conf is provided ?
if not osm_conf:
current_dir = dirname(realpath(__file__))
self._osm_conf = join(current_dir, 'QuickOSMconf.ini')
else:
self._osm_conf = osm_conf
QObject.__init__(self)
示例4: __init__
def __init__(self, parent, context, webPage, layerType):
QObject.__init__(self, parent)
debug("OpenlayersController.__init__", 3)
self.context = context
self.layerType = layerType
self.img = QImage()
self.page = webPage
self.page.loadFinished.connect(self.pageLoaded)
# initial size for map
self.page.setViewportSize(QSize(1, 1))
self.timerMapReady = QTimer()
self.timerMapReady.setSingleShot(True)
self.timerMapReady.setInterval(20)
self.timerMapReady.timeout.connect(self.checkMapReady)
self.timer = QTimer()
self.timer.setInterval(100)
self.timer.timeout.connect(self.checkMapUpdate)
self.timerMax = QTimer()
self.timerMax.setSingleShot(True)
# TODO: different timeouts for map types
self.timerMax.setInterval(2500)
self.timerMax.timeout.connect(self.mapTimeout)
示例5: __init__
def __init__(self, data, parent=None):
QObject.__init__(self, parent)
self.populated = False
self.itemData = data
self.childItems = []
if parent:
parent.appendChild(self)
示例6: __init__
def __init__(self, layer=None):
"""Constructor for the KeywordIO object.
.. versionchanged:: 3.3 added optional layer parameter.
"""
QObject.__init__(self)
self.layer = layer
示例7: __init__
def __init__(self, interface, settings):
QObject.__init__(self)
self.iface = interface
self.settings = settings
self.stop = False
self.util = Util(self.iface)
self.intersections = []
self.cadastre = []
示例8: __init__
def __init__(self, iface, status_bar, progress_label, api, db_connections):
QObject.__init__(self)
self.iface = iface
self.status_bar = status_bar
self.progress_label = progress_label
self.api = api
self.db_connections = db_connections
self.PROJECT_INSTANCE = QgsProject.instance()
示例9: __init__
def __init__(self, iface):
QObject.__init__(self)
"""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',
'MagneticDeclination_{}.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
self.dlg = MagneticDeclinationDialog()
#
# Declare instance attributes
self.actions = []
self.menu = self.tr(u'&Magnetic Declination')
# TODO: We are going to let the user set this up in a future iteration
self.toolbar = self.iface.addToolBar(u'MagneticDeclination')
self.toolbar.setObjectName(u'MagneticDeclination')
#
#DECLARATION
self.dlg.Calculate_Button.clicked.connect(self.simple_Calculate)
self.dlg.FromMap_Button.clicked.connect(self.simple_FromMap)
self.dlg.Compass_Button.clicked.connect(self.simple_Compass)
self.dlg.Cancel_Button.clicked.connect(self.simple_Cancel)
self.dlg.meter_radioButton.clicked.connect(self.simple_Meter)
self.dlg.feet_radioButton.clicked.connect(self.simple_Feet)
self.dlg.toMagnetic_radioButton.clicked.connect(self.simple_ToMag)
self.dlg.toTrue_radioButton.clicked.connect(self.simple_ToTrue)
self.dlg.color_toolButton.clicked.connect(self.simple_Kolors)
#
self.dlg.latitude_doubleSpinBox.valueChanged.connect(self.calcSenseLonLat)
self.dlg.longitude_doubleSpinBox.valueChanged.connect(self.calcSenseLonLat)
self.dlg.height_doubleSpinBox.valueChanged.connect(self.calcSense)
self.dlg.heading_doubleSpinBox.valueChanged.connect(self.calcSense)
self.dlg.d_spinBox.valueChanged.connect(self.calcSense)
self.dlg.m_spinBox.valueChanged.connect(self.calcSense)
self.dlg.y_spinBox.valueChanged.connect(self.calcSense)
self.dlg.height_doubleSpinBox.valueChanged.connect(self.calcSense)
self.dlg.date_groupBox.clicked.connect(self.calcSense)
self.dlg.height_groupBox.clicked.connect(self.calcSense)
示例10: __init__
def __init__(self, dialog):
QObject.__init__(self)
self.dialog = dialog
self.startTime = datetime.now()
# common cadastre methods
self.qc = self.dialog.qc
self.defaultThemeDir = 'classique'
self.themeDir = None
# List of database layers to load in QGIS
self.mainLayers = [
u'Communes',
u'Sections',
u'Parcelles',
u'Bâti'
]
self.qgisCadastreLayerList = [
{'label': u'Communes', 'name': 'geo_commune', 'table': 'geo_commune', 'geom': 'geom', 'sql': '', 'key': 'ogc_fid', 'active': True, 'group': 'C', 'subset': '"geo_commune" IN (%s)'},
{'label': u'Tronçons de route', 'name': 'geo_tronroute', 'table': 'geo_tronroute', 'geom': 'geom', 'sql': '', 'active': True, 'group': 'D'},
{'label': u'Voies, routes et chemins', 'name': 'geo_zoncommuni', 'table': 'geo_zoncommuni', 'geom': 'geom', 'sql': '', 'active': False, 'group': 'D'},
{'label': u'Noms de voies', 'name': 'geo_label_zoncommuni', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" IN ( \'ZONCOMMUNI_id\') ', 'active': True, 'group': 'E'},
{'label': u'Secteurs', 'name': 'geo_subdsect', 'table': 'geo_subdsect', 'geom': 'geom', 'sql': '', 'active': True, 'group': 'D'},
{'label': u'Subdivisions fiscales', 'name': 'geo_subdfisc', 'table': 'geo_subdfisc', 'geom': 'geom', 'sql': '', 'active': True, 'group': 'D'},
{'label': u'Subdivisions fiscales (étiquette)', 'name': 'geo_label_subdfisc', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'SUBDFISC_id\'', 'active': False, 'group': 'E'},
{'label': u'Bâti', 'name': 'geo_batiment', 'table': 'geo_batiment', 'geom': 'geom', 'sql': '', 'active': True, 'group': 'D'},
{'label': u'Parcelles (étiquettes)', 'name': 'geo_label_parcelle', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'PARCELLE_id\'', 'active': True, 'group': 'E'},
{'label': u'Lieux-dits', 'name': 'geo_lieudit', 'table': 'geo_lieudit', 'geom': 'geom', 'sql': '', 'active': True, 'group': 'D'},
{'label': u'Lieux-dits (étiquettes)', 'name': 'geo_label_lieudit', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'LIEUDIT_id\'', 'active': False, 'group': 'E'},
{'label': u'Sections', 'name': 'geo_section', 'table': 'geo_section', 'geom': 'geom', 'sql': '', 'key': 'ogc_fid', 'active': True, 'group': 'C', 'subset': '"geo_commune" IN (%s)'},
{'label': u'Parcelles', 'name': 'parcelle_info', 'table': 'parcelle_info', 'geom': 'geom', 'sql': '', 'key': 'ogc_fid', 'active': True, 'group': 'C', 'subset': 'substr("geo_parcelle", 1, 10) IN (%s)'},
{'label': u'Sections (étiquettes)', 'name': 'geo_label_section', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'SECTION_id\'', 'active': False, 'group': 'E'},
{'label': u'Bornes', 'name': 'geo_borne', 'table': 'geo_borne', 'geom': 'geom', 'sql': '', 'active': False, 'group': 'D'},
{'label': u'Croix', 'name': 'geo_croix', 'table': 'geo_croix', 'geom': 'geom', 'sql': '', 'active': False, 'group': 'D'},
{'label': u'Repères géodésiques', 'name': 'geo_ptcanv', 'table': 'geo_ptcanv', 'geom': 'geom', 'sql': '', 'active': False, 'group': 'D'},
{'label': u'Murs, fossés, clotûres', 'name': 'geo_symblim', 'table': 'geo_symblim', 'geom': 'geom', 'sql': '', 'active': False, 'group': 'D'},
{'label': u'Cours d\'eau', 'name': 'geo_tronfluv', 'table': 'geo_tronfluv', 'geom': 'geom', 'sql': '', 'active': True, 'group': 'D'},
{'label': u'Cours d\'eau (étiquettes)', 'name': 'geo_label_tronfluv', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'TRONFLUV_id\'', 'active': True, 'group': 'E'},
{'label': u'Tronçons de route (étiquettes)', 'name': 'geo_label_tronroute', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'TRONROUTE_id\'', 'active': False, 'group': 'E'},
{'label': u'Surfaces', 'name': 'geo_tsurf', 'table': 'geo_tsurf', 'geom': 'geom', 'sql': '', 'active': True, 'group': 'D'},
{'label': u'Surfaces (étiquettes)', 'name': 'geo_label_tsurf', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'TSURF_id\'', 'active': False, 'group': 'E'},
{'label': u'Objets ponctuels', 'name': 'geo_tpoint', 'table': 'geo_tpoint', 'geom': 'geom', 'sql': '', 'active': False, 'group': 'D'},
{'label': u'Objets ponctuels (étiquettes)', 'name': 'geo_label_tpoint', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'TPOINT_id\'', 'active': False, 'group': 'E'},
{'label': u'Objets linéaires', 'name': 'geo_tline', 'table': 'geo_tline', 'geom': 'geom', 'sql': '', 'active': False, 'group': 'D'},
{'label': u'Objets linéaires (étiquettes)', 'name': 'geo_label_tline', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'TLINE_id\'', 'active': False, 'group': 'E'},
{'label': u'Numéros de voie', 'name': 'geo_label_num_voie', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'NUMVOIE_id\'', 'active': True, 'group': 'E'},
{'label': u'Établissements publics', 'name': 'geo_label_voiep', 'table': 'geo_label', 'geom': 'geom', 'sql': '"ogr_obj_lnk_layer" = \'VOIEP_id\'', 'active': True, 'group': 'E'}
#,
#{'label': u'Unités foncières', 'name': 'geo_unite_fonciere', 'table': 'geo_unite_fonciere', 'geom':'geom', 'sql': '', 'dbType': 'postgis', 'active': False, 'group': 'D'}
]
# List of database layers to load in QGIS
self.variableLayers = {
'Communes':{'var_key':'communes', 'unique_col':'geo_commune'},
'Sections':{'var_key':'sections', 'unique_col':'geo_section'},
'Parcelles':{'var_key':'parcelles', 'unique_col':'geo_parcelle'},
'Bâti':{'var_key':'batiment', 'unique_col':'geo_batiment'},
}
示例11: __init__
def __init__(self, vlayers, infield, searchStr, comparisonMode, selectedField, maxResults):
QObject.__init__(self)
self.vlayers = vlayers
self.infield = infield
self.searchStr = searchStr
self.comparisonMode = comparisonMode
self.selectedField = selectedField
self.killed = False
self.maxResults = maxResults
示例12: __init__
def __init__(self, iface):
QObject.__init__(self)
self.iface = iface
self.timeManagementEnabled = True
self.timeLayerList = []
self.setProjectTimeExtents((None, None))
self.setCurrentTimePosition(None)
self.timeFrameType = conf.DEFAULT_FRAME_UNIT
self.timeFrameSize = conf.DEFAULT_FRAME_SIZE
示例13: __init__
def __init__(self, iface, model):
"""Initialize the GUI control"""
QObject.__init__(self)
self.iface = iface
self.model = model
self.optionsDialog = None
self.path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'ui')
# load the form
self.dock = uic.loadUi(os.path.join(self.path, DOCK_WIDGET_FILE))
self.iface.addDockWidget(Qt.BottomDockWidgetArea, self.dock)
self.dock.pushButtonExportVideo.setEnabled(False) # only enabled if there are managed layers
self.dock.pushButtonOptions.clicked.connect(self.optionsClicked)
self.dock.pushButtonExportVideo.clicked.connect(self.exportVideoClicked)
self.dock.pushButtonToggleTime.clicked.connect(self.toggleTimeClicked)
self.dock.pushButtonArchaeology.clicked.connect(self.archaeologyClicked)
self.dock.pushButtonBack.clicked.connect(self.backClicked)
self.dock.pushButtonForward.clicked.connect(self.forwardClicked)
self.dock.pushButtonPlay.clicked.connect(self.playClicked)
self.dock.dateTimeEditCurrentTime.dateTimeChanged.connect(self.currentTimeChangedDateText)
# self.dock.horizontalTimeSlider.valueChanged.connect(self.currentTimeChangedSlider)
self.sliderTimer = QTimer(self)
self.sliderTimer.setInterval(250)
self.sliderTimer.setSingleShot(True)
self.sliderTimer.timeout.connect(self.currentTimeChangedSlider)
self.dock.horizontalTimeSlider.valueChanged.connect(self.startTimer)
self.dock.comboBoxTimeExtent.currentIndexChanged[str].connect(self.currentTimeFrameTypeChanged)
self.dock.spinBoxTimeExtent.valueChanged.connect(self.currentTimeFrameSizeChanged)
# this signal is responsible for rendering the label
self.iface.mapCanvas().renderComplete.connect(self.renderLabel)
# create shortcuts
self.focusSC = QShortcut(QKeySequence("Ctrl+Space"), self.dock)
self.focusSC.activated.connect(self.dock.horizontalTimeSlider.setFocus)
# put default values
self.dock.horizontalTimeSlider.setMinimum(conf.MIN_TIMESLIDER_DEFAULT)
self.dock.horizontalTimeSlider.setMaximum(conf.MAX_TIMESLIDER_DEFAULT)
self.dock.dateTimeEditCurrentTime.setMinimumDate(MIN_QDATE)
self.showLabel = conf.DEFAULT_SHOW_LABEL
self.exportEmpty = conf.DEFAULT_EXPORT_EMPTY
self.labelOptions = TimestampLabelConfig(self.model)
# placeholders for widgets that are added dynamically
self.bcdateSpinBox = None
# add to plugins toolbar
try:
self.action = QAction(QCoreApplication.translate("TimeManagerGuiControl", "Toggle visibility"), self.iface.mainWindow())
self.action.triggered.connect(self.toggleDock)
self.iface.addPluginToMenu(QCoreApplication.translate("TimeManagerGuiControl", "&TimeManager"), self.action)
except Exception as e:
pass # OK for testing
示例14: __init__
def __init__(self):
QObject.__init__(self)
if LayerRegistry._instance is not None:
return
LayerRegistry.layers = self.getAllLayers()
LayerRegistry._instance = self
QgsMapLayerRegistry.instance().removeAll.connect(self.removeAllLayers)
QgsMapLayerRegistry.instance().layerWasAdded.connect(self.layerAdded)
QgsMapLayerRegistry.instance().layerWillBeRemoved.connect(self.removeLayer)
示例15: __init__
def __init__(self):
QObject.__init__(self)
self.plugins = dict()
self.localCache = dict()
self.repoCache = dict()
try:
from qgistester.tests import addTestModule
from boundlessconnect.test import testplugin
addTestModule(testplugin, "Boundless Connect")
except Exception as ex:
pass