Fix reparenting issues with layouts

This commit is contained in:
Florian Bruhin 2014-06-19 14:13:44 +02:00
parent 00fb7b8f68
commit d642aa48c1
3 changed files with 8 additions and 17 deletions

11
BUGS
View File

@ -1,17 +1,6 @@
Bugs Bugs
==== ====
- Problems since the reparenting commits:
- QLayout: Attempting to add QLayout "" to StatusBar "StatusBar", which already has a layout
- QLayout: Attempting to add QLayout "" to ExceptionCrashDialog "", which already has a layout
- Small empty window spawning at start
- QWindowsWindow::setGeometry: Unable to set geometry 5x13+-959+505 on
QWidgetWindow/'TextClassWindow'. Resulting geometry: 116x13+-959+505 (frame:
8, 30, 8, 8, custom margin: 0, 0, 0, 0, minimum size: 0x0, maximum size:
16777215x16777215).
- On doodle, when modifying something on http://doodle.com/create and clicking - On doodle, when modifying something on http://doodle.com/create and clicking
a link to leave the page, the message is suboptimal. Also, with some random a link to leave the page, the message is suboptimal. Also, with some random
clicking it's somehow possible to get out of yesno mode. clicking it's somehow possible to get out of yesno mode.

View File

@ -90,9 +90,9 @@ class _CrashDialog(QDialog):
Should be extended by superclass to provide the actual buttons. Should be extended by superclass to provide the actual buttons.
""" """
self._hbox = QHBoxLayout(self) self._hbox = QHBoxLayout()
self._hbox.addStretch()
self._vbox.addLayout(self._hbox) self._vbox.addLayout(self._hbox)
self._hbox.addStretch()
def _set_text_flags(self, obj): def _set_text_flags(self, obj):
"""Set text interaction flags of a widget to allow link clicking. """Set text interaction flags of a widget to allow link clicking.

View File

@ -123,7 +123,8 @@ class StatusBar(QWidget):
self._hbox.setContentsMargins(0, 0, 0, 0) self._hbox.setContentsMargins(0, 0, 0, 0)
self._hbox.setSpacing(5) self._hbox.setSpacing(5)
self._stack = QStackedLayout(self) self._stack = QStackedLayout()
self._hbox.addLayout(self._stack)
self._stack.setContentsMargins(0, 0, 0, 0) self._stack.setContentsMargins(0, 0, 0, 0)
self.cmd = Command() self.cmd = Command()
@ -147,8 +148,6 @@ class StatusBar(QWidget):
self.prompt.hide_prompt.connect(self._hide_prompt_widget) self.prompt.hide_prompt.connect(self._hide_prompt_widget)
self._hide_prompt_widget() self._hide_prompt_widget()
self._hbox.addLayout(self._stack)
self.keystring = KeyString() self.keystring = KeyString()
self._hbox.addWidget(self.keystring) self._hbox.addWidget(self.keystring)
@ -158,7 +157,10 @@ class StatusBar(QWidget):
self.percentage = Percentage() self.percentage = Percentage()
self._hbox.addWidget(self.percentage) self._hbox.addWidget(self.percentage)
self.prog = Progress() # We add a parent to Progress here because it calls self.show() based
# on some signals, and if that happens before it's added to the layout,
# it will quickly blink up as independent window.
self.prog = Progress(self)
self._hbox.addWidget(self.prog) self._hbox.addWidget(self.prog)
def __repr__(self): def __repr__(self):