def restore_item(self, datastream, item): num_childs = datastream.readUInt32() for i in range(0, num_childs): child = QTreeWidgetItem() child.read(datastream) item.addChild(child) self.restore_item(datastream, child)
def restore_item(self, datastream, _): num_childs = datastream.readUInt32() for _ in range(0, num_childs): child = QTreeWidgetItem() child.read(datastream) self.bar.addAction(obtainAction(child.text(0), self.iface)) self.restore_item(datastream, child)
def listMyToolBars(self): self.MyToolsBars.clear() self.file.open(QIODevice.ReadOnly) datastream = QDataStream(self.file) num_childs = datastream.readUInt32() for i in range(0, num_childs): self.MyToolsBars.setEnabled(True) self.My_expand.setEnabled(True) self.My_Collapse.setEnabled(True) item = QTreeWidgetItem() item.read(datastream) self.MyToolsBars.insertTopLevelItem(i, item) self.restore_item(datastream, item) self.file.close()
def MyToolBars(self): ''' Create user toolbars ''' self.file.open(QIODevice.ReadOnly) datastream = QDataStream(self.file) num_childs = datastream.readUInt32() for _ in range(0, num_childs): item = QTreeWidgetItem() item.read(datastream) self.bar = None DelToolBarIface(item.text(0), self.iface) self.bar = self.iface.mainWindow().addToolBar(item.text(0)) self.restore_item(datastream, item) self.file.close() return