• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python QtCore.QObject类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中qgis.PyQt.QtCore.QObject的典型用法代码示例。如果您正苦于以下问题:Python QObject类的具体用法?Python QObject怎么用?Python QObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了QObject类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
开发者ID:akbargumbira,项目名称:qgis_resources_sharing,代码行数:7,代码来源:collection_manager.py


示例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
开发者ID:inasafe,项目名称:inasafe,代码行数:7,代码来源:metadata_db_io.py


示例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)
开发者ID:3liz,项目名称:QuickOSM,代码行数:30,代码来源:osm_parser.py


示例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)
开发者ID:mapplus,项目名称:qgis-tmsforkorea-plugin,代码行数:28,代码来源:openlayers_layer.py


示例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)
开发者ID:NyakudyaA,项目名称:QGIS,代码行数:7,代码来源:db_model.py


示例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
开发者ID:inasafe,项目名称:inasafe,代码行数:7,代码来源:keyword_io.py


示例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 = []
开发者ID:BergWerkGIS,项目名称:VoGIS-Profil-Tool,代码行数:8,代码来源:createProfile.py


示例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()
开发者ID:qgiscloud,项目名称:qgis-cloud-plugin,代码行数:8,代码来源:data_upload.py


示例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)
开发者ID:Hacked-Crew,项目名称:Magnetic-Declination,代码行数:58,代码来源:Magnetic_declination.py


示例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'},
        }
开发者ID:rldhont,项目名称:QgisCadastrePlugin,代码行数:58,代码来源:cadastre_loading.py


示例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
开发者ID:NationalSecurityAgency,项目名称:qgis-layersearch-plugin,代码行数:9,代码来源:searchWorker.py


示例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
开发者ID:anitagraser,项目名称:TimeManager,代码行数:9,代码来源:timelayermanager.py


示例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
开发者ID:anitagraser,项目名称:TimeManager,代码行数:57,代码来源:timemanagerguicontrol.py


示例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)
开发者ID:liminlu0314,项目名称:QGIS,代码行数:10,代码来源:GdalTools_utils.py


示例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
开发者ID:boundlessgeo,项目名称:qgis-connect-plugin,代码行数:13,代码来源:plugins.py


示例16: __init__

    def __init__(self):
        """ Initialize data objects, starts fetching if appropriate, and warn about/removes obsolete plugins """

        QObject.__init__(self)  # initialize QObject in order to to use self.tr()
        repositories.load()
        plugins.getAllInstalled()

        if repositories.checkingOnStart() and repositories.timeForChecking() and repositories.allEnabled():
            # start fetching repositories
            self.statusLabel = QLabel(self.tr("Looking for new plugins...") + " ", iface.mainWindow().statusBar())
            iface.mainWindow().statusBar().insertPermanentWidget(0, self.statusLabel)
            self.statusLabel.linkActivated.connect(self.showPluginManagerWhenReady)
            repositories.checkingDone.connect(self.checkingDone)
            for key in repositories.allEnabled():
                repositories.requestFetching(key)
        else:
            # no fetching at start, so mark all enabled repositories as requesting to be fetched.
            for key in repositories.allEnabled():
                repositories.setRepositoryData(key, "state", 3)

        # look for obsolete plugins (the user-installed one is newer than core one)
        for key in plugins.obsoletePlugins:
            plugin = plugins.localCache[key]
            msg = QMessageBox()
            msg.setIcon(QMessageBox.Warning)
            msg.setWindowTitle(self.tr("QGIS Python Plugin Installer"))
            msg.addButton(self.tr("Uninstall (recommended)"), QMessageBox.AcceptRole)
            msg.addButton(self.tr("I will uninstall it later"), QMessageBox.RejectRole)
            msg.setText(
                "%s <b>%s</b><br/><br/>%s"
                % (
                    self.tr("Obsolete plugin:"),
                    plugin["name"],
                    self.tr(
                        "QGIS has detected an obsolete plugin that masks its more recent version shipped with this copy of QGIS. This is likely due to files associated with a previous installation of QGIS. Do you want to remove the old plugin right now and unmask the more recent version?"
                    ),
                )
            )
            msg.exec_()
            if not msg.result():
                # uninstall, update utils and reload if enabled
                self.uninstallPlugin(key, quiet=True)
                updateAvailablePlugins()
                settings = QSettings()
                if settings.value("/PythonPlugins/" + key, False, type=bool):
                    settings.setValue("/PythonPlugins/watchDog/" + key, True)
                    loadPlugin(key)
                    startPlugin(key)
                    settings.remove("/PythonPlugins/watchDog/" + key)
开发者ID:Zakui,项目名称:QGIS,代码行数:49,代码来源:installer.py


