本文整理汇总了Python中PyQt4.QtCore.QObject.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QObject.__init__方法的具体用法?Python QObject.__init__怎么用?Python QObject.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QObject
的用法示例。
在下文中一共展示了QObject.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self,DATA):
self.data = DATA
QMainWindow.__init__(self)
# set up User Interface (widgets, layout...)
self.setupUi(self)
# --- specify graph and label objects as declared in the gui file
self.data.pLL.graph = self.graph_LL
self.data.pLL.label = self.label_LL
self.data.pMC.graph = self.graph_MC
self.data.pMC.label = self.label_MC
#combo box entries, dictionary
self.cb_scale_entries = {0:24,1:2,2:1,3:0.16}
self.range = self._get_range()
for p in self.data.parameters: p.range = self._get_range()
self._setup_signal_slots()
self._setup_graphs()
self._start_acquisition()
示例2: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self, document, parent=None):
"""
A wrapper class for configuration updaters. It starts the running of
Configuration version updater that is the first updater.
:param document: The QDomDocument of the configuration
:type document: QDomDocument
:param parent: The parent of the QObject, even though unused.
:type parent: QWidget/NoneType
"""
QObject.__init__(self, parent)
self.file_handler = FilePaths()
self.log_file_path = '{}/logs/migration.log'.format(
self.file_handler.localPath()
)
self.base_updater = ConfigurationVersionUpdater(
document, self.log_file_path
)
self.document = document
示例3: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self, parent=None, context=None, slice_direction_index_source=None):
QObject.__init__(self, parent)
self._context = context
self._slice_direction = slice_direction_index_source
self._current_index_label = QLabel("")
self._current_index_label.setDisabled(True)
# the select-index-widgets
self.index_s_box = self._set_up_index_widget()
# the min max settings widgets
self._min_active, self._min_spinbox = self._set_up_min_max_widgets()
self._max_active, self._max_spinbox = self._set_up_min_max_widgets()
self._initialize(self._context.slice_data_source().indexes_for_direction(self._slice_direction).tolist())
示例4: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
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
示例5: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self,layer, tolerance, uid, errors, unlinks):
QObject.__init__(self)
self.layer = layer
self.feat_count = self.layer.featureCount()
self.tolerance = tolerance
self.uid = uid
self.errors = errors
self.errors_features = {}
self.unlinks = unlinks
self.unlinked_features = []
self.unlinks_count = 0
self.ml_keys = {}
self.br_keys = {}
self.features = []
self.attributes = {}
self.geometries = {}
self.geometries_wkt = {}
self.geometries_vertices = {}
# create spatial index object
self.spIndex = QgsSpatialIndex()
self.layer_fields = [QgsField(i.name(), i.type()) for i in self.layer.dataProvider().fields()]
示例6: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self, iface, tableName, user, apiKey, owner=None, sql=None, geoJSON=None,
filterByExtent=False, spatiaLite=None, readonly=False, multiuser=False, isSQL=False):
self.iface = iface
self.user = user
self._apiKey = apiKey
self.layerType = 'ogr'
self.owner = owner
self.isSQL = isSQL
self.multiuser = multiuser
# SQLite available?
driverName = "SQLite"
sqLiteDrv = ogr.GetDriverByName(driverName)
self.database_path = QgisCartoDB.CartoDBPlugin.PLUGIN_DIR + '/db/database.sqlite'
self.datasource = sqLiteDrv.Open(self.database_path, True)
self.layerName = tableName
self.cartoTable = tableName
self.readonly = False
self._deletedFeatures = []
self.sql = sql
self.forceReadOnly = False or readonly
if sql is None:
sql = 'SELECT * FROM ' + self._schema() + self.cartoTable
if filterByExtent:
extent = self.iface.mapCanvas().extent()
sql = sql + " WHERE ST_Intersects(ST_GeometryFromText('{}', 4326), the_geom)".format(extent.asWktPolygon())
else:
self.forceReadOnly = True
self._loadData(sql, geoJSON, spatiaLite)
示例7: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self, iface):
QObject.__init__(self)
QgsMessageLog.logMessage('GDAL Version: ' + str(gdal.VersionInfo('VERSION_NUM')), 'CartoDB Plugin', QgsMessageLog.INFO)
# Save reference to the QGIS interface
self.iface = iface
# initialize locale
locale = QSettings().value("locale/userLocale")[0:2]
localePath = os.path.join(CartoDBPlugin.PLUGIN_DIR, "i18n", "{}.qm".format(locale))
if os.path.exists(localePath):
self.translator = QTranslator()
self.translator.load(localePath)
if qVersion() > '4.3.3':
QCoreApplication.installTranslator(self.translator)
# SQLite available?
driverName = "SQLite"
self.sqLiteDrv = ogr.GetDriverByName(driverName)
if self.sqLiteDrv is None:
QgsMessageLog.logMessage('SQLite driver not found', 'CartoDB Plugin', QgsMessageLog.CRITICAL)
else:
QgsMessageLog.logMessage('SQLite driver is found', 'CartoDB Plugin', QgsMessageLog.INFO)
self.databasePath = CartoDBPlugin.PLUGIN_DIR + '/db/database.sqlite'
shutil.copyfile(CartoDBPlugin.PLUGIN_DIR + '/db/init_database.sqlite', self.databasePath)
self.layers = []
self.countLoadingLayers = 0
self.countLoadedLayers = 0
self._cdbMenu = None
self._mainAction = None
self._loadDataAction = None
self._createVizAction = None
self._addSQLAction = None
self.toolbar = CartoDBToolbar()
self._toolbarAction = None
self._menu = None
示例8: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self, test):
QObject.__init__(self)
self.test = test
示例9: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self, cartodbUser, apiKey, multiuser=False, hostname='carto.com'):
QObject.__init__(self)
self.multiuser = multiuser
self.apiKey = apiKey
self.cartodbUser = cartodbUser
self.hostname = hostname
self.apiUrl = "https://{}.{}/api/v1/".format(cartodbUser, hostname)
self.returnDict = True
self.manager = QNetworkAccessManager()
self.manager.finished.connect(self.returnFetchContent)
示例10: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self, crazyflie):
QObject.__init__(self)
self.cf = crazyflie
self.cf.add_port_callback(CRTPPort.SYNC, self._new_packet_cb)
self.dif = 0
self.cf_time = 0
self.timer = QTimer()
self.timer.timeout.connect(self.send_synchronisation)
self.timer.setInterval(1000/5) #5hz
self.initialized = False
self.counter = 0
self.error = 0.
self.cpuTime = 0.
self.flieTime = 0.
self.t0 = rospy.Time.now().to_nsec()
示例11: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self):
QObject.__init__(self)
self._objectToBeDeleted = None
示例12: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self):
QObject.__init__(self)
# create custom properties
self._materialCache = None
self._mapCache = None
self._metaData = None
self._buffer = {}
self._state = {}
#------------------------------------------------------------------------------------------------------------------------
# protected methods
#------------------------------------------------------------------------------------------------------------------------
示例13: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self):
QObject.__init__(self)
示例14: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self,parent,container, actionRef=None, register=False):
from stdm.security.authorization import Authorizer
QObject.__init__(self,parent)
self._container = container
self._register = register
self._actionReference = actionRef
self._contentGroups = OrderedDict()
self._widgets = []
self._userName = stdm.data.app_dbconn.User.UserName
self._authorizer = Authorizer(stdm.data.app_dbconn.User.UserName)
self._iter = 0
self._separatorAction = None
示例15: __init__
# 需要导入模块: from PyQt4.QtCore import QObject [as 别名]
# 或者: from PyQt4.QtCore.QObject import __init__ [as 别名]
def __init__(self, username, containerItem=None, parent=None):
from stdm.security.authorization import Authorizer
QObject.__init__(self,parent)
HashableMixin.__init__(self)
self._username = username
self._contentItems = []
self._authorizer = Authorizer(self._username)
self._containerItem = containerItem