Don't use QShortcut for space scrolling

This commit is contained in:
Florian Bruhin 2014-05-01 23:25:51 +02:00
parent a8463a2c46
commit 4137e5de53
2 changed files with 3 additions and 7 deletions

View File

@ -503,6 +503,7 @@ DATA = OrderedDict([
('<Down>', '${k}'), ('<Down>', '${k}'),
('<Up>', '${j}'), ('<Up>', '${j}'),
('<Right>', '${l}'), ('<Right>', '${l}'),
('<Space>', '${<Ctrl-F>}'),
)), )),
('keybind.insert', sect.ValueList( ('keybind.insert', sect.ValueList(

View File

@ -20,8 +20,8 @@
import logging import logging
from functools import partial from functools import partial
from PyQt5.QtWidgets import QApplication, QShortcut, QSizePolicy from PyQt5.QtWidgets import QApplication, QSizePolicy
from PyQt5.QtCore import pyqtSignal, pyqtSlot, Qt from PyQt5.QtCore import pyqtSignal, pyqtSlot
from PyQt5.QtGui import QClipboard from PyQt5.QtGui import QClipboard
import qutebrowser.utils.url as urlutils import qutebrowser.utils.url as urlutils
@ -50,7 +50,6 @@ class TabbedBrowser(TabWidget):
Attributes: Attributes:
_url_stack: Stack of URLs of closed tabs. _url_stack: Stack of URLs of closed tabs.
_space: Space QShortcut to avoid garbage collection
_tabs: A list of open tabs. _tabs: A list of open tabs.
_filter: A SignalFilter instance. _filter: A SignalFilter instance.
cur: A CurCommandDispatcher instance to dispatch commands to the cur: A CurCommandDispatcher instance to dispatch commands to the
@ -95,10 +94,6 @@ class TabbedBrowser(TabWidget):
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
self._tabs = [] self._tabs = []
self._url_stack = [] self._url_stack = []
self._space = QShortcut(self)
self._space.setKey(Qt.Key_Space)
self._space.setContext(Qt.WidgetWithChildrenShortcut)
self._space.activated.connect(lambda: self.cur.scroll_page(0, 1))
self._filter = SignalFilter(self) self._filter = SignalFilter(self)
self.cur = CurCommandDispatcher(self) self.cur = CurCommandDispatcher(self)