eric6/WebBrowser/Bookmarks/BookmarksToolBar.py

changeset 7628
f904d0eef264
parent 7360
9190402e4505
child 7759
51aa6c6b66f7
equal deleted inserted replaced
7626:7f643d41464e 7628:f904d0eef264
133 """ 133 """
134 Private slot handling the activation of a bookmark. 134 Private slot handling the activation of a bookmark.
135 135
136 @param idx index of the activated bookmark (QModelIndex) 136 @param idx index of the activated bookmark (QModelIndex)
137 """ 137 """
138 assert idx.isValid() 138 if idx.isValid():
139 139 if self._mouseButton == Qt.XButton1:
140 if self._mouseButton == Qt.XButton1: 140 self.__mw.currentBrowser().triggerPageAction(
141 self.__mw.currentBrowser().triggerPageAction(QWebEnginePage.Back) 141 QWebEnginePage.Back)
142 elif self._mouseButton == Qt.XButton2: 142 elif self._mouseButton == Qt.XButton2:
143 self.__mw.currentBrowser().triggerPageAction( 143 self.__mw.currentBrowser().triggerPageAction(
144 QWebEnginePage.Forward) 144 QWebEnginePage.Forward)
145 elif self._mouseButton == Qt.LeftButton: 145 elif self._mouseButton == Qt.LeftButton:
146 if self._keyboardModifiers & Qt.ControlModifier: 146 if self._keyboardModifiers & Qt.ControlModifier:
147 self.newTab.emit( 147 self.newTab.emit(
148 idx.data(BookmarksModel.UrlRole), 148 idx.data(BookmarksModel.UrlRole),
149 idx.data(Qt.DisplayRole)) 149 idx.data(Qt.DisplayRole))
150 elif self._keyboardModifiers & Qt.ShiftModifier: 150 elif self._keyboardModifiers & Qt.ShiftModifier:
151 self.newWindow.emit( 151 self.newWindow.emit(
152 idx.data(BookmarksModel.UrlRole), 152 idx.data(BookmarksModel.UrlRole),
153 idx.data(Qt.DisplayRole)) 153 idx.data(Qt.DisplayRole))
154 else: 154 else:
155 self.openUrl.emit( 155 self.openUrl.emit(
156 idx.data(BookmarksModel.UrlRole), 156 idx.data(BookmarksModel.UrlRole),
157 idx.data(Qt.DisplayRole)) 157 idx.data(Qt.DisplayRole))
158 self.__updateVisitCount(idx) 158 self.__updateVisitCount(idx)
159 159
160 def __openBookmark(self, act): 160 def __openBookmark(self, act):
161 """ 161 """
162 Private slot to open a bookmark in the current browser tab. 162 Private slot to open a bookmark in the current browser tab.
163 163

eric ide

mercurial