コード例 #1
0
ファイル: layer_artist_model.py プロジェクト: rguter/glue
    def data(self, index, role):
        """Retrieve data at each index"""
        if not index.isValid():
            return None
        if role == Qt.DecorationRole:
            art = self.artists[index.row()]
            result = layer_artist_icon(art)
            return result
        if role == Qt.CheckStateRole:
            art = self.artists[index.row()]
            result = Qt.Checked if art.visible else Qt.Unchecked
            return result
        if role == Qt.ToolTipRole:
            art = self.artists[index.row()]
            if not art.enabled:
                return art.disabled_message

        return super(LayerArtistModel, self).data(index, role)
コード例 #2
0
ファイル: layer_artist_model.py プロジェクト: robintw/glue
    def data(self, index, role):
        """Retrieve data at each index"""
        if not index.isValid():
            return None
        if role == Qt.DecorationRole:
            art = self.artists[index.row()]
            result = layer_artist_icon(art)
            return result
        if role == Qt.CheckStateRole:
            art = self.artists[index.row()]
            result = Qt.Checked if art.visible else Qt.Unchecked
            return result
        if role == Qt.ToolTipRole:
            art = self.artists[index.row()]
            if not art.enabled:
                return art.disabled_message

        return super(LayerArtistModel, self).data(index, role)
コード例 #3
0
ファイル: layer_artist_model.py プロジェクト: glue-viz/glue
    def data(self, index, role):
        """Retrieve data at each index"""
        if not index.isValid() or index.row() >= len(self.artists):
            return None
        if role == Qt.DecorationRole:
            art = self.artists[index.row()]
            result = layer_artist_icon(art)
            return result
        if role == Qt.CheckStateRole:
            art = self.artists[index.row()]
            result = Qt.Checked if art.visible and art.enabled else Qt.Unchecked
            return result
        if role == Qt.ToolTipRole:
            art = self.artists[index.row()]
            if not art.enabled:
                wrapped = textwrap.fill(art.disabled_message, break_long_words=False)
                return wrapped

        return super(LayerArtistModel, self).data(index, role)
コード例 #4
0
ファイル: layer_artist_model.py プロジェクト: octwanna/glue
    def data(self, index, role):
        """Retrieve data at each index"""
        if not index.isValid() or index.row() >= len(self.artists):
            return None
        if role == Qt.DecorationRole:
            art = self.artists[index.row()]
            result = layer_artist_icon(art)
            return result
        if role == Qt.CheckStateRole:
            art = self.artists[index.row()]
            result = Qt.Checked if art.visible and art.enabled else Qt.Unchecked
            return result
        if role == Qt.ToolTipRole:
            art = self.artists[index.row()]
            if not art.enabled:
                wrapped = textwrap.fill(art.disabled_message, break_long_words=False)
                return wrapped

        return super(LayerArtistModel, self).data(index, role)