本文整理汇总了Python中PyQt4.QtCore.QAbstractListModel.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QAbstractListModel.__init__方法的具体用法?Python QAbstractListModel.__init__怎么用?Python QAbstractListModel.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtCore.QAbstractListModel
的用法示例。
在下文中一共展示了QAbstractListModel.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, model, view):
QAbstractListModel.__init__(self)
self._updating = False
self.view = view
self.model = model
self.view.setModel(self)
self.model.view = self
示例2: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, parent = None):
QAbstractListModel.__init__(self, parent)
self._layerStack = []
self.selectionModel = QItemSelectionModel(self)
self.selectionModel.selectionChanged.connect(self.updateGUI)
self._movingRows = False
QTimer.singleShot(0, self.updateGUI)
示例3: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, parent = None):
QAbstractListModel.__init__(self, parent)
self.list = []
self.strategies = parent
self.play = QPixmap()
self.play.load("img/Play.png")
self.none = QPixmap(32, 32)
self.none.fill(QColor(0, 0, 0, 0))
示例4: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, outcome_var=None, parent=None, checkeable=False):
QAbstractListModel.__init__(self, parent)
self.variables_list = []
self.header = "Variable"
self.outcome = outcome_var
self.checkeable = checkeable
self.checked_set = None
if checkeable:
self.checked_set = set()
示例5: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, waveNames=[], parent=None, *args):
QAbstractListModel.__init__(self, parent, *args)
self._app = QApplication.instance().window
self._orderedWaveNames = []
for w in waveNames:
self.appendRow(w)
# Connect signals
self.appWaves().waveRemoved[Wave].connect(self.removeWave)
示例6: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, storage_file):
"""Creates a series storage object
:param storage_file: The default file where to store the JSON
represenation of this object.
"""
QAbstractListModel.__init__(self, None)
self._series = list()
self._idbyname = dict()
self.safeToExit = True
self._def_path = storage_file
示例7: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, parent=None, *args):
QAbstractListModel.__init__(self, parent, *args)
self.Zonenliste = []
ctrl = Controller()
# gets all usages for the zone paired with the usage times
self.listOFUsages = ctrl.fillBoundaryConditions()
self.usageTimes = ctrl.fillUsageTimes()
self.selectionOfZones = []
for index, wert in enumerate(self.listOFUsages):
usage = wert.Nutzung
nutzungDecoded = usage.decode("iso-8859-1")
self.selectionOfZones.append(nutzungDecoded)
示例8: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, parent = None):
QAbstractListModel.__init__(self, parent)
self.server = "localhost"
self.port = 6600
# prepare client
self.client = mpd.MPDClient()
self.client.timeout = None
self.client.idletimeout = None
self.client.connect(self.server, self.port)
self.__updatePlaylist()
self.__updateCurrent()
示例9: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, mpdclient, library, config):
QAbstractListModel.__init__(self)
self.lastEdit = time()
self._boldFont = QFont()
self._boldFont.setBold(True)
self._stdFont = QFont()
self.playing = None
self._clear()
self._oneLine = config.oneLinePlaylist
self.mpdclient = mpdclient
self.library = library
self.config = config
self.retriever = iconretriever.ThreadedRetriever(config.coverPath)
示例10: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, view_state):
QAbstractListModel.__init__(self)
self.view_state = view_state
view_state.updated.connect(self.changed)
role_names = {
self.xrole: 'atomx',
self.yrole: 'atomy',
self.zrole: 'atomz',
self.elementrole: 'element',
self.covradiusrole: 'covalentRadius',
self.typerole: 'type',
self.descriptionrole: 'description'
}
self.setRoleNames(role_names)
示例11: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, backend, data = []):
'''
@type backend: L{src.backends.backend.backend}
@type data: dict
'''
QAbstractListModel.__init__(self, parent = None)
self.__backend = backend
self.__data = data
self.__dates = {}
pix = QPixmap(350, 64)
pix.fill()
self.__loadedimages = {None: QIcon(pix)}
示例12: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, parent = None):
QAbstractListModel.__init__(self, parent)
self._layerStack = []
self.selectionModel = QItemSelectionModel(self)
self.selectionModel.selectionChanged.connect(self.updateGUI)
self.selectionModel.selectionChanged.connect(self._onSelectionChanged)
self._movingRows = False
QTimer.singleShot(0, self.updateGUI)
def _handleRemovedLayer(layer):
# Layerstacks *own* the layers they hold, and thus are
# responsible for cleaning them up when they are removed:
layer.clean_up()
self.layerRemoved.connect( _handleRemovedLayer )
示例13: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, parent=None):
"""
Create a model.
``parent`` is the parent :class:`~PyQt4.QtCore.QObject`.
"""
QAbstractListModel.__init__(self, parent)
self._monitor = MouseDevicesMonitor(self)
self._monitor.mousePlugged.connect(self._mouse_plugged)
self._monitor.mouseUnplugged.connect(self._mouse_unplugged)
self._resume_monitor = create_resume_monitor(self)
if self._resume_monitor:
self._resume_monitor.resuming.connect(self._reset_device_index)
self._device_index = list(self._monitor.plugged_devices)
self._checked_devices = set()
示例14: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, hex_widget, match_operation):
QAbstractListModel.__init__(self)
self._lock = threading.RLock()
self._newResults = []
self._matchOperation = match_operation
self._hexWidget = hex_widget
self._results = []
if self._matchOperation is not None:
with self._matchOperation.lock:
self._matchOperation.newResults.connect(self._onNewMatches, Qt.DirectConnection)
self._matchOperation.finished.connect(self._onMatchFinished, Qt.QueuedConnection)
for match in self._matchOperation.state.results.values():
self._results.append((match, self._createRange(match)))
self.startTimer(400)
示例15: __init__
# 需要导入模块: from PyQt4.QtCore import QAbstractListModel [as 别名]
# 或者: from PyQt4.QtCore.QAbstractListModel import __init__ [as 别名]
def __init__(self, parent=None, interfaces=None):
"""
This method initializes the class.
:param parent: Parent object. ( QObject )
:param interfaces: InterfacesModel. ( List )
"""
LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__))
QAbstractListModel.__init__(self, parent)
# --- Setting class attributes. ---
self.__interfaces = []
self.interfaces = interfaces or self.__interfaces