示例17: __init__

    def __init__(self):
        """Constructor.

        ..note:
        - Directories is a list of repository that are registered in user's
        QGIS. Data structure of directories:
        self._directories = {
            'QGIS Official Repository': {
                'url': '[email protected]:anitagraser/QGIS-style-repo-dummy.git',
                'auth_cfg': '0193jkad'
             }
        }

        - Repositories is a dictionary of repository with all the collections
        contained in that repository. Data structure of repositories:
        self._repositories = {
            repo_name: [{
                'register_name': collection,
                'author': author,
                'author_email': email,
                'repository_url': self.url,
                'status': COLLECTION_NOT_INSTALLED_STATUS,
                'name': parser.get(collection, 'name'),
                'tags': parser.get(collection, 'tags'),
                'description': parser.get(collection, 'description'),
                'qgis_min_version': '2.0',
                'qgis_max_version': '2.99'
                'preview': ['preview/image1.png', 'preview/image2.png']
            },
            .... //other collections from this repository
            ],
            ... //other repository
        }
        """
        QObject.__init__(self)
        # Online directories from the DIRECTORY_URL
        self._online_directories = {}
        # Registered directories
        self._directories = {}
        # Registered repositories
        self._repositories = {}
        # Collection manager instance to deal with collections
        self._collections_manager = CollectionManager()
        # Fetch online directories
        self.fetch_online_directories()
        # Load directory of repositories from settings
        self.load_directories()
        # Load repositories from cache
        self.load_repositories()
开发者ID:akbargumbira,项目名称:qgis_resources_sharing,代码行数:49,代码来源:repository_manager.py


示例18: __init__

    def __init__(self, geturl_func, parseresult_func, parent = None):
        QObject.__init__(self, parent)
        self.geturl_func = geturl_func
        self.parseresult_func = parseresult_func
        
        self.editor = parent
        self.networkManager = QNetworkAccessManager()

        self.selectedObject = None
        self.isUnloaded = False

        self.popup = QTreeWidget(parent)
        #self.popup.setColumnCount(2)
        self.popup.setColumnCount(1)
        self.popup.setUniformRowHeights(True)
        self.popup.setRootIsDecorated(False)
        self.popup.setEditTriggers(QTreeWidget.NoEditTriggers)
        self.popup.setSelectionBehavior(QTreeWidget.SelectRows)
        self.popup.setFrameStyle(QFrame.Box | QFrame.Plain)
        self.popup.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)

        self.popup.header().hide()
        self.popup.installEventFilter(self)
        self.popup.setMouseTracking(True)

        #self.connect(self.popup, SIGNAL("itemClicked(QTreeWidgetItem*, int)"),
        #             self.doneCompletion)
        self.popup.itemClicked.connect( self.doneCompletion )

        self.popup.setWindowFlags(Qt.Popup)
        self.popup.setFocusPolicy(Qt.NoFocus)
        self.popup.setFocusProxy(parent)

        self.timer = QTimer(self)
        self.timer.setSingleShot(True)
        self.timer.setInterval(500)
        #self.connect(self.timer, SIGNAL("timeout()"), self.autoSuggest)
        self.timer.timeout.connect( self.autoSuggest )
        
        #self.connect(self.editor, SIGNAL("textEdited(QString)"), self.timer, SLOT("start()"))
        #self.editor.textEdited.connect( self.timer.start )
        self.editor.textEdited.connect( self.timer.start )
        #self.editor.textChanged.connect( self.timer.start )

        #self.connect(self.networkManager, SIGNAL("finished(QNetworkReply*)"),
        #             self.handleNetworkData)
        self.networkManager.finished.connect( self.handleNetworkData )
开发者ID:Septima,项目名称:qgis-geosearch,代码行数:47,代码来源:autosuggest.py


示例19: __init__

    def __init__(self, canvas):
        """Constructor
        :param canvas:
        """
        QObject.__init__(self)
        self.canvas = canvas
        # Set up slots so we can mimic the behaviour of QGIS when layers
        # are added.
        LOGGER.debug('Initialising canvas...')
        # noinspection PyArgumentList
        QgsMapLayerRegistry.instance().layersAdded.connect(self.addLayers)
        # noinspection PyArgumentList
        QgsMapLayerRegistry.instance().layerWasAdded.connect(self.addLayer)
        # noinspection PyArgumentList
        QgsMapLayerRegistry.instance().removeAll.connect(self.removeAllLayers)

        # For processing module
        self.destCrs = None
开发者ID:BelgianBiodiversityPlatform,项目名称:qgis-gbif-api,代码行数:18,代码来源:qgis_interface.py


示例20: __init__

    def __init__(self, parent=None):
        QObject.__init__(self, parent)
        self.queue = []
        self.requestingUrls = []
        self.replies = []

        self.eventLoop = QEventLoop()
        self.sync = False
        self.fetchedFiles = {}
        self.clearCounts()

        self.timer = QTimer()
        self.timer.setSingleShot(True)
        self.timer.timeout.connect(self.fetchTimedOut)

        # network settings
        self.userAgent = "Mozilla/5.0"
        self.max_connection = 4
        self.default_cache_expiration = 24
        self.errorStatus = Downloader.NO_ERROR
开发者ID:boundlessgeo,项目名称:qgis-baselayers-plugin,代码行数:20,代码来源:downloader.py



注:本文中的qgis.PyQt.QtCore.QObject类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python QtCore.QPointF类代码示例发布时间:2022-05-26
下一篇:
Python QtCore.QMimeData类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap