예제 #1
0
파일: project.py 프로젝트: raeisi/dot15926
 def __init__(self, tree):
     DefaultTreeDelegate.__init__(self, tree)
     self.imgs = (
         appdata.resources.GetPixmap("cross_gray"),
         appdata.resources.GetPixmap("cross_red"),
         appdata.resources.GetPixmap("dot_gray"),
         appdata.resources.GetPixmap("dot_red"),
     )
예제 #2
0
    def editorEvent(self, event, model, option, index):
        item = self.tree.itemFromIndex(index)
        if item.parent and item.IconStyle() != -1:
            if event.type() == QEvent.MouseMove:
                self.tree.viewport().repaint()

            if event.type() == QEvent.MouseButtonRelease or event.type(
            ) == QEvent.MouseButtonDblClick and event.button(
            ) == Qt.LeftButton:
                closeButtonRect = self.imgs[0].rect().translated(
                    self.closeIconPos(option))
                if closeButtonRect.contains(event.pos()):
                    self.tree.itemFromIndex(index).Destroy()
                    return True

        return DefaultTreeDelegate.editorEvent(self, event, model, option,
                                               index)
예제 #3
0
파일: project.py 프로젝트: raeisi/dot15926
    def editorEvent(self, event, model, option, index):
        item = self.tree.itemFromIndex(index)
        if item.parent and item.IconStyle() != -1:
            if event.type() == QEvent.MouseMove:
                self.tree.viewport().repaint()

            if (
                event.type() == QEvent.MouseButtonRelease
                or event.type() == QEvent.MouseButtonDblClick
                and event.button() == Qt.LeftButton
            ):
                closeButtonRect = self.imgs[0].rect().translated(self.closeIconPos(option))
                if closeButtonRect.contains(event.pos()):
                    self.tree.itemFromIndex(index).Destroy()
                    return True

        return DefaultTreeDelegate.editorEvent(self, event, model, option, index)
예제 #4
0
 def __init__(self, tree):
     DefaultTreeDelegate.__init__(self, tree)
     self.imgs = (appdata.resources.GetPixmap("cross_gray"),
                  appdata.resources.GetPixmap("cross_red"),
                  appdata.resources.GetPixmap("dot_gray"),
                  appdata.resources.GetPixmap("dot_red"))