def __init__(self, displayTag="name", parent=None): self.displayTag = displayTag QAbstractListModel.__init__(self, parent) self._objects = [] self.rowsInserted.connect(self.lengthChanged) self.rowsRemoved.connect(self.lengthChanged)
def __init__(self, settings): QAbstractListModel.__init__(self) self.settings = settings self._nameList = list() self.load()
def __init__(self, settings): QAbstractListModel.__init__(self) self.settings = settings self._data = [] self.load()
def __init__(self, kraj, filename=None): QAbstractListModel.__init__(self) self.okresy_list = [] self.ktery_kraj = kraj self.zaloha = [] if filename: self.load_from_json(filename)
def __init__(self): QAbstractListModel.__init__(self) # self.__effects_count = 3 self.__effect_ids = local_effects.keys() self.__order = dict(enumerate(local_effects.keys())) global patch_bay_singleton patch_bay_singleton = self
def removeData(self, row): if row < 0 | row > len(self._m_data): return data = self._m_data[row] QAbstractListModel.beginRemoveRows(self, QModelIndex(), row, row) self._m_data.remove(data) QAbstractListModel.endRemoveRows(self)
def __init__(self, na_manager: QNetworkAccessManager): QAbstractListModel.__init__(self) self.vehicle_list = [] self.na_manager = na_manager self.na_manager.finished[QNetworkReply].connect(self.download_finished) self.timer = QTimer() self.timer.setInterval(UPDATE_INTERVAL) self.timer.timeout.connect(self.start_download) self.timer.start()
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) # holds a list of all topic objects referenced by the "relatedTopics" # list inside the current topic object `topic` self.relTopics = list() """ List of instances of `Topic` that are specified as related to `self.topic` """ self.topic = None """ Current topic to which the related topics shall be displayed. """
def duplicateData(self, row): if row < 0 | row > len(self._m_data): return data = self._m_data[row] rowOfInsert = row + 1 QAbstractListModel.beginInsertRows(self, QModelIndex(), rowOfInsert, rowOfInsert) self._m_data.insert(rowOfInsert, data) QAbstractListModel.endInsertRows(self)
def __init__(self): QAbstractListModel.__init__(self) self.__cpu_count = psutil.cpu_count() self.__cpu_load = [0] * self.__cpu_count self.__update_timer = QTimer(self) self.__update_timer.setInterval(1000) self.__update_timer.timeout.connect(self.__update) self.__update_timer.start() # The first call returns invalid data psutil.cpu_percent(percpu=True)
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) self.size = QSize(100, 100) """ Size of an icon """ self.currentTopic = None """ Currently open topic """ self.snapshotList = [] """ List of the snapshot files """ self.snapshotImgs = [] """ Buffer of the already loaded images """
def __init__(self, parent=None): ''' Initialisation of board. Creates todo list as well as populates it. ''' QAbstractListModel.__init__(self, parent) self.mydb = SQLDatabase.get_db_instance() self.cursor = self.mydb.cursor() self._todos = [] self.refresh_todos_list()
def growPopulation(self): growthFactor = 0.01 / self.RAND_MAX count = len(self._m_data) for i in range(0, count): self._m_data[ i].population += self._m_data[i].population * random.randint( 1, self.RAND_MAX) * growthFactor startIndex = QAbstractListModel.index(self, 0, 0) endIndex = QAbstractListModel.index(self, count - 1, 0) self.dataChanged.emit(startIndex, endIndex, [self.Roles.PopulationRole])
def __init__(self, filename=None): QAbstractListModel.__init__(self) self.city_list = [] self.kraje_list = [] self.obce_list = [] self.okres_v = None self.dolnimez = 0 self.hornimez = 1400000 self.mesta = False self.obce = False self.vybranyokres = None self.vybranykraj = None if filename: self.load_from_json(filename)
def __init__(self, snapshotModel, parent=None): QAbstractListModel.__init__(self, parent=None) self.viewpoints = [] """ List of instances of `ViewpointReference` """ # used to retrieve the snapshot icons. self.snapshotModel = snapshotModel """ Reference to SnapshotModel used to retrieve icons of the snapshots """ # set up the sizes and offsets self._iconQSize = None """ Size in pixels """ self._iconSize = QSize(10, 10) """ Size in millimeters """ self.calcSizes()
def __init__(self): QAbstractListModel.__init__(self) self.__rows = 16 # 行数 self.__cols = 30 # 列数 self.__minesCount = 99 # 总地雷数 self.count_opened = 0 # 揭开的块的总数 self.markedCount = 0 # 已经标记地雷的总数 self.gameStatus = 0 # 游戏状态 0:等待,1:正在进行,2:成功,3:引爆了 self.__table = [] # * (self.__cols * self.__rows) for i in range(self.__rows * self.__cols): self.__table.append({ 'mineflag': False, 'openedflag': False, 'mark': "", 'minesaround': 0 }) item = QStandardItem(i, 0) item.setFlags(item.flags() | Qt.ItemIsEditable)
def setData(self, index, value, role=Qt.EditRole): if index.isValid(): marker = self._items[index.row()] if role == MarkersModel.CoordinatesRole: marker.set_coordinates(value) if role == MarkersModel.ColorRole: marker.set_color(value) if role == MarkersModel.WidthRole: marker.set_width(value) self.dataChanged.emit(index, index) return True return QAbstractListModel.setData(self, index, value, role)
def setData(self, index, value, role=Qt.EditRole): if index.isValid(): marker = self._items[index.row()] if role == MarkersModel.PositionRole: marker.setPosition(value) if role == MarkersModel.ColorRole: marker.set_color(value) if role == MarkersModel.SizeRole: marker.set_size(value) if role == MarkersModel.PropertiesRole: marker.set_properties(value) self.dataChanged.emit(index, index) return True return QAbstractListModel.setData(self, index, value, role)
def flags(self, index): defaultFlags = QAbstractListModel.flags(self,index); return Qt.ItemIsDropEnabled | defaultFlags;
def __init__(self,data,tablemodel,fileList ,parent=None): QAbstractListModel.__init__(self, parent) self.metadataList = fileList self.tablemodel = tablemodel
def __init__(self): QAbstractListModel.__init__(self)
def __init__(self): QAbstractListModel.__init__(self) self._itemlist = []
def __init__(self): QAbstractListModel.__init__(self) self._items = SortedDict()
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) self.addons = []
def flags(self, index): if not index.isValid(): return Qt.ItemIsEnabled return QAbstractListModel.flags(index) | Qt.ItemIsEditable
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) self._items = []
def __init__(self): QAbstractListModel.__init__(self) self.setRoleNames({0: 'pysideModelData'})
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) self.obj = MyObject() self.obj.setObjectName(object_name)
def __init__(self, parent = None): QAbstractListModel.__init__(self, parent) self._data = []
def __init__(self): QAbstractListModel.__init__(self) self.updateTopics() self.items = []
def __init__(self, parent=None): QAbstractListModel.__init__(self, parent) self.readFromFile("content.txt")
def __init__(self, parent = None): QAbstractListModel.__init__(self, parent) self.m_objects = []