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
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)
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))
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 __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()
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)
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
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()
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()
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)
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)
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)
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 )
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)}
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)
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
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()
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)
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)
def __init__(self, view_state): QAbstractListModel.__init__(self) self.view_state = view_state self.pairs = list(view_state.atoms.info['bonds']) view_state.updated.connect(self.changed) role_names = { self.x1role: 'x1', self.y1role: 'y1', self.z1role: 'z1', self.x2role: 'x2', self.y2role: 'y2', self.z2role: 'z2', self.element1role: 'element1', self.element2role: 'element2', } self.setRoleNames(role_names)
def __init__(self, parent=None, languages=None): """ Initializes the class. :param parent: Parent object. :type parent: QObject :param languages: Languages. :type languages: list """ LOGGER.debug("> Initializing '{0}()' class.".format(self.__class__.__name__)) QAbstractListModel.__init__(self, parent) # --- Setting class attributes. --- self.__languages = [] self.languages = languages
def __init__(self, mplayerpgm="mplayer"): QAbstractListModel.__init__(self, None) self._mplayer_path = mplayerpgm self._dllist = list() self._idbypath = dict() pix = QPixmap(22, 22) pix.fill(QColor(0, 0, 255, 255)) self._icon_run = QIcon(pix) pix = QPixmap(22, 22) pix.fill(QColor(255, 0, 0, 255)) self._icon_error = QIcon(pix) pix = QPixmap(22, 22) pix.fill(QColor(0, 255, 0, 255)) self._icon_fin = QIcon(pix) pix = QPixmap(22, 22) pix.fill(QColor(0, 0, 0, 255)) self._icon_wait = QIcon(pix)
def itemData(self, index): mapping = QAbstractListModel.itemData(self, index) if self._is_index_valid_for(index, self._other_data): items = list(self._other_data[index.row()].items()) else: items = [] for key, value in items: mapping[key] = value return mapping
def __init__(self, parent=None, interfaces=None): """ Initializes the class. :param parent: Parent object. :type parent: QObject :param interfaces: InterfacesModel. :type interfaces: 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
def mimeData(self, indexlist): if len(indexlist) <= 0: return None items = [self[i.row()] for i in indexlist] mime = QAbstractListModel.mimeData(self, indexlist) data = pickle.dumps(vars) mime.set_data(self.MIME_TYPE, QByteArray(data)) mime._items = items return mime
def dropMimeData(self, mime, action, row, column, parent): if action == Qt.IgnoreAction: return True if not mime.hasFormat(self.MIME_TYPE): return False if hasattr(mime, "_vars"): vars_ = mime._vars else: desc = str(mime.data(self.MIME_TYPE)) vars_ = pickle.loads(desc) return QAbstractListModel.dropMimeData( self, mime, action, row, column, parent)
def __init__(self, figure=None, parent=None, *args): QAbstractListModel.__init__(self, parent, *args) self.parent = parent self._figure = figure
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) self.addons = []
def flags(self, index): if not index.isValid(): return Qt.ItemIsEnabled return Qt.ItemFlags(QAbstractListModel.flags(self, index)|Qt.ItemIsUserCheckable)
def __init__(self, parent=None, *args): QAbstractListModel.__init__(self, parent, *args) self.listOfZonesForDisplay = []
def index(self, row, column=0, parent=QModelIndex()): if self._is_index_valid_for(row, self) and column == 0: return QAbstractListModel.createIndex(self, row, column, parent) else: return QModelIndex()
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) self.data_list = [] self.load_img() self.update_model()
def __init__(self, parent, cols): QAbstractListModel.__init__(self, parent) self._cols = cols
def flags(self, index): if index.isValid(): return QAbstractListModel.flags(self, index) | Qt.ItemIsUserCheckable return QAbstractListModel.flags(self, index)
def __init__(self): QAbstractListModel.__init__(self) self.widgets = []
def __init__(self): QAbstractListModel.__init__(self) self.shortcuts = []
def flags(self, index): # return (QAbstractTableModel.flags(self, index)|Qt.ItemIsEditable) return (QAbstractListModel.flags(self, index) | Qt.ItemIsEditable)
def __init__(self, datain=None, parent=None, *args): """initialize the class members""" QAbstractListModel.__init__(self, parent, *args) self.__listdata = datain
def __init__(self, engineMap, view): QAbstractListModel.__init__(self) self.view = view self.view.setModel(self) self.engineMap = engineMap self.engines = list(sorted(self.engineMap.keys()))
def __init__(self, databaseFile): QAbstractListModel.__init__(self) self.db = ShortcutDatabase(databaseFile) self.shortcuts = self.db.selectShortcut("")
def mimeTypes(self): return self.MIME_TYPES + list(QAbstractListModel.mimeTypes(self))
def flags(self, index): if index.column() == 0: return QAbstractListModel.flags(self, index) | Qt.ItemIsEditable return QAbstractListModel.flags(self, index)
def __init__(self, datain, headerdata, parent=None): QAbstractListModel.__init__(self, parent) self.array_data = datain self.header_data = headerdata
def __init__(self, datain, parent=None, *args): """ datain: a list where each item is a row """ QAbstractListModel.__init__(self, parent, *args) self.listdata = datain
def __init__(self): QAbstractListModel.__init__(self) # Cache the passed data list as a class member. self.items = []