示例#1
0
 def keyPressEvent(self, event):
     """Reimplement Qt method"""
     if event.key() in (Qt.Key_Enter, Qt.Key_Return):
         self.clicked()
     elif event.key() == Qt.Key_F2:
         self.rename()
     elif event.key() == Qt.Key_Delete:
         self.delete()
     else:
         QTreeView.keyPressEvent(self, event)
示例#2
0
 def keyPressEvent(self, event):
     """Reimplement Qt method"""
     if event.key() in (Qt.Key_Enter, Qt.Key_Return):
         self.clicked()
     elif event.key() == Qt.Key_F2:
         self.rename()
     elif event.key() == Qt.Key_Delete:
         self.delete()
     else:
         QTreeView.keyPressEvent(self, event)
示例#3
0
    def viewportEvent(self, event):
        """Reimplement Qt method"""

        # Prevent Qt from crashing or showing warnings like:
        # "QSortFilterProxyModel: index from wrong model passed to
        # mapFromSource", probably due to the fact that the file system model
        # is being built. See Issue 1250.
        #
        # This workaround was inspired by the following KDE bug:
        # https://bugs.kde.org/show_bug.cgi?id=172198
        #
        # Apparently, this is a bug from Qt itself.
        self.executeDelayedItemsLayout()

        return QTreeView.viewportEvent(self, event)
示例#4
0
    def viewportEvent(self, event):
        """Reimplement Qt method"""

        # Prevent Qt from crashing or showing warnings like:
        # "QSortFilterProxyModel: index from wrong model passed to 
        # mapFromSource", probably due to the fact that the file system model 
        # is being built. See Issue 1250.
        #
        # This workaround was inspired by the following KDE bug:
        # https://bugs.kde.org/show_bug.cgi?id=172198
        #
        # Apparently, this is a bug from Qt itself.
        self.executeDelayedItemsLayout()
        
        return QTreeView.viewportEvent(self, event)        
示例#5
0
 def mouseDoubleClickEvent(self, event):
     """Reimplement Qt method"""
     QTreeView.mouseDoubleClickEvent(self, event)
     self.clicked()
示例#6
0
 def mouseDoubleClickEvent(self, event):
     """Reimplement Qt method"""
     QTreeView.mouseDoubleClickEvent(self, event)
     self.clicked()