simplify icon

This commit is contained in:
nobohan
2021-07-13 11:47:27 +02:00
parent ca258bc445
commit 04af3c1884
6 changed files with 24 additions and 91 deletions

View File

@@ -15,31 +15,27 @@ class PlotLayoutItem(QgsLayoutItem):
def __init__(self, layout):
super().__init__(layout)
# self.setCacheMode(QGraphicsItem.NoCache)
# self.plot_settings = []
# self.plot_settings.append(PlotSettings())
# self.linked_map_uuid = ''
# self.linked_map = None
# self.filter_by_map = False
# self.filter_by_atlas = False
def draw(self, context):
pass
# if not self.html_loaded:
# self.load_content()
# self.web_page = LoggingWebPage(self)
# self.web_page.setNetworkAccessManager(QgsNetworkAccessManager.instance())
# if not self.layout().renderContext().isPreviewRender():
# # this is NOT safe to do when rendering in the gui (i.e. a preview render), but for exports we have
# # to loop around until the HTML has fully loaded
# while not self.html_loaded:
# QCoreApplication.processEvents()
# # This makes the background transparent. (copied from QgsLayoutItemLabel)
# palette = self.web_page.palette()
# palette.setBrush(QPalette.Base, Qt.transparent)
# self.web_page.setPalette(palette)
# self.web_page.mainFrame().setZoomFactor(10.0)
# self.web_page.mainFrame().setScrollBarPolicy(Qt.Horizontal, Qt.ScrollBarAlwaysOff)
# self.web_page.mainFrame().setScrollBarPolicy(Qt.Vertical, Qt.ScrollBarAlwaysOff)
# # almost a direct copy from QgsLayoutItemLabel!
# painter = context.renderContext().painter()
# painter.save()
# self.web_page.loadFinished.connect(self.loading_html_finished)
# self.html_loaded = False
# self.html_units_to_layout_units = self.calculate_html_units_to_layout_units()
# self.sizePositionChanged.connect(self.refresh)
# # painter is scaled to dots, so scale back to layout units
# painter.scale(context.renderContext().scaleFactor() / self.html_units_to_layout_units,
# context.renderContext().scaleFactor() / self.html_units_to_layout_units)
# self.web_page.mainFrame().render(painter)
# painter.restore()
def type(self):
return ITEM_TYPE
@@ -47,7 +43,7 @@ class PlotLayoutItem(QgsLayoutItem):
class PlotLayoutItemMetadata(QgsLayoutItemAbstractMetadata):
def __init__(self):
super().__init__(ITEM_TYPE, 'test')
super().__init__(ITEM_TYPE, 'layoutItem')
def createItem(self, layout):
return PlotLayoutItem(layout)