101 event.type() == QEvent.MouseButtonRelease: |
101 event.type() == QEvent.MouseButtonRelease: |
102 if self.__tocWidget.indexAt(event.pos()).isValid() and \ |
102 if self.__tocWidget.indexAt(event.pos()).isValid() and \ |
103 event.button() == Qt.LeftButton: |
103 event.button() == Qt.LeftButton: |
104 self.itemClicked(self.__tocWidget.currentIndex()) |
104 self.itemClicked(self.__tocWidget.currentIndex()) |
105 elif self.__tocWidget.indexAt(event.pos()).isValid() and \ |
105 elif self.__tocWidget.indexAt(event.pos()).isValid() and \ |
106 event.button() == Qt.MidButton: |
106 event.button() == Qt.MidButton: |
107 model = self.__tocWidget.model() |
107 model = self.__tocWidget.model() |
108 itm = model.contentItemAt(self.__tocWidget.currentIndex()) |
108 itm = model.contentItemAt(self.__tocWidget.currentIndex()) |
109 self.__mw.newTab(itm.url()) |
109 self.__mw.newTab(itm.url()) |
110 |
110 |
111 return QWidget.eventFilter(self, watched, event) |
111 return QWidget.eventFilter(self, watched, event) |