Delete QWebViews when tabs are closed.
This commit is contained in:
parent
26787b0d30
commit
83276b9576
@ -73,6 +73,8 @@ class TabbedBrowser(TabWidget):
|
|||||||
space.setContext(Qt.WidgetWithChildrenShortcut)
|
space.setContext(Qt.WidgetWithChildrenShortcut)
|
||||||
space.activated.connect(self.space_scroll)
|
space.activated.connect(self.space_scroll)
|
||||||
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
||||||
|
self.tabCloseRequested.connect(lambda idx:
|
||||||
|
self.widget(idx).deleteLater())
|
||||||
|
|
||||||
def tabopen(self, url):
|
def tabopen(self, url):
|
||||||
"""Open a new tab with a given url.
|
"""Open a new tab with a given url.
|
||||||
@ -141,6 +143,8 @@ class TabbedBrowser(TabWidget):
|
|||||||
# FIXME maybe we actually should store the webview objects here
|
# FIXME maybe we actually should store the webview objects here
|
||||||
self._url_stack.append(tab.url())
|
self._url_stack.append(tab.url())
|
||||||
self.removeTab(idx)
|
self.removeTab(idx)
|
||||||
|
# Mark the QWebView to be deleted later in the main Qt loop.
|
||||||
|
tab.deleteLater()
|
||||||
else:
|
else:
|
||||||
# FIXME
|
# FIXME
|
||||||
pass
|
pass
|
||||||
|
Loading…
Reference in New Issue
Block a user