コード例 #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"))