def __init__(self, args): QTreeWidgetItem.__init__(self, args) self.extraInformation = u'' self.normalString = u'' #default type self.itemType = CHILDITEM
def __init__(self, action, collection, name): QTreeWidgetItem.__init__(self) self.collection = collection self.name = name self.setIcon(0, action.icon()) self.setText(0, qutil.removeAccelerator(action.text())) self._shortcuts = {}
def __init__(self, parent, exp): QTreeWidgetItem.__init__( self, parent, ['{} ({})'.format(exp.title, date_to_str(exp.done_on))] ) self.exp = exp self.setIcon(0, QIcon(':/icons/practice'))
def __init__(self, parent, test): QTreeWidgetItem.__init__( self, parent, ['{} ({})'.format(test.subject, date_to_str(test.done_on))] ) self.test = test self.setIcon(0, QIcon(':/icons/theory'))
def __init__(self): QTreeWidgetItem.__init__(self) self.download_info = None self._logger = logging.getLogger('TriblerGUI') bar_container = QWidget() bar_container.setLayout(QVBoxLayout()) bar_container.setStyleSheet("background-color: transparent;") self.progress_slider = QProgressBar() # We have to set a zero pixel border to get the background working on Mac. self.progress_slider.setStyleSheet(""" QProgressBar { background-color: white; color: black; font-size: 12px; text-align: center; border: 0px solid transparent; } QProgressBar::chunk { background-color: #e67300; } """) bar_container.layout().addWidget(self.progress_slider) bar_container.layout().setContentsMargins(4, 4, 8, 4) self.progress_slider.setAutoFillBackground(True) self.bar_container = bar_container
def __init__(self, parent): QTreeWidgetItem.__init__(self, parent) self.download_info = None bar_container = QWidget() bar_container.setLayout(QVBoxLayout()) bar_container.setStyleSheet("background-color: transparent;") self.progress_slider = QProgressBar() self.progress_slider.setStyleSheet(""" QProgressBar { background-color: white; color: black; font-size: 12px; text-align: center; } QProgressBar::chunk { background-color: #e67300; } """) bar_container.layout().addWidget(self.progress_slider) bar_container.layout().setContentsMargins(4, 4, 8, 4) parent.setItemWidget(self, 2, bar_container) self.progress_slider.setAutoFillBackground(True)
def __init__(self, *args, **kwargs): QTreeWidgetItem.__init__(self, *args, **kwargs) self.Type = 'WB' self.Path = '' self.Img_Block_Pre = None self.act_change = QAction('Change') self.act_delete = QAction('Delete')
def __init__(self): QTreeWidgetItem.__init__(self) self.download_info = None self._logger = logging.getLogger('TriblerGUI') bar_container = QWidget() bar_container.setLayout(QVBoxLayout()) bar_container.setStyleSheet("background-color: transparent;") self.progress_slider = QProgressBar() # We have to set a zero pixel border to get the background working on Mac. self.progress_slider.setStyleSheet( """ QProgressBar { background-color: white; color: black; font-size: 12px; text-align: center; border: 0px solid transparent; } QProgressBar::chunk { background-color: #e67300; } """ ) bar_container.layout().addWidget(self.progress_slider) bar_container.layout().setContentsMargins(4, 4, 8, 4) self.progress_slider.setAutoFillBackground(True) self.bar_container = bar_container
def __init__(self, parent=None, text="", which=0): # print(type(parent)) QTreeWidgetItem.__init__(self, parent) self.setSizeHint(0, QSize(280, 30)) # 设置Item大小 self.setTitle(text) # 设置该Item的文字 self.setIcon(0, cache.item_icon) # 设置展开和关闭时候的图标 self.which = which
def __init__(self, parent, company): if company: text = [company.short_name, company.name] else: text = ['Kürzel', 'Voller Name'] QTreeWidgetItem.__init__(self, parent, text) self.company = company self.modified = False
def __init__(self, parent, course): QTreeWidgetItem.__init__(self, parent, [course.title]) self.course = course self.setIcon(0, QIcon(':/icons/course')) tip = '{}, {:%d.%m.%Y} - {:%d.%m.%Y}'.format( course.title, course.start, course.end ) self.setToolTip(0, tip)
def __init__(self, parent=None, itemlist=[], type=0, file_name_short="dummy", file_type=None): """**Constructor**""" QTreeWidgetItem.__init__(self, parent, itemlist, type)
def __init__(self, parent=None): """ **Constructor** Keyword Arguments: - parent {[type]} -- [description] (default: {None}) """ QTreeWidgetItem.__init__(self, parent)
def __init__(self, player): if type(player) == Player: items = [ player.firstName + ' ' + player.lastName, str(player.rating) ] else: items = player QTreeWidgetItem.__init__(self, items)
def __init__(self, item, overlayPathName): """ item: OverlayTreeWidgetItem overlayPathName: string full name of the overlay, for example 'File Overlays/My Data' """ self.overlayPathName = overlayPathName QTreeWidgetItem.__init__(self, [item.name]) self.item = item
def __init__(self, key_type, level, key): self.key_type = key_type self.level = level self.key = key self.wif = key.wif(use_uncompressed=False) self.sec = key.sec_as_hex(use_uncompressed=False) self.address = key.address(use_uncompressed=False) entry = [self.key_type, self.level, self.wif, self.sec, self.address] QTreeWidgetItem.__init__(self, entry)
def __init__(self, parent=None, itemlist=[], type=0): """ **Constructor** Keyword Arguments: - parent {[type]} -- [description] (default: {None}) - type {[type]} -- [description] (default: {0}) """ QTreeWidgetItem.__init__(self, parent, itemlist, type)
def __init__(self, o): if isinstance(o, list): QTreeWidgetItem.__init__(self, o) elif isinstance(o, Tip): self.tip = o self.tip.tiplist_item = self self.__init__(self.getDataArray(self.tip)) else: QTreeWidgetItem.__init__(self) self.refreshData()
def __init__(self, parent, device): QTreeWidgetItem.__init__(self, parent) self._device = device self.setText(0, device.lvname) mountpoint = getattr(device.format, "mountpoint", "") if not mountpoint: mountpoint = "" elif not (device.format and device.format.mountable): mountpoint = "N/A" self.setText(1, mountpoint) self.setText(2, "%Ld" % device.size)
def __init__(self, parent, package, component): QTreeWidgetItem.__init__(self, parent) self.package = package self.component = component self.required = False self.setCheckState(0, Qt.Unchecked) self.setText(0, package.name) self.setText(1, "%.3f" % (package.size / 1024.0 / 1024.0)) self.setText(2, package.version) self.setText(3, package.release)
def __init__(self, parent: Optional[FolderWidgetItem], script: model.Script): QTreeWidgetItem.__init__(self) self.script = script self.setIcon(0, QIcon.fromTheme("text-x-python")) self.setText(0, script.description) self.setText(1, script.get_abbreviations()) self.setText(2, script.get_hotkey_string()) self.setData(3, Qt.UserRole, script) if parent is not None: # TODO: Script without parent allowed? This is should be an error. parent.addChild(self) self.setFlags(self.flags() | Qt.ItemIsEditable)
def __init__(self, parent, transaction, asset1_prec, asset2_prec): QTreeWidgetItem.__init__(self, parent) self.transaction = transaction self.asset1_prec = asset1_prec self.asset2_prec = asset2_prec self.asset1_amount = 0 self.asset2_amount = 0 self.transferred_asset1_amount = 0 self.transferred_asset2_amount = 0 self.update_item()
def __init__(self, parent: Optional[FolderWidgetItem], phrase: model.Phrase): QTreeWidgetItem.__init__(self) self.phrase = phrase self.setIcon(0, QIcon.fromTheme("text-x-generic")) self.setText(0, phrase.description) self.setText(1, phrase.get_abbreviations()) self.setText(2, phrase.get_hotkey_string()) self.setData(3, Qt.UserRole, phrase) if parent is not None: # TODO: Phrase without parent allowed? This is should be an error. parent.addChild(self) self.setFlags(self.flags() | Qt.ItemIsEditable)
def __init__(self, parent: Optional[QTreeWidgetItem], folder: model.Folder): QTreeWidgetItem.__init__(self) self.folder = folder self.setIcon(0, QIcon.fromTheme("folder")) self.setText(0, folder.title) self.setText(1, folder.get_abbreviations()) self.setText(2, folder.get_hotkey_string()) self.setData(3, Qt.UserRole, folder) if parent is not None: parent.addChild(self) self.setFlags(self.flags() | Qt.ItemIsEditable)
def __init__(self, name, layers, tree): QTreeWidgetItem.__init__(self) self.layers = layers self.name = name self.setText(0, name) self.setIcon(0, self.groupIcon) self.setCheckState(0, Qt.Checked) self.visibleItem = QTreeWidgetItem(self) self.visibleCheck = QCheckBox() self.visibleCheck.setChecked(True) self.visibleItem.setText(0, "Layers visibility") self.addChild(self.visibleItem) tree.setItemWidget(self.visibleItem, 1, self.visibleCheck)
def __init__(self, parent=None, data=None): QTreeWidgetItem.__init__(self, parent) self.data = data self.has_data = self.data is not None self.error = None self.state = '' self.root = '' if self.has_data: if self.data['error'] != 'null': self.error = self.data['error'] self.state = state_map[self.error] self.root = self.data['root'] del self.data['error'] del self.data['root']
def __init__(self, parent, file_size=None, file_index=None, file_progress=None): QTreeWidgetItem.__init__(self, parent) self.file_size = file_size self.file_index = file_index self.file_progress = file_progress self.progress_bytes = 0 if file_size is not None and file_progress is not None: self.progress_bytes = file_size * file_progress
def __init__(self, parent, order): QTreeWidgetItem.__init__(self, parent) self.order = order order_time = datetime.datetime.fromtimestamp(int( order["timestamp"])).strftime('%Y-%m-%d %H:%M:%S') self.setText(0, "%s" % order["order_number"]) self.setText(1, order_time) self.setText(2, "%g %s" % (order["price"], order["price_type"])) self.setText(3, "%g %s" % (order["quantity"], order["quantity_type"])) self.setText( 4, "%g %s" % (order["traded_quantity"], order["quantity_type"])) self.setText(5, "Sell" if order["is_ask"] else "Buy") self.setText(6, "%s" % order["status"])
def __init__(self, parent, order, asset1_prec, asset2_prec): QTreeWidgetItem.__init__(self, parent) self.order = order order_time = datetime.datetime.fromtimestamp(int(order["timestamp"])).strftime('%Y-%m-%d %H:%M:%S') self.total_volume = prec_div(order["assets"]["first"]["amount"], asset1_prec) self.traded_volume = prec_div(order["traded"], asset1_prec) self.price = float(self.total_volume) / float(prec_div(order["assets"]["second"]["amount"], asset2_prec)) self.setText(0, "%s" % order["order_number"]) self.setText(1, order_time) self.setText(2, "%g %s" % (self.price, order["assets"]["second"]["type"])) self.setText(3, "%g %s" % (self.total_volume, order["assets"]["first"]["type"])) self.setText(4, "%g %s" % (self.traded_volume, order["assets"]["first"]["type"])) self.setText(5, "Sell" if order["is_ask"] else "Buy") self.setText(6, "%s" % order["status"])
def __init__(self, parent=None, itemlist=[], type=0, file_name_short="dummy", file_type=None): """ **Constructor** Keyword Arguments: - parent {[type]} -- [description] (default: {None}) - type {[type]} -- [description] (default: {0}) - file_name_short {[type]} -- [description] (default: {"dummy"}) - file_type {[type]} -- [description] (default: {None}) """ QTreeWidgetItem.__init__(self, parent, itemlist, type)
def __init__(self, parent, tick, asset1_prec, asset2_prec): QTreeWidgetItem.__init__(self, parent) self.tick = tick self.total_volume = prec_div(tick["assets"]["first"]["amount"], asset1_prec) self.cur_volume = prec_div(tick["assets"]["first"]["amount"] - tick["traded"], asset1_prec) self.price = float(self.total_volume) / float(prec_div(tick["assets"]["second"]["amount"], asset2_prec)) if self.tick["type"] == "ask": self.setText(0, "%g" % self.price) self.setText(1, "%g" % self.cur_volume) self.setText(2, "%g" % self.total_volume) else: self.setText(0, "%g" % self.total_volume) self.setText(1, "%g" % self.cur_volume) self.setText(2, "%g" % self.price)
def __init__(self, parent, tree, name, value, action=None): QTreeWidgetItem.__init__(self, parent) self.parent = parent self.tree = tree self.name = name self._value = value self.combo = None self.setText(0, name) widget = None if isinstance(value, QgsColorButton): widget = value elif isinstance(value, bool): if value: self.setCheckState(1, Qt.Checked) else: self.setCheckState(1, Qt.Unchecked) elif isinstance(value, tuple): self.combo = QComboBox() self.combo.setSizeAdjustPolicy(0) for option in value: self.combo.addItem(option) widget = self.combo else: self.setText(1, unicode(value)) if action: layout = QHBoxLayout() layout.setMargin(0) if widget: layout.addWidget(widget) button = QToolButton() button.setDefaultAction(action) button.setText(action.text()) layout.addWidget(button) layout.addStretch(1) widget = QWidget() widget.setLayout(layout) if widget: self.tree.setItemWidget(self, 1, widget)
def __init__(self, parent=None, name=''): QTreeWidgetItem.__init__(self, parent, name) self.isFile = True self._path = ''
def __init__(self, notepad, label): QTreeWidgetItem.__init__(self, [label]) self.notepad = notepad self.wasExpanded = False
def __init__(self, parent, file_info): QTreeWidgetItem.__init__(self, parent) self.file_info = file_info
def __init__(self): QTreeWidgetItem.__init__(self) # used to record the yeahdoc item self.__mark = None
def __init__(self, parent, component): QTreeWidgetItem.__init__(self, parent) self.component = component self.setCheckState(0, Qt.Unchecked) self.setText(0, component)
def __init__(self, iface, layer, tree, dlg): QTreeWidgetItem.__init__(self) self.iface = iface self.layer = layer self.setText(0, layer.name()) self.setIcon(0, self.layerIcon) project = QgsProject.instance() if project.layerTreeRoot().findLayer(layer.id()).isVisible(): self.setCheckState(0, Qt.Checked) else: self.setCheckState(0, Qt.Unchecked) self.visibleItem = QTreeWidgetItem(self) self.visibleCheck = QCheckBox() vis = layer.customProperty("qgis2web/Visible", True) if (vis == 0 or unicode(vis).lower() == "false"): self.visibleCheck.setChecked(False) else: self.visibleCheck.setChecked(True) self.visibleItem.setText(0, "Visible") self.addChild(self.visibleItem) tree.setItemWidget(self.visibleItem, 1, self.visibleCheck) if layer.type() == layer.VectorLayer: if layer.providerType() == 'WFS': self.jsonItem = QTreeWidgetItem(self) self.jsonCheck = QCheckBox() if layer.customProperty("qgis2web/Encode to JSON") == 2: self.jsonCheck.setChecked(True) self.jsonItem.setText(0, "Encode to JSON") self.jsonCheck.stateChanged.connect(self.changeJSON) self.addChild(self.jsonItem) tree.setItemWidget(self.jsonItem, 1, self.jsonCheck) if layer.geometryType() == QgsWkbTypes.PointGeometry: self.clusterItem = QTreeWidgetItem(self) self.clusterCheck = QCheckBox() if layer.customProperty("qgis2web/Cluster") == 2: self.clusterCheck.setChecked(True) self.clusterItem.setText(0, "Cluster") self.clusterCheck.stateChanged.connect(self.changeCluster) self.addChild(self.clusterItem) tree.setItemWidget(self.clusterItem, 1, self.clusterCheck) self.popupItem = QTreeWidgetItem(self) self.popupItem.setText(0, "Popup fields") options = [] fields = self.layer.fields() for f in fields: fieldIndex = fields.indexFromName(unicode(f.name())) editorWidget = layer.editorWidgetSetup(fieldIndex).type() if editorWidget == 'Hidden': continue options.append(f.name()) for option in options: self.attr = QTreeWidgetItem(self) self.attrWidget = QComboBox() self.attrWidget.addItem("no label") self.attrWidget.addItem("inline label") self.attrWidget.addItem("header label") custProp = layer.customProperty("qgis2web/popup/" + option) if (custProp != "" and custProp is not None): self.attrWidget.setCurrentIndex( self.attrWidget.findText( layer.customProperty("qgis2web/popup/" + option))) self.attr.setText(1, option) self.popupItem.addChild(self.attr) tree.setItemWidget(self.attr, 2, self.attrWidget) self.addChild(self.popupItem) else: if layer.providerType() == 'wms': self.getFeatureInfoItem = QTreeWidgetItem(self) self.getFeatureInfoCheck = QCheckBox() if layer.customProperty("qgis2web/GetFeatureInfo") == 2: self.getFeatureInfoCheck.setChecked(True) self.getFeatureInfoItem.setText(0, "Enable GetFeatureInfo?") self.getFeatureInfoCheck.stateChanged.connect( self.changeGetFeatureInfo) self.addChild(self.getFeatureInfoItem) tree.setItemWidget(self.getFeatureInfoItem, 1, self.getFeatureInfoCheck)
def __init__(self, parent): QTreeWidgetItem.__init__(self, parent)