Fix crashes after parent-child cleanup.

This commit is contained in:
Florian Bruhin 2014-06-17 10:20:15 +02:00
parent 7dfd7d018b
commit fe99cbc331
3 changed files with 5 additions and 10 deletions

View File

@ -136,7 +136,7 @@ class Application(QApplication):
self.searchmanager = SearchManager(self)
self.downloadmanager = DownloadManager(self)
self.downloadmodel = DownloadModel(self.downloadmanager)
self.mainwindow = MainWindow(self)
self.mainwindow = MainWindow()
self.modeman.mainwindow = self.mainwindow
self.installEventFilter(self.modeman)

View File

@ -46,7 +46,7 @@ class Progress(QProgressBar):
}}
"""
def __init__(self, parent):
def __init__(self, parent=None):
super().__init__(parent)
set_register_stylesheet(self)
self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Ignored)

View File

@ -69,14 +69,9 @@ class Url(TextBase):
}}
"""
def __init__(self, bar, elidemode=Qt.ElideMiddle):
"""Override TextBase::__init__ to elide in the middle by default.
Args:
bar: The statusbar (parent) object.
elidemode: How to elide the text.
"""
super().__init__(bar, elidemode)
def __init__(self, parent=None):
"""Override TextBase.__init__ to elide in the middle by default."""
super().__init__(parent, Qt.ElideMiddle)
self.setObjectName(self.__class__.__name__)
set_register_stylesheet(self)
self._hover_url = None