I made a plugin that allows adding layers. And I did it as a popup window
self.setWindowFlags(Qt.WindowStaysOnTopHint | Qt.FramelessWindowHint)
This window is a child to qwindow()
active_window = Krita.instance().activeWindow().qwindow() self.popup.setParent(active_window )
I do paint shapes with
def paintEvent(self, event) -> None: painter = QPainter(self) self.move_icon.paint(painter) for b in self.buttons: b.paint(painter)
The paint looks like this:
def paint(self, painter): painter.setPen(self.pen) painter.fillPath(self.path, self.back_color) painter.drawPath(self.path) painter.drawPixmap(self.icon_rect, self.icon)
However when I switch tabs (dockers) the shapes disappear.
Am I missing something? Or maybe I should connect to qwindow event when tabs changes to redesplay the popup?
Would appreciate any advice